1. Please how can select Assigned Court so that the Assigned Judge and his Court Location

should be auto selected...What I was able to do is just for Assigned court and Assigned

Judge..Please I need help to capture the three. This can be found on the Second ICON after

login...Add Entry

  1. Under Add Control User (4th ICON)...I tried ading user profile picture but its showing

error. Please assist

  1. On the Report page (6th Icon), Status of cases per court should be included and a Report

graph in bar chart should be displayed at the bottom of the page so that report for all cases,

selected case can show up.

Recommended Answers

All 18 Replies

Action.php file

<?php
////
session_start();
include"includes/connect.php";
$admin=mysql_fetch_array(mysql_query("select * from users where username='$_SESSION[user]' limit 1"));
$act=$_GET['act'];

switch ($act) {

    case 'adduser':
if($admin['type']=='Super Admin'){
$fullname=trim(htmlspecialchars($_POST['fullname']));
$username=trim(htmlspecialchars($_POST['username']));
$dept=trim(htmlspecialchars($_POST['dept']));
$design=trim(htmlspecialchars($_POST['design']));
$phone=trim(htmlspecialchars($_POST['phone']));
$email=trim(htmlspecialchars($_POST['email']));
$password=trim(htmlspecialchars($_POST['password']));
$type=trim(htmlspecialchars($_POST['type']));
$passport=trim(htmlspecialchars($_POST['passport']));

if($fullname !='' and $username!='' and $dept!='' and $design!='' and $phone!='' and $email!='' and $type!='0' and $password!='' and $passport!=''){
    if (!mysql_num_rows(mysql_query("select * from users where username='$username' limit 1"))) {
   if(mysql_query("insert into users (fullname,username,dept,design,phone,email,password,type,passport) values ('$fullname','$username','$dept','$design','$phone','$email','$password','$type','$passport')")){
    echo"<div class='success'>User added with success</div><br>
    <div>
    <div class='goback'  onclick='history.go(0);'>Go Back</div>
    </div>";
}
}else{

    echo "<div class='error'>Please Choose another username</div>
    <div class='gobcktofrmaddusr'>Go Back</div>";
}
}else{

    echo "<div class='error'>Please Fill in all the Blank </div>
    <div class='gobcktofrmaddusr goback'>Go Back</div>";
}


}
    break;

    case 'dltuser':
$a=intval($_POST['a']);
mysql_query("delete from users where id='$a' limit 1");
    break;
case 'edituser':
if($admin['type']=='Super Admin'){
$id=intval($_POST['id']);
$fullname=trim(htmlspecialchars($_POST['fullname']));
$username=trim(htmlspecialchars($_POST['username']));
$dept=trim(htmlspecialchars($_POST['dept']));
$design=trim(htmlspecialchars($_POST['design']));
$phone=trim(htmlspecialchars($_POST['phone']));
$email=trim(htmlspecialchars($_POST['email']));
$password=trim(htmlspecialchars($_POST['password']));
$type=trim(htmlspecialchars($_POST['type']));
$passport=trim(htmlspecialchars($_POST['passport']));
if($fullname !='' and $username!='' and $dept!='' and $design!='' and $phone!='' and $email!='' and $type!='0' and $password!='' and $passport!=''){
    if (mysql_num_rows(mysql_query("select * from users where username='$username' limit 1"))) {
   if(mysql_query("update users set fullname='$fullname',username='$username',dept='$dept',design='$design',phone='$phone',email='$email',password='$password',type='$type',passport='$passport', where id='$id'")){
    echo"<div class='success'>User was updated with success</div>";
}
}else{

    echo "<div class='error'>This use doesn't exist</div>";
}
}else{

    echo "<div class='error'>Please Fill in all the Blank </div>";
}
}
    break;
    case 'editmyinfo':
$fullname=trim(htmlspecialchars($_POST['fullname']));
$username=trim(htmlspecialchars($_POST['username']));
$dept=trim(htmlspecialchars($_POST['dept']));
$design=trim(htmlspecialchars($_POST['design']));
$phone=trim(htmlspecialchars($_POST['phone']));
$email=trim(htmlspecialchars($_POST['email']));
$password=trim(htmlspecialchars($_POST['password']));
$passport=trim(htmlspecialchars($_POST['passport']));
if($fullname !='' and $username!='' and $dept!='' and $design!='' and $phone!='' and $email!=''  and $password!='' and $passport!=''){
   if(mysql_query("update users set fullname='$fullname',username='$username',dept='$dept',design='$design',phone='$phone',email='$email',password='$password',passport='$passport' where id='$admin[id]'")){
    echo"<div class='success'>Your informations was updated with success</div>";
}
}else{

    echo "<div class='error'>Please Fill in all the Blank </div>";
}

        break;
        case 'addentry':
$caseindex=trim(htmlspecialchars($_POST['caseindex']));
$suiteno=trim(mysql_escape_string($_POST['suiteno']));
$plaintiff=trim(htmlspecialchars($_POST['plaintiff']));
$defendant=trim(htmlspecialchars($_POST['defendant']));
$title="$plaintiff VS $defendant";
$casetype=trim(htmlspecialchars($_POST['casetype']));
$sm=trim(htmlspecialchars($_POST['sm']));
$casecategory=trim(htmlspecialchars($_POST['casecategory']));
$aj=trim(htmlspecialchars($_POST['aj']));
$ac=trim(htmlspecialchars($_POST['ac']));
$cl=trim($_POST['cl']);
$status=trim(htmlspecialchars($_POST['status']));
$accusedcounsel=trim(htmlspecialchars($_POST['accusedcounsel']));
$accusedcounselphone=trim(htmlspecialchars($_POST['accusedcounselphone']));
$term=trim(htmlspecialchars($_POST['term']));
$ap=trim(htmlspecialchars($_POST['ap']));
$file=$_FILES['file']['tmp_name'];
$namefile=$_FILES['file']['name'];
$ty=explode('.',$_FILES['file']['name']);
$arrv=array('docx','pdf','png','jpg');
if($file!=''){
$newf="docs/".time().".".$ty[1];
}else{
    $newf='';
}
if($suiteno==''){
echo "<div class='error'>Please fill in the Suite No ...</div></br>";
}
elseif ($file!='' and !(in_array($ty[1], $arrv))) {
echo "<div class='error'>Invalid type of file</div><br>";
}
else{
if(mysql_query("insert into entry(title,caseindex,suiteno,plaintiff,defendant,casetype,sm,casecategory,aj,ac,cl,status,file,time,accusedcounsel,accusedcounselphone,ap,term) 
    values ('$title','$caseindex','$suiteno','$plaintiff','$defendant','$casetype','$sm','$casecategory','$aj','$ac','$cl','$status','
    ".str_replace('../', '', $newf)."','".time()."','$accusedcounsel','$accusedcounselphone','$ap','$term')")){
        if($file!=''){

move_uploaded_file($file,"$newf");
    }
        $ss=mysql_fetch_array(mysql_query("select * from entry where suiteno='$suiteno' order by id desc limit 1"));
mysql_query("insert into historyentry (entry_id,user_id,type,time) values('$ss[id]','$admin[id]','addentry','".time()."')");

    echo'1';

}
}           
break;
case 'deleteentry':
if($admin['type']=='Super Admin' or $admin['type']=='admin' or $admin['type']=='Editor'){
$id=intval($_POST['id']);
$old=mysql_fetch_array(mysql_query("select * from entry where id='$id' limit 1"));
@unlink($old['file']);
mysql_query("delete from entry where id='$id' limit 1");
}
    break;
    case 'updateentry':
$id=intval($_POST['id']);
$old=mysql_fetch_array(mysql_query("select * from entry where id='$id' limit 1"));
$caseindex=trim(htmlspecialchars($_POST['caseindex']));
$suiteno=trim(mysql_escape_string($_POST['suiteno']));
$plaintiff=trim(htmlspecialchars($_POST['plaintiff']));
$defendant=trim(htmlspecialchars($_POST['defendant']));
$title="$plaintiff VS $defendant";
$casetype=trim(htmlspecialchars($_POST['casetype']));
$sm=trim(htmlspecialchars($_POST['sm']));
$casecategory=trim(htmlspecialchars($_POST['casecategory']));
$aj=trim(htmlspecialchars($_POST['aj']));
$ac=trim(htmlspecialchars($_POST['ac']));
$cl=trim($_POST['cl']);
$status=trim(htmlspecialchars($_POST['status']));
$accusedcounsel=trim(htmlspecialchars($_POST['accusedcounsel']));
$accusedcounselphone=trim(htmlspecialchars($_POST['accusedcounselphone']));
$term=trim(htmlspecialchars($_POST['term']));
$ap=trim(htmlspecialchars($_POST['ap']));
$file=$_FILES['file']['tmp_name'];
$namefile=$_FILES['file']['name'];
$ty=explode('.',$_FILES['file']['name']);
$arrv=array('docx','pdf','png','jpg');
$newf="docs/".time().".".$ty[1];
if($suiteno ==''){
echo "<div class='error'>Please fill in all the blanks...</div></br>";
}else{
if($file !=''){
    if (!(in_array($ty[1], $arrv))) {
echo "<div class='error'>Invalid type of file</div><br>";
}else{
    @unlink($old['file']);
if(move_uploaded_file($file,$newf)){
if(mysql_query("update entry set suiteno='$suiteno',title='$title',caseindex='$caseindex',plaintiff='$plaintiff',defendant='$defendant',casetype='$casetype',
sm='$sm',casecategory='$casecategory',aj='$aj',ac='$ac',cl='$cl',status='$status',file='".str_replace('../', '', $newf)."',accusedcounsel='$accusedcounsel',accusedcounselphone='$accusedcounselphone',ap='$ap',term='$term' where id='$id'")){
    echo"<div class='success'>You have update this entry with success</div>";
mysql_query("insert into historyentry (entry_id,user_id,type,time) values('$old[id]','$admin[id]','updt','".time()."')");
     echo"<META http-equiv='refresh' content='2;URL=index.php'>";
}
}
}
}else{
if(mysql_query("update entry set suiteno='$suiteno',title='$title',caseindex='$caseindex',plaintiff='$plaintiff',defendant='$defendant',casetype='$casetype',
sm='$sm',casecategory='$casecategory',aj='$aj',ac='$ac',cl='$cl',status='$status',accusedcounsel='$accusedcounsel',accusedcounselphone='$accusedcounselphone',ap='$ap',term='$term' where id='$id'")){
    echo"<div class='success'>You have update this entry with success</div>";
mysql_query("insert into historyentry (entry_id,user_id,type,time) values('$old[id]','$admin[id]','updt','".time()."')");
     echo"<META http-equiv='refresh' content='2;URL=index.php'>";

}
}
}
        break;
        case 'editcrt':
        if($admin['type']=='Super Admin'){
$id=intval($_POST['id']);
$jd=htmlspecialchars($_POST['jd']);
$crt=htmlspecialchars($_POST['crt']);
$crtl=trim(htmlspecialchars($_POST['crtl']));
if(!mysql_num_rows(mysql_query("select * from courts where judgment='$jd' and court='$crt' and courtlocation='$crtl' limit 1")))
mysql_query("update courts set judgment='$jd',court='$crt',courtlocation='$crtl' where id='$id'");
}
            break;
            case 'dltcourt':
if($admin['type']=='Super Admin'){
    $id=intval($_POST['id']);
    mysql_query("delete  from courts where id='$id' limit 1");

}
                break;
                case 'addcrt':
$jd=trim(htmlspecialchars($_POST['jd']));
$crt=trim(htmlspecialchars($_POST['crt']));
$crtl=trim(htmlspecialchars($_POST['crtl']));

        if($admin['type']=='Super Admin'){
if($jd!='' and $crt!=''){
if (mysql_query("insert into courts (judgment,court,courtlocation)values('$jd','$crt','$crtl')")) {
echo"<div class='success'>You've add new court with success</div>";
}
}else{
    echo "<div class='error'>An error was founded</div>";

}
}
                    break;
                    case 'searchfirst':
$a=trim(htmlspecialchars($_POST['a']));
$r=mysql_query("select * from entry where status='Completed' and ( suiteno like '%$a%' or title like '%$a%' 
    or caseindex like '%$a%' or casetype like '%$a%' or sm like '%$a%' or casecategory like '%$a%' or aj like '%$a%'
    or ac like '%$a%' or cl like '%$a%' or plaintiff like '%$a%' or defendant like '%$a%' ) limit 0,25");
echo "<div style='float:right;padding:0 9px 9px 0'><a class='ahrf gobsrcf'>Go Back</a></div>";
if(mysql_num_rows($r)){
while($row=mysql_fetch_array($r)){
?>
<DIV style='margin:5px 0 11px 0;' id='entry<? echo $row['id'];?>'>
<div class='tblentry'>
<div class='entryinf'>
<div class='inentrti' style='width:125px;'>Suit No</div>
<div class='inentrti' style='width:125px'>Plaintiff</div>
<div class='inentrti' style='width:125px'>Defendant</div>
<div class='inentrti' style='width:65px'>Court</div>
<div class='inentrti' style='width:95px'>Date Submitted</div>
<div class='inentrti' style='width:45px;border:0'>doc</div>
</div>

<div class='insentryinf'>

<div class='entrm' style='width:125px;'><? echo "$row[suiteno]";?></div>
<div class='entrm' style='width:125px'><? echo "$row[plaintiff]";?></div>
<div class='entrm' style='width:125px'><? echo "$row[defendant]";?></div>
<div class='entrm' style='width:65px'><? echo str_replace('Court ', '', $row['ac']);?></div>
<div class='entrm' style='width:95px'><? echo date('d-m-Y',$row['time']) ;?></div>
<div class='entrm' style='width:45px;border:0'>
     <?
     if(trim($row['file'])!=''){
     ?>
<a href='openb.php?id=<? echo $row['id'];?>' rel='showmodule'><img src='styles/images/doc.png' style='margin-top:11px'/></a>
<?
}else{
     echo "...";
}
?>
</div>


</div>


</div>
</div>

<?
}
}else{

         echo"<div style='margin-top:15px;color:#5e5e5e;font-size:16px'><center>We can't find your search...</center></div>";

}
                    break;
case 'asgc':
$suiteno=trim(htmlspecialchars($_POST['suiteno']));
$plaintiff=trim(htmlspecialchars($_POST['plaintiff']));
$defendant=trim(htmlspecialchars($_POST['defendant']));
$ac=trim(htmlspecialchars($_POST['ac']));
$time=time();
if($suiteno ==''){
echo "<div class='error'>Please fill in the Suite No ...</div></br>";
}else{
if(mysql_query("insert into asgc (suiteno,plaintiff,defendant,ac,time) values ('$suiteno','$plaintiff','$defendant','$ac','$time')")){
echo"1";
}
}
break;

case 'dltasgc':
$id=intval($_POST['id']);
mysql_query("delete from asgc where id='$id' limit 1");
    break;
    case 'easgc':
$suiteno=trim(htmlspecialchars($_POST['suiteno']));
$plaintiff=trim(htmlspecialchars($_POST['plaintiff']));
$defendant=trim(htmlspecialchars($_POST['defendant']));
$ac=trim(htmlspecialchars($_POST['ac']));
$id=intval($_POST['id']);
if($suiteno ==''){
echo "<div class='error'>Please fill in the Suite No ...</div></br>";
}else{
if(mysql_query("update asgc set suiteno='$suiteno',plaintiff='$plaintiff',defendant='$defendant',ac='$ac' where id='$id'")){
echo "<div class='success'>You have update this assigned case with success ...</div></br>";
echo "<script>history.go(0);</script>";
}
}
        break;
}
?>
addentry.php

<?php
////
include 'configentry.php';
if($admin['type']=='Super Admin' or $admin['type']=='admin' or $admin['type']=='Editor'){
?>
<div class='boxaddentry'>
<div style='border-bottom:1px solid #eee;'><h3>Add New Entry</h3></div>
<div style='color:#5e5e5e;' class='divaddingentry'>
<div style='color:#5e5e5e'><p>All fields are required.</p></div>
  <form id='addentryfrm' method='post' action='action.php?act=addentry' enctype='multipart/form-data'>
<p >
               <label  class='labadden'>Case Index</label>
               <span ><select class='slct' name='caseindex'>
                <option value=''>Select...</option>
  <option value="APPEAL">APPEAL</option>
  <option value="COMMERCIAL LAW">COMMERCIAL LAW</option>
  <option value="CONTRACT">CONTRACT</option>
  <option value="CRIMINAL LAW">CRIMINAL LAW</option>
  <option value="ELECTION PETITION TRIBUNAL">ELECTION PETITION TRIBUNAL</option>
  <option value="ESTOPPEL">ESTOPPEL</option>
  <option value="EVIDENCE">EVIDENCE</option>
  <option value="JURISDICTION">JURISDICTION</option>
  <option value="LAND LAW">LAND LAW</option>
  <option value="LIMITATION LAW">LIMITATION LAW</option>
  <option value="MATRIMONIAL CAUSES">MATRIMONIAL CAUSES</option>
  <option value="PRACTICE &amp; PROCEEDURE">PRACTICE &amp; PROCEEDURE</option>
  <option value="TORT">TORT</option>
  <option value="WORDS &amp; PHRASES">WORDS &amp; PHRASES</option></select></span>
          </p>
           <p >
               <label  class='labadden'>Suite No</label>
               <span ><input  type="text" name="suiteno" class="inputtxt" alt="username" size="25"  style='width:225px'></span>
          </p>
          <p >
               <label  class='labadden'>Plaintiff</label>
               <span ><input type='text' class='inputtxt' name='plaintiff'/></span>

          </p>
          <p>
<label  class='labadden'>Defendant</label>
               <span ><input type='text' class='inputtxt' name='defendant'/></span>
          </p>

             <p >
               <label  class='labadden'>Case Type</label>
               <span ><select class='slct' name='casetype'>
<option value=''>Select...</option>
                <option value='Civil Matter'>Civil Matter</option>
                <option value='Criminal Matter'>Criminal Matter</option></select></span>
          </p>
             <p >
               <label  class='labadden'>Subject Matter</label>
               <span ><select class='slct' name='sm'><option value='Matrimonial Causes'>Matrimonial Causes</option></select></span>
          </p>

             <p >
               <label  class='labadden'>Case Category</label>
               <span >
<select class='slct' name='casecategory'>
<option value=''>Select ...</option>
<option value='Writ of Summons'>Writ of Summons</option>
<option value='Rulings'>Rulings</option>
<option value='Foreign Judgment'>Foreign Judgment</option>
<option value='Criminal Charges'>Criminal Charges</option>
<option value='Motions'>Motions</option>
<option value='Petition'>Petition</option>

</select>
               </span>
          </p>
           <p >
               <label  class='labadden'>Assigned Court</label>
               <span ><select class="slct chsjudg chsloc" name='ac'>
                <option value=''>Select...</option>
<?
ac();
?>  
</select>
          </p>
             <p >
               <label  class='labadden'>Assigned Judge</label>
               <span >
<select class='slct acourt' style='width:250px' name='aj'>
  <option value=''>Select ....</option>
<?
 aj();
?>
</select>
               </span>
          </p>
            <p >
               <label  class='labadden'>Court Location</label>
               <span ><select class='slct' name='cl'>
                <option value=''>Select...</option>
       <?
cl();
       ?>
</select></span>
          </p>
            <p >
               <label  class='labadden'>Status</label>
               <span > <select class='slct' name='status'>
                <option value=''>Select...</option>
                <option value='On-Going'>On-Going</option>
                <option value='Completed'>Completed</option></select> </span>
          </p>
           <p >
               <label  class='labadden'>Case Description(Pdf, Docx, Jpeg) </label>
               <span >
               <span ><input  type="file" name="file" alt="Upload Document" size="25"></span></span>
          </p>
          <center><layout><input type='submit' value='Add Entry' class='btn1'></layout>
<layout><input type='reset' value='RESET' class='btn2'></layout>
          </center>
        </form>

</div>
<div class='succdivaddentry' style='margin-top:15px;display:none;'>
<center>
<div class='success'>Your entry was added with Success ...</div><br>
<div >
<input type='submit' class='btntoch addmoreentry' value='Add More'>
<input type='submit' class='btntoch cnbtnch' onclick="window.location='index.php';" value='Cancel'>

</div>
</center>
</div>
<div class='reslentry'></div>
</div>
<?
}else{
  echo "Sorry you don't have permisson to open this page .";
}
?>
Member Avatar for diafol

The files can be seen there from the site directory list, but only the rendered page will be viewable, not the php that creates them. If you think there is something in the files (php) that we need, you'll need to post those here too.

ADDENTRY.PHP FILE

<?php
////
include 'configentry.php';
if($admin['type']=='Super Admin' or $admin['type']=='admin' or $admin['type']=='Editor'){
?>
<div class='boxaddentry'>
<div style='border-bottom:1px solid #eee;'><h3>Add New Entry</h3></div>
<div style='color:#5e5e5e;' class='divaddingentry'>
<div style='color:#5e5e5e'><p>All fields are required.</p></div>
  <form id='addentryfrm' method='post' action='action.php?act=addentry' enctype='multipart/form-data'>
<p >
               <label  class='labadden'>Case Index</label>
               <span ><select class='slct' name='caseindex'>
                <option value=''>Select...</option>
  <option value="APPEAL">APPEAL</option>
  <option value="COMMERCIAL LAW">COMMERCIAL LAW</option>
  <option value="CONTRACT">CONTRACT</option>
  <option value="CRIMINAL LAW">CRIMINAL LAW</option>
  <option value="ELECTION PETITION TRIBUNAL">ELECTION PETITION TRIBUNAL</option>
  <option value="ESTOPPEL">ESTOPPEL</option>
  <option value="EVIDENCE">EVIDENCE</option>
  <option value="JURISDICTION">JURISDICTION</option>
  <option value="LAND LAW">LAND LAW</option>
  <option value="LIMITATION LAW">LIMITATION LAW</option>
  <option value="MATRIMONIAL CAUSES">MATRIMONIAL CAUSES</option>
  <option value="PRACTICE &amp; PROCEEDURE">PRACTICE &amp; PROCEEDURE</option>
  <option value="TORT">TORT</option>
  <option value="WORDS &amp; PHRASES">WORDS &amp; PHRASES</option></select></span>
          </p>
           <p >
               <label  class='labadden'>Suite No</label>
               <span ><input  type="text" name="suiteno" class="inputtxt" alt="username" size="25"  style='width:225px'></span>
          </p>
          <p >
               <label  class='labadden'>Plaintiff</label>
               <span ><input type='text' class='inputtxt' name='plaintiff'/></span>

          </p>
          <p>
<label  class='labadden'>Defendant</label>
               <span ><input type='text' class='inputtxt' name='defendant'/></span>
          </p>

             <p >
               <label  class='labadden'>Case Type</label>
               <span ><select class='slct' name='casetype'>
<option value=''>Select...</option>
                <option value='Civil Matter'>Civil Matter</option>
                <option value='Criminal Matter'>Criminal Matter</option></select></span>
          </p>
             <p >
               <label  class='labadden'>Subject Matter</label>
               <span ><select class='slct' name='sm'><option value='Matrimonial Causes'>Matrimonial Causes</option></select></span>
          </p>

             <p >
               <label  class='labadden'>Case Category</label>
               <span >
<select class='slct' name='casecategory'>
<option value=''>Select ...</option>
<option value='Writ of Summons'>Writ of Summons</option>
<option value='Rulings'>Rulings</option>
<option value='Foreign Judgment'>Foreign Judgment</option>
<option value='Criminal Charges'>Criminal Charges</option>
<option value='Motions'>Motions</option>
<option value='Petition'>Petition</option>

</select>
               </span>
          </p>
           <p >
               <label  class='labadden'>Assigned Court</label>
               <span ><select class="slct chsjudg chsloc" name='ac'>
                <option value=''>Select...</option>
<?
ac();
?>  
</select>
          </p>
             <p >
               <label  class='labadden'>Assigned Judge</label>
               <span >
<select class='slct acourt' style='width:250px' name='aj'>
  <option value=''>Select ....</option>
<?
 aj();
?>
</select>
               </span>
          </p>
            <p >
               <label  class='labadden'>Court Location</label>
               <span ><select class='slct' name='cl'>
                <option value=''>Select...</option>
       <?
cl();
       ?>
</select></span>
          </p>
            <p >
               <label  class='labadden'>Status</label>
               <span > <select class='slct' name='status'>
                <option value=''>Select...</option>
                <option value='On-Going'>On-Going</option>
                <option value='Completed'>Completed</option></select> </span>
          </p>
           <p >
               <label  class='labadden'>Case Description(Pdf, Docx, Jpeg) </label>
               <span >
               <span ><input  type="file" name="file" alt="Upload Document" size="25"></span></span>
          </p>
          <center><layout><input type='submit' value='Add Entry' class='btn1'></layout>
<layout><input type='reset' value='RESET' class='btn2'></layout>
          </center>
        </form>

</div>
<div class='succdivaddentry' style='margin-top:15px;display:none;'>
<center>
<div class='success'>Your entry was added with Success ...</div><br>
<div >
<input type='submit' class='btntoch addmoreentry' value='Add More'>
<input type='submit' class='btntoch cnbtnch' onclick="window.location='index.php';" value='Cancel'>

</div>
</center>
</div>
<div class='reslentry'></div>
</div>
<?
}else{
  echo "Sorry you don't have permisson to open this page .";
}
?>
CONFIGENTRY.PHP FILE

<?php
////Programmed by 

function aj(){
    $a=mysql_query("select * from courts");
    while ($r=mysql_fetch_array($a)) {
            $c=trim(str_replace('Court', '', $r['court']));

echo "<option value='$r[judgment]' rel='$c'>$r[judgment]</option>";

    }
}
function ac(){
    $a=mysql_query("select * from courts");
    while ($r=mysql_fetch_array($a)) {
                    $c=trim(str_replace('Court', '', $r['court']));
echo "<option rel='$c' value='$c'>$r[court]</option>";

    }
}

function cl(){
    $a=mysql_query("select * from courts ");
    $arr=array();
    while ($r=mysql_fetch_array($a)) {
        $arr[]=$r['courtlocation'];

    }
    $ar=array_unique($arr);
    foreach ($ar as $v) {
echo "<option  value='$v'>$v</option>";
    }
}

?>
ACTION.PHP FILE

<?php
////
session_start();
include"includes/connect.php";
$admin=mysql_fetch_array(mysql_query("select * from users where username='$_SESSION[user]' limit 1"));
$act=$_GET['act'];

switch ($act) {

    case 'adduser':
if($admin['type']=='Super Admin'){
$fullname=trim(htmlspecialchars($_POST['fullname']));
$username=trim(htmlspecialchars($_POST['username']));
$dept=trim(htmlspecialchars($_POST['dept']));
$design=trim(htmlspecialchars($_POST['design']));
$phone=trim(htmlspecialchars($_POST['phone']));
$email=trim(htmlspecialchars($_POST['email']));
$password=trim(htmlspecialchars($_POST['password']));
$type=trim(htmlspecialchars($_POST['type']));
$passport=trim(htmlspecialchars($_POST['passport']));

if($fullname !='' and $username!='' and $dept!='' and $design!='' and $phone!='' and $email!='' and $type!='0' and $password!='' and $passport!=''){
    if (!mysql_num_rows(mysql_query("select * from users where username='$username' limit 1"))) {
   if(mysql_query("insert into users (fullname,username,dept,design,phone,email,password,type,passport) values ('$fullname','$username','$dept','$design','$phone','$email','$password','$type','$passport')")){
    echo"<div class='success'>User added with success</div><br>
    <div>
    <div class='goback'  onclick='history.go(0);'>Go Back</div>
    </div>";
}
}else{

    echo "<div class='error'>Please Choose another username</div>
    <div class='gobcktofrmaddusr'>Go Back</div>";
}
}else{

    echo "<div class='error'>Please Fill in all the Blank </div>
    <div class='gobcktofrmaddusr goback'>Go Back</div>";
}


}
    break;

    case 'dltuser':
$a=intval($_POST['a']);
mysql_query("delete from users where id='$a' limit 1");
    break;
case 'edituser':
if($admin['type']=='Super Admin'){
$id=intval($_POST['id']);
$fullname=trim(htmlspecialchars($_POST['fullname']));
$username=trim(htmlspecialchars($_POST['username']));
$dept=trim(htmlspecialchars($_POST['dept']));
$design=trim(htmlspecialchars($_POST['design']));
$phone=trim(htmlspecialchars($_POST['phone']));
$email=trim(htmlspecialchars($_POST['email']));
$password=trim(htmlspecialchars($_POST['password']));
$type=trim(htmlspecialchars($_POST['type']));
$passport=trim(htmlspecialchars($_POST['passport']));
if($fullname !='' and $username!='' and $dept!='' and $design!='' and $phone!='' and $email!='' and $type!='0' and $password!='' and $passport!=''){
    if (mysql_num_rows(mysql_query("select * from users where username='$username' limit 1"))) {
   if(mysql_query("update users set fullname='$fullname',username='$username',dept='$dept',design='$design',phone='$phone',email='$email',password='$password',type='$type',passport='$passport', where id='$id'")){
    echo"<div class='success'>User was updated with success</div>";
}
}else{

    echo "<div class='error'>This use doesn't exist</div>";
}
}else{

    echo "<div class='error'>Please Fill in all the Blank </div>";
}
}
    break;
    case 'editmyinfo':
$fullname=trim(htmlspecialchars($_POST['fullname']));
$username=trim(htmlspecialchars($_POST['username']));
$dept=trim(htmlspecialchars($_POST['dept']));
$design=trim(htmlspecialchars($_POST['design']));
$phone=trim(htmlspecialchars($_POST['phone']));
$email=trim(htmlspecialchars($_POST['email']));
$password=trim(htmlspecialchars($_POST['password']));
$passport=trim(htmlspecialchars($_POST['passport']));
if($fullname !='' and $username!='' and $dept!='' and $design!='' and $phone!='' and $email!=''  and $password!='' and $passport!=''){
   if(mysql_query("update users set fullname='$fullname',username='$username',dept='$dept',design='$design',phone='$phone',email='$email',password='$password',passport='$passport' where id='$admin[id]'")){
    echo"<div class='success'>Your informations was updated with success</div>";
}
}else{

    echo "<div class='error'>Please Fill in all the Blank </div>";
}

        break;
        case 'addentry':
$caseindex=trim(htmlspecialchars($_POST['caseindex']));
$suiteno=trim(mysql_escape_string($_POST['suiteno']));
$plaintiff=trim(htmlspecialchars($_POST['plaintiff']));
$defendant=trim(htmlspecialchars($_POST['defendant']));
$title="$plaintiff VS $defendant";
$casetype=trim(htmlspecialchars($_POST['casetype']));
$sm=trim(htmlspecialchars($_POST['sm']));
$casecategory=trim(htmlspecialchars($_POST['casecategory']));
$aj=trim(htmlspecialchars($_POST['aj']));
$ac=trim(htmlspecialchars($_POST['ac']));
$cl=trim($_POST['cl']);
$status=trim(htmlspecialchars($_POST['status']));
$accusedcounsel=trim(htmlspecialchars($_POST['accusedcounsel']));
$accusedcounselphone=trim(htmlspecialchars($_POST['accusedcounselphone']));
$term=trim(htmlspecialchars($_POST['term']));
$ap=trim(htmlspecialchars($_POST['ap']));
$file=$_FILES['file']['tmp_name'];
$namefile=$_FILES['file']['name'];
$ty=explode('.',$_FILES['file']['name']);
$arrv=array('docx','pdf','png','jpg');
if($file!=''){
$newf="docs/".time().".".$ty[1];
}else{
    $newf='';
}
if($suiteno==''){
echo "<div class='error'>Please fill in the Suite No ...</div></br>";
}
elseif ($file!='' and !(in_array($ty[1], $arrv))) {
echo "<div class='error'>Invalid type of file</div><br>";
}
else{
if(mysql_query("insert into entry(title,caseindex,suiteno,plaintiff,defendant,casetype,sm,casecategory,aj,ac,cl,status,file,time,accusedcounsel,accusedcounselphone,ap,term) 
    values ('$title','$caseindex','$suiteno','$plaintiff','$defendant','$casetype','$sm','$casecategory','$aj','$ac','$cl','$status','
    ".str_replace('../', '', $newf)."','".time()."','$accusedcounsel','$accusedcounselphone','$ap','$term')")){
        if($file!=''){

move_uploaded_file($file,"$newf");
    }
        $ss=mysql_fetch_array(mysql_query("select * from entry where suiteno='$suiteno' order by id desc limit 1"));
mysql_query("insert into historyentry (entry_id,user_id,type,time) values('$ss[id]','$admin[id]','addentry','".time()."')");

    echo'1';

}
}           
break;
case 'deleteentry':
if($admin['type']=='Super Admin' or $admin['type']=='admin' or $admin['type']=='Editor'){
$id=intval($_POST['id']);
$old=mysql_fetch_array(mysql_query("select * from entry where id='$id' limit 1"));
@unlink($old['file']);
mysql_query("delete from entry where id='$id' limit 1");
}
    break;
    case 'updateentry':
$id=intval($_POST['id']);
$old=mysql_fetch_array(mysql_query("select * from entry where id='$id' limit 1"));
$caseindex=trim(htmlspecialchars($_POST['caseindex']));
$suiteno=trim(mysql_escape_string($_POST['suiteno']));
$plaintiff=trim(htmlspecialchars($_POST['plaintiff']));
$defendant=trim(htmlspecialchars($_POST['defendant']));
$title="$plaintiff VS $defendant";
$casetype=trim(htmlspecialchars($_POST['casetype']));
$sm=trim(htmlspecialchars($_POST['sm']));
$casecategory=trim(htmlspecialchars($_POST['casecategory']));
$aj=trim(htmlspecialchars($_POST['aj']));
$ac=trim(htmlspecialchars($_POST['ac']));
$cl=trim($_POST['cl']);
$status=trim(htmlspecialchars($_POST['status']));
$accusedcounsel=trim(htmlspecialchars($_POST['accusedcounsel']));
$accusedcounselphone=trim(htmlspecialchars($_POST['accusedcounselphone']));
$term=trim(htmlspecialchars($_POST['term']));
$ap=trim(htmlspecialchars($_POST['ap']));
$file=$_FILES['file']['tmp_name'];
$namefile=$_FILES['file']['name'];
$ty=explode('.',$_FILES['file']['name']);
$arrv=array('docx','pdf','png','jpg');
$newf="docs/".time().".".$ty[1];
if($suiteno ==''){
echo "<div class='error'>Please fill in all the blanks...</div></br>";
}else{
if($file !=''){
    if (!(in_array($ty[1], $arrv))) {
echo "<div class='error'>Invalid type of file</div><br>";
}else{
    @unlink($old['file']);
if(move_uploaded_file($file,$newf)){
if(mysql_query("update entry set suiteno='$suiteno',title='$title',caseindex='$caseindex',plaintiff='$plaintiff',defendant='$defendant',casetype='$casetype',
sm='$sm',casecategory='$casecategory',aj='$aj',ac='$ac',cl='$cl',status='$status',file='".str_replace('../', '', $newf)."',accusedcounsel='$accusedcounsel',accusedcounselphone='$accusedcounselphone',ap='$ap',term='$term' where id='$id'")){
    echo"<div class='success'>You have update this entry with success</div>";
mysql_query("insert into historyentry (entry_id,user_id,type,time) values('$old[id]','$admin[id]','updt','".time()."')");
     echo"<META http-equiv='refresh' content='2;URL=index.php'>";
}
}
}
}else{
if(mysql_query("update entry set suiteno='$suiteno',title='$title',caseindex='$caseindex',plaintiff='$plaintiff',defendant='$defendant',casetype='$casetype',
sm='$sm',casecategory='$casecategory',aj='$aj',ac='$ac',cl='$cl',status='$status',accusedcounsel='$accusedcounsel',accusedcounselphone='$accusedcounselphone',ap='$ap',term='$term' where id='$id'")){
    echo"<div class='success'>You have update this entry with success</div>";
mysql_query("insert into historyentry (entry_id,user_id,type,time) values('$old[id]','$admin[id]','updt','".time()."')");
     echo"<META http-equiv='refresh' content='2;URL=index.php'>";

}
}
}
        break;
        case 'editcrt':
        if($admin['type']=='Super Admin'){
$id=intval($_POST['id']);
$jd=htmlspecialchars($_POST['jd']);
$crt=htmlspecialchars($_POST['crt']);
$crtl=trim(htmlspecialchars($_POST['crtl']));
if(!mysql_num_rows(mysql_query("select * from courts where judgment='$jd' and court='$crt' and courtlocation='$crtl' limit 1")))
mysql_query("update courts set judgment='$jd',court='$crt',courtlocation='$crtl' where id='$id'");
}
            break;
            case 'dltcourt':
if($admin['type']=='Super Admin'){
    $id=intval($_POST['id']);
    mysql_query("delete  from courts where id='$id' limit 1");

}
                break;
                case 'addcrt':
$jd=trim(htmlspecialchars($_POST['jd']));
$crt=trim(htmlspecialchars($_POST['crt']));
$crtl=trim(htmlspecialchars($_POST['crtl']));

        if($admin['type']=='Super Admin'){
if($jd!='' and $crt!=''){
if (mysql_query("insert into courts (judgment,court,courtlocation)values('$jd','$crt','$crtl')")) {
echo"<div class='success'>You've add new court with success</div>";
}
}else{
    echo "<div class='error'>An error was founded</div>";

}
}
                    break;
                    case 'searchfirst':
$a=trim(htmlspecialchars($_POST['a']));
$r=mysql_query("select * from entry where status='Completed' and ( suiteno like '%$a%' or title like '%$a%' 
    or caseindex like '%$a%' or casetype like '%$a%' or sm like '%$a%' or casecategory like '%$a%' or aj like '%$a%'
    or ac like '%$a%' or cl like '%$a%' or plaintiff like '%$a%' or defendant like '%$a%' ) limit 0,25");
echo "<div style='float:right;padding:0 9px 9px 0'><a class='ahrf gobsrcf'>Go Back</a></div>";
if(mysql_num_rows($r)){
while($row=mysql_fetch_array($r)){
?>
<DIV style='margin:5px 0 11px 0;' id='entry<? echo $row['id'];?>'>
<div class='tblentry'>
<div class='entryinf'>
<div class='inentrti' style='width:125px;'>Suit No</div>
<div class='inentrti' style='width:125px'>Plaintiff</div>
<div class='inentrti' style='width:125px'>Defendant</div>
<div class='inentrti' style='width:65px'>Court</div>
<div class='inentrti' style='width:95px'>Date Submitted</div>
<div class='inentrti' style='width:45px;border:0'>doc</div>
</div>

<div class='insentryinf'>

<div class='entrm' style='width:125px;'><? echo "$row[suiteno]";?></div>
<div class='entrm' style='width:125px'><? echo "$row[plaintiff]";?></div>
<div class='entrm' style='width:125px'><? echo "$row[defendant]";?></div>
<div class='entrm' style='width:65px'><? echo str_replace('Court ', '', $row['ac']);?></div>
<div class='entrm' style='width:95px'><? echo date('d-m-Y',$row['time']) ;?></div>
<div class='entrm' style='width:45px;border:0'>
     <?
     if(trim($row['file'])!=''){
     ?>
<a href='openb.php?id=<? echo $row['id'];?>' rel='showmodule'><img src='styles/images/doc.png' style='margin-top:11px'/></a>
<?
}else{
     echo "...";
}
?>
</div>


</div>


</div>
</div>

<?
}
}else{

         echo"<div style='margin-top:15px;color:#5e5e5e;font-size:16px'><center>We can't find your search...</center></div>";

}
                    break;
case 'asgc':
$suiteno=trim(htmlspecialchars($_POST['suiteno']));
$plaintiff=trim(htmlspecialchars($_POST['plaintiff']));
$defendant=trim(htmlspecialchars($_POST['defendant']));
$ac=trim(htmlspecialchars($_POST['ac']));
$time=time();
if($suiteno ==''){
echo "<div class='error'>Please fill in the Suite No ...</div></br>";
}else{
if(mysql_query("insert into asgc (suiteno,plaintiff,defendant,ac,time) values ('$suiteno','$plaintiff','$defendant','$ac','$time')")){
echo"1";
}
}
break;

case 'dltasgc':
$id=intval($_POST['id']);
mysql_query("delete from asgc where id='$id' limit 1");
    break;
    case 'easgc':
$suiteno=trim(htmlspecialchars($_POST['suiteno']));
$plaintiff=trim(htmlspecialchars($_POST['plaintiff']));
$defendant=trim(htmlspecialchars($_POST['defendant']));
$ac=trim(htmlspecialchars($_POST['ac']));
$id=intval($_POST['id']);
if($suiteno ==''){
echo "<div class='error'>Please fill in the Suite No ...</div></br>";
}else{
if(mysql_query("update asgc set suiteno='$suiteno',plaintiff='$plaintiff',defendant='$defendant',ac='$ac' where id='$id'")){
echo "<div class='success'>You have update this assigned case with success ...</div></br>";
echo "<script>history.go(0);</script>";
}
}
        break;
}
?>
CONTROLUSERS.PHP FILE

<?php
////
if($admin['type']=="Super Admin"){
?>
<div style='border-bottom:1px solid #eee;'><center><h3>Add or Edit users you'r the Super Admin</h3></center></div>
<div style='float:left;width:100%'>
<div  style='float:left;width:100%'>
<div tyle='float:left;width:100%'><div class='addnewuser'>+ Add New User</div></div>
<div  style='float:left;width:100%;margin-top:15px;' class='contentusershw'>
<div style='margin-left:3px'>
    <h3>Currently users :</h3>
<?
if(mysql_num_rows(mysql_query("select * from users where username!='$admin[username]' limit 1"))) {
$a=mysql_query("select * from users where username!='$admin[username]' order by id desc");
while ($row=mysql_fetch_array($a)) {
?>
<div id='user<? echo "$row[id]"; ?>' class='divusrshw'>
<div style='color:#1377DB;margin-bottom:5px;border-bottom:1px solid #ddd;height:30px;line-height:30px'>
<div style='float:left'><b>#<? echo "$row[fullname]"; ?></b></div>
<div style='float:right;margin-right:3px;'><a href='edituser.php?id=<? echo $row['id']; ?>' rel='showmodule'><img src="styles/images/edit.png"></a>&nbsp&nbsp 
    <a class='deleteuser ahrf' rel='<? echo "$row[id]"; ?>' ><img src="styles/images/delete.png"></a></div>
</div>
<div>
<p>Email : <? echo $row['email']; ?></p>
<p>Username : <? echo "$row[username]"; ?></p>
<p>Department : <? echo "$row[dept]"; ?></p>
<p>Designation : <? echo "$row[design]"; ?></p>
<p>Phone : <? echo "$row[phone]"; ?></p>
<p>Password : *****</p>
<p>Type : <? echo "$row[type]";?></p>
<p>Passport : <? echo "$row[passport]"; ?></p>
</div>
</div>
<?
}
}else{
echo "There is no existing user...you can add user";
}
?>
</div>
</div>
<div style='float:left;width:100%;margin-top:15px;display:none' class='adduserdiv'>
<center>
    <div class='resladdusrfrm'></div>
    <div class='addusrshww'>
    <form id='adduserfrm' method='post' action='action.php?act=adduser'>
<p><input type='text' class='adduserinput' name='fullname' placeholder='Fullname'/></p>
<p><input type='text' class='adduserinput' name='username' placeholder='Username'/></p>
<p><input type='text' class='adduserinput' name='dept' placeholder='Department'/></p>
<p><input type='text' class='adduserinput' name='design' placeholder='Designation'/></p>
<p><input type='text' class='adduserinput' name='phone' placeholder='Phone Number'/></p>
<p><input type='text' class='adduserinput' name='email' placeholder='Email'/></p>
<p><select class='sltcadduser' name='type'><option value='0'>Type...</option>
    <option value='admin'>Admin</option>
    <option value='Editor'>Editor</option>
    <option value='registrar'>Registrar</option>
    <option value='judges'>Judges</option>
    <option value='Chief Registrar'>Chief Registrar</option>
    <option value='Chief Judge'>Chief Judge</option>
    <option value='M & E'>M & E</option>
</select></p>
<p><input type='text' class='adduserinput' name='password' placeholder='Password'/></p>
<p><input type='text' class='adduserinput' name='passport' placeholder='Upload Passport'/></p>
<p class='addusrsbmt'><input type='submit' class='btn1 addusr' value='Add User'></p>

</form>
</div>
</center>
<div style='padding-left:5px;color:#5e5e5e'>
<p>1. <b>Super Admin</b>                 Create Other Users, Read, Write, Delete, Upload, Generate Report, Set Status</p>
<p>2. <b>Admin  </b>                             Read, Write, Delete, Upload, View Report, Set Status</p>
<p>3.<b> Editor   </b>                          Read, Write, Delete, Upload, View Report, Set Status</p>
<p>4.<b> Registrar   </b>                  Read, View Report, Generate Report</p>
<p>5.<b> Judges      </b>              Read, View Report, Set Status</p>
<p>6. <b>Chief Registrar </b>    Read, View Report, Generate Report</p>
<p>7. <b>Chief Judge   </b>   Read, View Report, Comment</p>
<p>7. <b>M & E   </b>   add and see only entry with case category : Criminal case</p>

</div>
</div>
</div>
</div>
<?
}else{
    echo "You don't have permission to control user , you've to be a Super Admin";
}
?>
EDITENTRY.PHP FILE

<?php
////
session_start();
include 'includes/connect.php';
include 'configentry.php';
$admin=mysql_fetch_array(mysql_query("select * from users where username='$_SESSION[user]' limit 1"));
$id=$_GET['id'];
$data=mysql_fetch_array(mysql_query("select * from entry where id='$id' limit 1"));
?>

<script type="text/javascript">
$(function(){
  var aj="<? echo $data['aj'];?>",ac="<? echo $data['ac'];?>",cl="<? echo $data['cl'];?>",cc="<? echo $data['casecategory'];?>";
  if(jQuery.trim(aj)!=''){
$("option[value='"+aj+"']").prop('selected', true);
  }
    if(jQuery.trim(ac)!=''){
$("option[value='"+ac+"']").prop('selected', true);
  }
    if(jQuery.trim(cl)!=''){
$("option[value='"+cl+"']").prop('selected', true);
  }  
  if(jQuery.trim(cc)!=''){
$("option[value='"+cc+"']").prop('selected', true);
  }

});
</script>
<div style='width:600px'>
<div class='headerboxblank' style='padding-left:9px;'><h3>Edit Entry : <? echo $data['suiteno'];?></h3></div>
<div style='color:#5e5e5e;padding-left:5px;' class='divaddingentry'>
<div style='color:#5e5e5e'><p>All fields are required.</p></div>
  <form id='addentryfrm' method='post' action='action.php?act=updateentry' enctype='multipart/form-data'>
    <input type='hidden' value='<? echo $id;?>' name='id'>
<p >
               <label  class='labadden'>Case Index</label>
               <span ><select class='slct' name='caseindex'>
                <option value=''>Select...</option>
  <option value="APPEAL" <? if($data['caseindex']=='APPEAL'){echo "selected";} ?>>APPEAL</option>
  <option value="COMMERCIAL LAW" <? if($data['caseindex']=='COMMERCIAL LAW'){echo "selected";} ?>>COMMERCIAL LAW</option>
  <option value="CONTRACT" <? if($data['caseindex']=='CONTRACT'){echo "selected";} ?>>CONTRACT</option>
  <option value="CRIMINAL LAW" <? if($data['caseindex']=='CRIMINAL LAW'){echo "selected";} ?>>CRIMINAL LAW</option>
  <option value="ELECTION PETITION TRIBUNAL" <? if($data['caseindex']=='ELECTION PETITION TRIBUNAL'){echo "selected";} ?>>ELECTION PETITION TRIBUNAL</option>
  <option value="ESTOPPEL" <? if($data['caseindex']=='ESTOPPEL'){echo "selected";} ?>>ESTOPPEL</option>
  <option value="EVIDENCE" <? if($data['caseindex']=='EVIDENCE'){echo "selected";} ?>>EVIDENCE</option>
  <option value="JURISDICTION" <? if($data['caseindex']=='JURISDICTION'){echo "selected";} ?>>JURISDICTION</option>
  <option value="LAND LAW" <? if($data['caseindex']=='LAND LAW'){echo "selected";} ?>>LAND LAW</option>
  <option value="LIMITATION LAW" <? if($data['caseindex']=='LIMITATION LAW'){echo "selected";} ?>>LIMITATION LAW</option>
  <option value="MATRIMONIAL CAUSES" <? if($data['caseindex']=='MATRIMONIAL CAUSES'){echo "selected";} ?>>MATRIMONIAL CAUSES</option>
  <option value="PRACTICE &amp; PROCEEDURE" <? if($data['caseindex']=='PRACTICE &amp; PROCEEDURE'){echo "selected";} ?>>PRACTICE &amp; PROCEEDURE</option>
  <option value="TORT" <? if($data['caseindex']=='TORT'){echo "selected";} ?>>TORT</option>
  <option value="WORDS &amp; PHRASES" <? if($data['caseindex']=='WORDS &amp; PHRASES'){echo "selected";} ?>>WORDS &amp; PHRASES</option></select></span>
          </p>
             <p >
               <label  class='labadden'>Suite No</label>
               <span ><input  type="text" name="suiteno" class="inputtxt" alt="username" value='<? echo "$data[suiteno]"; ?>' size="25"  style='width:225px'></span>
          </p>
          <p >
               <label  class='labadden'>Plaintiff</label>
               <span ><input type='text' class='inputtxt' value='<? echo $data['plaintiff']; ?>' name='plaintiff'/></span>

          </p>
          <p>
<label  class='labadden'>Defendant</label>
               <span ><input type='text' class='inputtxt' name='defendant' value='<? echo $data['defendant']; ?>'/></span>
          </p>

             <p >
               <label  class='labadden'>Case Type</label>
               <span ><select class='slct' name='casetype'>
<option value=''>Select...</option>
                <option value='Civil Matter' <? if($data['casetype']=='Civil Matter'){echo "selected";} ?> >Civil Matter</option>
                <option value='Criminal Matter' <? if($data['casetype']=='Criminal Matter'){echo "selected";} ?>>Criminal Matter</option></select></span>
          </p>
             <p >
               <label  class='labadden'>Subject Matter</label>
               <span ><select class='slct' name='sm'>
                <option value='Matrimonial Causes'>Matrimonial Causes</option></select></span>
          </p>

             <p >
               <label  class='labadden'>Case Category </label>
               <span >
<select class='slct' name='casecategory'>
<option value=''>Select ...</option>
<option value='Writ of Summons' <? if($data['casecategory']=='Writ of Summons'){echo "selected";} ?> >Writ of Summons</option>
<option value='Foreign Judgment' <? if($data['casecategory']=='Foreign Judgment'){echo "selected";} ?>>Foreign Judgment</option>
<option value='Criminal Charges' <? if($data['casecategory']=='Criminal Charges'){echo "selected";} ?>>Criminal Charges</option>
<option value='Rulings' <? if($data['casecategory']=='Rulings'){echo "selected";} ?>>Rulings</option>
<option value='Petition' <? if($data['casecategory']=='Petition'){echo "selected";} ?>>Petition</option>
<option value='Petition' <? if($data['casecategory']=='Motions'){echo "selected";} ?>>Motions</option>


</select>
               </span>
          </p>
                  <p >
               <label  class='labadden'>Assigned Court</label>
               <span ><select class="slct chsjudg" name='ac'>
                <option value=''>Select...</option>
<? ac();?>  
</select>
          </p>
             <p >
               <label  class='labadden'>Assigned Judge</label>
               <span >
<select class='slct acourt' style='width:250px' name='aj'>
  <option value=''>Select ....</option>
<?
aj();
?>
</select>
               </span>
          </p>


            <p >
               <label  class='labadden'>Court Location</label>
               <span ><select class='slct' name='cl'>
                <option value=''>Select...</option>
<? cl(); ?>
</select></span>
          </p>
          <? 
if($data['casecategory']=='Criminal Charges' and ($admin['type']=='Super Admin' or $admin['type']=='admin' or $admin['type']=="M &amp; E")){
?>
<p >
               <label  class='labadden'>Accused Counsel</label>
               <span ><input  type="text" name="accusedcounsel" value='<? echo $data['accusedcounsel'];?>' class="inputtxt" alt="username" size="25"  style='width:225px'></span>
          </p>
           <p >
               <label  class='labadden'>Accused Counsel Phone</label>
               <span ><input  type="text" name="accusedcounselphone" value='<? echo $data['accusedcounselphone'];?>' class="inputtxt" alt="username" size="25"  style='width:225px'></span>
          </p>
           <p >
               <label  class='labadden'>Assigned Prison</label>
               <span >
<select class='slct' name='ap'>
                <option value=''>Select...</option>
  <option value='Kuje' <? if($data['ap']=='Kuje'){echo "selected";} ?> >Kuje</option><option <? if($data['ap']=='Zuba'){echo "selected";} ?> value='Zuba'>Zuba</option></select>
               </span>
          </p>
             <p >
               <label  class='labadden'>Term</label>
               <span ><input  type="text" name="term" value='<? echo $data['term'];?>' class="inputtxt" alt="username" size="25"  style='width:225px'></span>
          </p>
<?
}
          ?>
            <p >
               <label  class='labadden'>Status</label>
               <span > <select class='slct' name='status'>
                <option value=''>Select...</option>
                <option value='On-Going' <? if($data['status']=='On-Going'){echo "selected";} ?>>On-Going</option>
                <option value='Completed' <? if($data['status']=='Completed'){echo "selected";} ?>>Completed</option>
                <option value='Awaiting Trial' <? if($data['status']=='Awaiting Trial'){echo "selected";} ?>>Awaiting Trial</option>
                <option value='Convicted' <? if($data['status']=='Convicted'){echo "selected";} ?>>Convicted</option>
              </select> </span>

          </p>
           <p >
               <label  class='labadden'>Case Description(Pdf, Docx, Jpeg) </label>
               <span >
               <span style='color:#11A8DB;cursor:pointer;' class='editcurfile'>Edit the current file </span>
          </p>
          <center><layout><input type='submit' value='Update Entry' class='btn1'></layout>
          </center>
        </form>

</div>
<div class='succdivaddentry' style='margin-top:15px;display:none;'>
<center>
<div class='success'>Your entry was added with Success ...</div><br>
<div >
<input type='submit' class='btntoch addmoreentry' value='Add More'>
<input type='submit' class='btntoch cnbtnch' onclick="window.location='index.php';" value='Cancel'>

</div>
</center>
</div>
<div class='reslentry'></div>
</div>
EDITPROFILE.PHP FILE

<?php
////
session_start();
include 'includes/connect.php';
$u=mysql_fetch_array(mysql_query("select * from users where username='$_SESSION[user]' limit 1"));
?>
<div >
<div style='border-bottom:1px solid #eee'><center><h3>Edit Your informations</h3></center></div>
<div>
<div>
    <center>
        <div class='resledtusr'></div>
    <form id='edtusr' method='post' action='action.php?act=editmyinfo'>
<p><input type='text' class='adduserinput' name='fullname' value='<? echo $u['fullname']; ?>' placeholder='Fullname'/></p>
<p><input type='text' class='adduserinput' name='username' value='<? echo $u['username']; ?>' placeholder='Username'/></p>
<p><input type='text' class='adduserinput' name='dept' value='<? echo $u['dept']; ?>' placeholder='Department'/></p>
<p><input type='text' class='adduserinput' name='design' value='<? echo $u['design']; ?>' placeholder='Designation'/></p>
<p><input type='text' class='adduserinput' name='phone' value='<? echo $u['phone']; ?>' placeholder='Phone Number'/></p>
<p><input type='text' class='adduserinput' name='email' value='<? echo $u['email']; ?>' placeholder='Email'/></p>
<p><input type='text' class='adduserinput' value='<? echo $u['password']; ?>' name='password' placeholder='Password'/></p>
<p><input type='text' class='adduserinput' name='passport' value='<? echo $u['passport']; ?>' placeholder='Passport'/></p>
<p class='addusrsbmt'><input type='submit' class='btn1 addusr' value='Edit My infos'></p>
</form>
</center>
</div>
</div>
</div>
EDITUSER.PHP FILE

<?php
////Programmed by 
include 'includes/connect.php';
$id=intval($_GET['id']);
$u=mysql_fetch_array(mysql_query("select * from users where id='$id' limit 1"));
?>
<div >
<div style='border-bottom:1px solid #eee'><center><h3>Edit User</h3></center></div>
<div>
<div>
    <center>
        <div class='resledtusr'></div>
    <form id='edtusr' method='post' action='action.php?act=edituser'>
        <input type='hidden' value='<? echo "$id";?>' name='id'>
<p><input type='text' class='adduserinput' name='fullname' value='<? echo $u['fullname']; ?>' placeholder='Fullname'/></p>
<p><input type='text' class='adduserinput' name='username' value='<? echo $u['username']; ?>' placeholder='Username'/></p>
<p><input type='text' class='adduserinput' name='dept' value='<? echo $u['dept']; ?>' placeholder='Department'/></p>
<p><input type='text' class='adduserinput' name='design' value='<? echo $u['design']; ?>' placeholder='Designation'/></p>
<p><input type='text' class='adduserinput' name='phone' value='<? echo $u['phone']; ?>' placeholder='Phone Number'/></p>
<p><input type='text' class='adduserinput' name='email' value='<? echo $u['email']; ?>' placeholder='Email'/></p>
<p><select class='sltcadduser' name='type'><option value='0'>Type...</option>
    <option value='admin' <?if($u['type']=='admin'){echo "selected";}?> >Admin</option>
    <option value='Editor' <?if($u['type']=='Editor'){echo "selected";}?> >Editor</option>
    <option value='registrar' <?if($u['type']=='registrar'){echo "selected";}?> >Registrar</option>
    <option value='judges' <?if($u['type']=='judges'){echo "selected";}?> >Judges</option>
    <option value='Chief Registrar' <?if($u['type']=='Chief Registrar'){echo "selected";}?> >Chief Registrar</option>
    <option value='Chief Judge' <?if($u['type']=='Chief Judge'){echo "selected";}?> >Chief Judge</option>
</select></p>
<p><input type='text' class='adduserinput' value='<? echo $u['password']; ?>' name='password' placeholder='Password'/></p>
<p><input type='file' class='adduserinput' name='passport' value='<? echo $u['passport']; ?>' placeholder='Passport'/></p>
<p class='addusrsbmt'><input type='submit' class='btn1 addusr' value='Update User'></p>
</form>
</center>
</div>
</div>
</div>
SQL FILE

-- Database: `casem`
--

-- --------------------------------------------------------

--
-- Table structure for table `asgc`
--

CREATE TABLE IF NOT EXISTS `asgc` (
  `id` int(10) NOT NULL auto_increment,
  `suiteno` varchar(175) NOT NULL,
  `plaintiff` varchar(75) NOT NULL,
  `defendant` varchar(75) NOT NULL,
  `ac` varchar(15) NOT NULL,
  `time` int(12) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `asgc`
--

INSERT INTO `asgc` (`id`, `suiteno`, `plaintiff`, `defendant`, `ac`, `time`) VALUES
(2, 'azazaz', 'vv', 'syrhgd', '2', 1384639224),
(3, 'malzmlak', 'mlkml', 'jzuazhj', '20', 1384642121),
(4, 'mk', '', '', '4', 1386256755),
(5, 'kkkk', '', '', '2', 1386256769),
(6, 'kkkkkkkk', '', '', '5', 1386256775);

-- --------------------------------------------------------

--
-- Table structure for table `courts`
--

CREATE TABLE IF NOT EXISTS `courts` (
  `id` int(4) NOT NULL auto_increment,
  `judgment` varchar(65) NOT NULL,
  `court` varchar(25) NOT NULL,
  `courtlocation` varchar(25) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=45 ;

--
-- Dumping data for table `courts`
--

INSERT INTO `courts` (`id`, `judgment`, `court`, `courtlocation`) VALUES
(1, 'Buka', 'Court 1', 'Ab Division'),
(2, 'Bello', 'Court 2', 'Ak Division'),
(3, 'Oniyan', 'Court 3', 'Ben Division'),
(4, 'Garba', 'Court 4', 'Ben Division'),
(5, 'Aladeto', 'Court 5', 'Ben Division'),
(6, 'Baba', 'Court 6', 'Ben Division'),
(7, 'Inyang', 'Court 7', 'Ben Division'),
(8, 'Kofo', 'Court 8', 'Ben Division'),
(9, 'Dodo', 'Court 9', 'Jos Division'),
(10, 'Balami ', 'Court 10', 'Jos Division'),
(11, 'Uma', 'Court 11', 'Jos Division'),
(12, 'Talba', 'Court 12', 'Jos Division'),
(13, 'Ogakwu', 'Court 13', 'Jos Division'),
(14, 'Banjok', 'Court 14', 'Yola Division'),
(15, 'Oriji', 'Court 15', 'Ab Division'),
(16, 'Anenih', 'Court 16', 'Ak Division'),
(17, 'Ojo', 'Court 17', 'Ben Division'),
(18, 'Keke', 'Court 18', 'Cal Division'),
(19, 'Tuku', 'Court 19', 'Enu Division'),
(20, 'Okek', 'Court 20', 'Ek Division'),
(21, 'Nasir ', 'Court 21', 'Kad Division'),
(22, 'Agba', 'Court 22', 'Kad Division'),
(23, 'Musa', 'Court 23', 'Sok Division'),
(24, 'Sench', 'Court 24', 'Cal Division'),
(25, 'Adeni', 'Court 25', 'Ilr Division'),
(26, 'Oji', 'Court 26', 'Iba Division'),
(27, 'Belg', 'Court 27', 'Jos Division'),
(28, 'Kuti', 'Court 28', 'Yol Division'),
(29, 'Affe', 'Court 29', 'Lag Division'),
(30, 'Vend', 'Court 30 ', 'Sok Division'),
(31, 'Kolo', 'Court 31', 'Iba Division'),
(32, 'Otaluk', 'Court 32', 'Ab Division'),
(33, 'Mohamme', 'Court 33', 'Jos Division'),
(34, 'Ashi', 'Court 34', 'Ilr Division'),
(35, 'Adepoj', 'Court 35', 'Yol Division'),
(36, 'Musal', 'Court 36', 'Iba Division'),
(43, 'Hali', 'Court 37', 'Lag Division');

-- --------------------------------------------------------

--
-- Table structure for table `entry`
--

CREATE TABLE IF NOT EXISTS `entry` (
  `id` int(10) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL,
  `caseindex` varchar(25) NOT NULL,
  `suiteno` varchar(175) NOT NULL,
  `casetype` varchar(25) NOT NULL,
  `sm` varchar(25) NOT NULL,
  `casecategory` varchar(25) NOT NULL,
  `aj` varchar(65) NOT NULL,
  `ac` varchar(25) NOT NULL,
  `cl` varchar(25) NOT NULL,
  `status` varchar(25) NOT NULL,
  `file` varchar(25) NOT NULL,
  `time` int(12) NOT NULL,
  `plaintiff` varchar(255) NOT NULL,
  `defendant` varchar(255) NOT NULL,
  `accusedcounsel` varchar(25) NOT NULL,
  `accusedcounselphone` varchar(15) NOT NULL,
  `ap` varchar(25) NOT NULL,
  `term` varchar(25) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=34 ;

--
-- Dumping data for table `entry`
--

INSERT INTO `entry` (`id`, `title`, `caseindex`, `suiteno`, `casetype`, `sm`, `casecategory`, `aj`, `ac`, `cl`, `status`, `file`, `time`, `plaintiff`, `defendant`, `accusedcounsel`, `accusedcounselphone`, `ap`, `term`) VALUES
(29, 'ksosk VS mlksmlk', '', 'sqlksj', '', 'Matrimonial Causes', 'Criminal Charges', 'Buka', '1', '', 'Awaiting Trial', '\r\n   docs/1384725873.png', 1384725873, 'ksosk', 'mlksmlk', '', '', '', ''),
(22, 'mlkmlk VS mlk', 'APPEAL', 'qmlmlkmlkq', '', 'Matrimonial Causes', '', 'Buka', '1', 'Ek Division', 'On-Going', 'docs/1384471533.pdf', 1384466245, 'mlkmlk', 'mlk', '', '', '', ''),
(23, 'azaz VS aaqw', 'ESTOPPEL', 'azeaze', 'Civil Matter', 'Matrimonial Causes', 'Writ of Summons', 'Buka', '1', 'Ab Division', 'On-Going', 'docs/1384471405.docx', 1384466258, 'azaz', 'aaqw', '', '', '', ''),
(24, 'mklmlk VS mlkm', '', 'ssmlkmlk', '', 'Matrimonial Causes', '', 'Bello', '2', '', '', 'docs/1384470694.jpg', 1384466269, 'mklmlk', 'mlkm', '', '', '', ''),
(33, 'cccc VS bbbb', 'CONTRACT', 'mlmlk', '', 'Matrimonial Causes', 'Writ of Summons', 'Orij', '15', 'Cal Division', 'Completed', 'docs/1386238211.pdf', 1384733931, 'cccc', 'bbbb', '', '', '', '');

-- --------------------------------------------------------

--
-- Table structure for table `historyentry`
--

CREATE TABLE IF NOT EXISTS `historyentry` (
  `id` int(10) NOT NULL auto_increment,
  `entry_id` int(10) NOT NULL,
  `user_id` smallint(4) NOT NULL,
  `type` varchar(15) NOT NULL,
  `time` int(12) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `historyentry`
--

INSERT INTO `historyentry` (`id`, `entry_id`, `user_id`, `type`, `time`) VALUES
(4, 33, 6, 'updt', 1386237832),
(5, 33, 1, 'updt', 1386238211),
(6, 33, 1, 'updt', 1386248134);

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `id` smallint(4) NOT NULL auto_increment,
  `username` varchar(75) NOT NULL,
  `password` varchar(300) NOT NULL,
  `fullname` varchar(25) NOT NULL,
  `type` varchar(17) NOT NULL,
  `email` varchar(255) NOT NULL,
  `dept` varchar(25) NOT NULL,
  `design` varchar(25) NOT NULL,
  `phone` varchar(25) NOT NULL,
  `passport` varchar(25) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `password`, `fullname`, `type`, `email`, `dept`, `design`, `phone`, `passport`) VALUES
(1, 'admin', '123456', 'Hassan', 'Super Admin', 'admin@mail.com', 'Computer', 'Director', '07060450259', 'r'),
(6, 'osas', '123456', 'James', 'Editor', 'info@compitsols.com', 'Process Unit', 'Litigation Officer', '07060450259', 'a'),
(7, 'dddd', 'ddd', 'ddd', 'Editor', 'dd', 'd', 'dd', 'ddd', 'dd'),
(8, 'kqkk', 'eieiei', 'kkekeke', 'registrar', 'kkekek', 'kkk', 'kkke', 'kkeke', 'djd');

what exact problem u are facing and in which page, I mean do u receive any error, or what abnormal things is happing or what is not happening, Please tell preciely

I primarily need two extra fields to be selected after one is selected.

i.e Assign Court: 1
    Assigned Judge: Buka
    Court Location: Ab Division

    </select>
               </span>
          </p>
           <p >
               <label  class='labadden'>Assigned Court</label>
               <span ><select class="slct chsjudg chsloc" name='ac'>
                <option value=''>Select...</option>
<?
ac();
?>  
</select>
          </p>
             <p >
               <label  class='labadden'>Assigned Judge</label>
               <span >
<select class='slct acourt' style='width:250px' name='aj'>
  <option value=''>Select ....</option>
<?
 aj();
?>
</select>
               </span>
          </p>
            <p >
               <label  class='labadden'>Court Location</label>
               <span ><select class='slct' name='cl'>
                <option value=''>Select...</option>
       <?
cl();
       ?>
</select></span>

I guess courl location is column in court master , if you are storing court id, then you need not to save court location.
You can always display using sql joins, Dont not save again it in tranaction table.

urtrivedi, I am a newbie on here. Please can you send me a private message so that I can expose you to the live codes that is hosted. Please

you may use chat room on this site to discuss

I am a newly registered user and currently there is restriction

You need 5 posts with 5 days of membership or 15 reputation points in order to unlock full website functionality.

You can do me a private message

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.