
<?php include('sidebar.php'); ?>

<?php include('head.html'); ?>

  <?php
    function do_alert($msg) 
    {
        echo '<script type="text/javascript">alert("' . $msg . '") 
           parent.location="ciss.php";

</script>';
       
    }
?>
<?php
$tyr=$_SESSION['num'];

//make the database connection
include('configg.php');
$sql = "select * from access where userid = '$tyr' ";
 $data = mysqli_query($conn,$sql);

$rows = mysqli_num_rows($data);

if($rows <= 0){
   do_alert("user does not exist contact system admin");
}
else{

while($row= mysqli_fetch_array($data))
{

$serial=  $row['name'];
 $input= $row['userid'];
$class=  $row['class'];
 $arm= $row['arm'];
 
 
 
 $classs=  strtoupper($class);
 $armm= strtoupper($arm);
 
$clay="$class$arm";
$clay=strtolower($clay);
$claff="masterclass";
 
$dfrd="subjects";
$sdc="$clay$dfrd";
$_SESSION['name']=$serial;

$_SESSION['num']=$input;
$_SESSION['clay']=$clay;
 
$_SESSION['sdz']=$sdc;

}

}
  
$sct="TERM EXAMINATION";
$aas="$class$arm";
$asut="subjects";

$_SESSION['ccllaa']="$aas$asut";



$aass=strtolower($aas);







?>

  
  
  
  <?php
$stu=$_POST['regno'];
$picc=$_POST['ccom'];
$tyr=$_SESSION['num'];
$_SESSION['numi']=$stu;


//make the database connection
include('config.php');
 

$_SESSION['class']=$clay;
$_SESSION['sub']=$stu;
 

$sql = "update `beva1pics` set status='$picc'  where regno= '$stu'";
$data = $conn->query($sql); 

 

?>
  
  
<script>
	function showEdit(editableObj) {
		$(editableObj).css("background","#FF0");
	} 
	
	function saveToDatabase(editableObj,column,id) {
		$(editableObj).css("background","#009933 url(loaderIcon.gif) no-repeat right");
		$.ajax({
			url: "saveedit.php",
			type: "POST",
			data:'column='+column+'&editval='+editableObj.innerHTML+'&id='+id,
			success: function(data){
				$(editableObj).css("background","#DDD");
			}        
	   });
	}
	</script>
  

  
  
  
  
<a class="navbar-brand" href="#pablo">LEOTRIX</a>
			<img class="avatar border-gray" src="logo.jpg" width="30%">
<?php include('head2.php'); ?>


<div class="panel-header panel-header-sm">
      </div>
	  
	  </br> </br></br> </br></br> </br>
      <div class="content">
        <div class="row">
		 <div class="col-md-2">
		 </div>
		 </br> </br>
          <div class="col-md-8">
            <div class="card">
			
              <div class="card-header">
                <h5 class="title">View Student Passport</h5>
              </div>
			  
              <div class="card-body">
			   <form class="form-horizontal"  action="picasoo.php" method="POST" role="form">
                       
                      
                      <div class="form-group">
                        <label  >Class</label>
                        
                        
						   
						  <?php
$sql = "select * from `beva1` where password='$aass' ";
 $query = mysqli_query($conn,$sql);
echo '<select name="subjects" class="form-control">'; // Open your drop down box

// Loop through the query results, outputing the options one by one
while ($row = mysqli_fetch_array($query)) {
   echo '<option value="'.$row['regno'].'">'.$row['name'].'</option>';
}

echo '</select>';// 

?>
                        </div>
                        
                             <div class="form-group">
                        <label  >ARM</label>
                        
                        
						   
						  <?php
$sql = "select * from `beva1` where password='$aass' ";
 $query = mysqli_query($conn,$sql);
echo '<select name="subjects" class="form-control">'; // Open your drop down box

// Loop through the query results, outputing the options one by one
while ($row = mysqli_fetch_array($query)) {
   echo '<option value="'.$row['regno'].'">'.$row['name'].'</option>';
}

echo '</select>';// 

?>
                        </div>
                   
					   
                    
                      <div class="form-group form-actions">
                        <div class="col-sm-4"> </div>
                        <div class="col-sm-8">
                         
                <button type="submit" class="btn btn-primary button" name="deposit">Search</button>
                        </div>
                      </div>
                    </form>
                
				 
              </div>
			
            </div>
			 
				 <div class="col-md-2">
		 </div>
          </div>
	 
		  
		  <div class="col-md-12">
		    <div class="card">
              <div class="card-header">
                   <form class="form-horizontal"  action="picasooo.php" method="POST" role="form">
                
                <h4 class="card-title"> Student Name:<b>   <?php echo $name; ?> </b> </h4>
                
                <input class="form control" type="hidden"  value=" <?php echo $stu; ?>"  name="regno" />
               <h4 class="card-title"> Class:<?php echo $classs; ?> <?php echo $armm; ?></h4>
			  <h4 class="card-title"> Passport: &nbsp; &nbsp; &nbsp; <img src="pics/<?php echo $stu; ?>.JPG" /></h4>
			  
			            <h4 class="card-title"> Comment:<b> <textarea rows="3" cols="19" class="form control"  name="ccom"></textarea>
			            
			             </b> </h4>
			             
			             
                <button type="submit" class="btn btn-primary button" name="deposit">Submit</button>
			  </div>
			  
			  </form>
			  </br> </br>
              <div class="card-body">
                <div class="table-responsive">
				
				
				 <?php
$ss="subjects";

$cad ="$class$arm";
$clad =strtolower($cad);
 
//make the database connection
include('configg.php');
 $sql = "select  regno,name,password,arm,status  from 
  `beva1pics` order by `arm` ";
 $data = mysqli_query($conn,$sql);



$rows4 = mysqli_num_rows($data);


$sno = 1;
                                            $table = "";
                                            while( $row = mysqli_fetch_array($data) ){
                                                /* $qres = "SELECT name FROM lga WHERE id='".$row['lga_res']."'";
                                                $qorg = "SELECT name FROM lga WHERE id='".$row['lga_org']."'";
                                                $resul = $conn->query($qres);
                                                $r = $resul->fetch_array();
                                                $lgares = $r['name'];
                                                $resul = $conn->query($qorg);
                                                $r = $resul->fetch_array();
                                                $lgaorg = $r['name']; */
								 
                                                
                                                $table.="<tr><td>".$sno."</td>
                
              
                <td>".$row['name']."</td>
                   <td  ><img src=pics/$row[regno].JPG  width=100px></br>
					 </td>
					   <td  >".$row['status']."</td>
                <td>".$row['password']."</td>
 
			 
					 
                </tr>";
                                                $sno++;

                                            }

  

print "<center>";


    
    
      
print "<table id=datatable class='table table-striped'>";

print "<thead >\n";
				print "<tr>\n";

print "
	
		<th width=20><B>ID</B>
 </th>
				<th width=50><div ><B>NAME</B>
 </div></th>
		
				
	<th width=50><div ><B>PICS</B>
 </div></th>
 	<th width=50><div ><B>COMMENT</B>
 </div></th>
				<th width=50><div ><B>CLASS</B>
 </div></th>
			 
		 
	
		


\n";			
				
					
				print "</tr>\n";
			print "</thead>\n";
			print "<tbody >\n";
//get field names

echo $table;
print "</table>\n";

print "</center>\n";








?>
				
					 

            </div>  
          </div>
        </div>
        </div>
        </div>
      </div>
                  

<?php include('footer.html'); ?>