<?php session_start() ?>

<!DOCTYPE html>

<!--[if IE 8]>			<html class="ie ie8"> <![endif]-->

<!--[if IE 9]>			<html class="ie ie9"> <![endif]-->

<!--[if gt IE 9]><!-->	<html><!--<![endif]-->



<!-- Specific Page Data -->



<!-- End of Data -->



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

  

  

  

  <?php

    function do_alerte($msg) 

    {

        echo '<script type="text/javascript">alert("' . $msg . '") 

           parent.location="dashboard.php";



</script>';

       

    }

?>



  <?php

    function do_alert($msg) 

    {

        echo '<script type="text/javascript">alert("' . $msg . '") 

           parent.location="portal.html";



</script>';

       

    }

?>

<?php

$tyr=$_SESSION['num'];



//make the database connection

include('config.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'];

 

  $pass= $row['password'];

 $email= $row['date'];

$clay="$class$arm";

$dfrd="subjects";

$sdc="$clay$dfrd";

$_SESSION['name']=$serial;



$_SESSION['num']=$input;

$_SESSION['clay']=$clay;

$_SESSION['email']=$email;

$_SESSION['sdz']=$sdc;



}



}



$ubjects="subjects";

$sdc="$clay$ubjects";





$_SESSION['subb']=$sdc;

$sql = "select subjects,class,type

 from `subjects` where staffid='$tyr' ";

 $data = mysqli_query($conn,$sql);







$rows4 = mysqli_num_rows($data);



$lcclass=strtolower($clay);

$_SESSION['lclay']=$lcclass;



$sql = "select regno,name from `beva1` where password='$lcclass' ";

 $data55 = mysqli_query($conn,$sql);







$rows44 = mysqli_num_rows($data55);



// Above will output ---- > testValue 











$sql = "SELECT MAX(serialno) AS maxid FROM subjects ";

          

          $data = mysqli_query($conn,$sql);

    $result = mysqli_fetch_assoc($data);



          





$pe=  $result['maxid'];





$se= $pe + 1;



$eer=$_SESSION['num'];



$opassd=$_POST['opassd'];

$passd=$_POST['passd'];



if ($pass !=$opassd){

	

	do_alert("YOUR PASSWORD IS NOT IDENTICAL");

}else{

	

	$sql = "UPDATE access set password='$passd' where userid='$tyr'";



 $data = mysqli_query($conn,$sql);

 

 

 do_alerte("YOUR PASSWORD HAS BEEN CHANGED");

	

}









?>



  

  

  

  

  

  

  

  

  

  

  

  

  

  

<div class="content">

  <div class="container">

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

    <!-- Middle Content Start -->

    

	

	

	

	

	

	

    <div class="vd_content-wrapper">

      <div class="vd_container">

        <div class="vd_content clearfix">

          <div class="vd_head-section clearfix">

            <div class="vd_panel-header">

              <ul class="breadcrumb">

                <li><a href="index.html">Home</a> </li>

                <li class="active">Administration</li>

              </ul>

              <div class="vd_panel-menu hidden-sm hidden-xs" data-intro="<strong>Expand Control</strong><br/>To expand content page horizontally, vertically, or Both. If you just need one button just simply remove the other button code." data-step=5  data-position="left">

    <div data-action="remove-navbar" data-original-title="Remove Navigation Bar Toggle" data-toggle="tooltip" data-placement="bottom" class="remove-navbar-button menu"> <i class="fa fa-arrows-h"></i> </div>

      <div data-action="remove-header" data-original-title="Remove Top Menu Toggle" data-toggle="tooltip" data-placement="bottom" class="remove-header-button menu"> <i class="fa fa-arrows-v"></i> </div>

      <div data-action="fullscreen" data-original-title="Remove Navigation Bar and Top Menu Toggle" data-toggle="tooltip" data-placement="bottom" class="fullscreen-button menu"> <i class="glyphicon glyphicon-fullscreen"></i> </div>

      

</div>

 

            </div>

          </div>

          <!-- vd_head-section -->

          

         

          <!-- vd_title-section -->

          

          <div class="vd_content-section clearfix">

            

            

              <!-- .col-md-4 --> 

            </div>

			

			<div class="row" id="form-basic">

              <div class="col-md-12">

                <div class="panel widget">

                  <div class="panel-heading vd_bg-grey">

                    <h3 class="panel-title"> <span class="menu-icon"> <i class="fa fa-bar-chart-o"></i> </span> Edit Student Name</h3>

                  </div>

                  <div class="panel-body">

                    <form class="form-horizontal"  action="uname.php" method="POST" role="form">

                     

                     

                      

                      <div class="form-group">

                        <label class="col-sm-4 control-label">Student Name</label>

                        <div class="col-sm-7 controls">

                        

						<label class="control-label"> <?php echo $ooname; ?></label> 

				

              </div>

                      </div>

					  

					  

                      <div class="form-group">

                        <label class="col-sm-4 control-label">Enter New Name</label>

                        <div class="col-sm-7 controls">

                        

						  

   <input type="text" placeholder="Enter Name in Caps" name="name">             </div>

                      </div>

					  

                    

                      <div class="form-group form-actions">

                        <div class="col-sm-4"> </div>

                        <div class="col-sm-8">

                          <button class="btn vd_btn vd_bg-green vd_white" type="submit"><i class="icon-ok"></i> Submit</button>

                     

                        </div>

                      </div>

                    </form>

                  </div>

                </div>

                <!-- Panel Widget --> 

              </div>

              <!-- col-md-12 --> 

            </div>

            <div class="row">

				<div class="col-md-3"></div>

			<div class="col-md-6">

                <div class="panel widget">

                  <div class="panel-body-list  table-responsive">

                    <table class="table no-head-border table-striped">

                      <thead class="vd_bg-blue vd_white">

                        <tr>

                          <th style="width:20%><i class="fa fa-search append-icon"></i>Student ID</th>

                          <th style="width:80%">Name</th>

                      

                        </tr>

                      </thead>

                      <tbody>

                         <?php







//make the database connection

include('config.php');

 $sql = "select subjects,class,type

 from `subjects` where staffid='$tyr' ";

 $data = mysqli_query($conn,$sql);







$rows4 = mysqli_num_rows($data);







  



print "<center>";





    

    

      

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



print "<thead >\n";

				print "<tr>\n";



print "

	

		<th width=20%><B>REGNO</B>

 </th>

				<th width=80%><div ><B>NAME</B>

 </div></th>

		



		

			



		





\n";			

				

					

				print "</tr>\n";

			print "</thead>\n";

			print "<tbody >\n";

//get field names





//get row data as an associative array

while ($row = mysqli_fetch_assoc($data55)){

print "<tr>\n";

//look at each field

foreach ($row as $col=>$val){

print " <td>$val</td>\n";

} // end foreach

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

}// end while

print "</table>\n";



print "</center>\n";

















?>



  </br> 

 <tr><td></br><u>TOTAL STUDENTS IN CLASS:</u></td><td ></br><b><?php echo $rows44; ?></b>

<td>



<TD></tr>

                    </table>

                  </div>

				  

				  

                </div>

                <div class="panel widget">

                  <div class="panel-body-list  table-responsive">

                    

                  </div>

                </div>

              </div>

              <!-- col-md-6 --> 

            <div class="col-md-3"></div>

              <!-- col-md-6 -->

              

            </div>

            <!-- .row --> 

          </div>

          <!-- .vd_content-section --> 

          

        </div>

        <!-- .vd_content --> 

      </div>



























</div>

















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

