<?php
 session_start();
 include "header.php";
 include "sidebar.php";
  if(!isset($_SESSION["userrpp"]))
  {
	header("Location: login.php");
  }
 
 ?>

 
  <main id="main" class="main">

    <div class="pagetitle">
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="index.php">Home</a></li>
          <li class="breadcrumb-item active">Edit Data Guru</li>
        </ol>
      </nav>
    </div><!-- End Page Title -->

     <section class="section">
      <div class="row">
        <div class="col-lg-12">
    
		 <div class="card info-card customers-card">
		 <h5 class="card-title">Edit Data Guru</h5>
			
			   
                 <?php
				 if (isset($_GET['id'])) {
					include 'config.php';
					$userid=$_GET['id'];
					$result = mysqli_query($mysqli, "select * from user where Iduser=$userid ");
					$res = mysqli_fetch_assoc($result);
					$nid = $res['Iduser'];
					$nnama = $res['nama'];
					$nuser = $res['userguru'];
					$npass = $res['password'];
					$nmadrasah = $res['madrasah'];
				?>	
					
      
              
              <!-- Horizontal Form -->
              <form name="edit" method="post" action="editguruAction.php">
                
                 <table border=0>
                  <tr>
					<td width="150">Kode User </td>
					<td> <div class="col-sm-5"> <input type="text" class="form-control" name="ikduser"  readonly value="<?php echo $nid; ?>" > </div></td>
                  </tr>
				  <tr>
					<td>Nama Guru</td>
					<td> <div class="col-sm-10"><input type="text" class="form-control" name="inama" maxlength="100" size="50" value="<?php echo $nnama; ?>"> </td>
                  </tr>
				  <tr>
					<td>User</td>
					<td> <div class="col-sm-5"> <input type="text" class="form-control" name="iuser" value="<?php echo $nuser; ?>"> </div></td>
                  </tr>
				  <tr>
					<td>Password</td>
					<td> <div class="col-sm-5"> <input type="text" class="form-control" name="ipass" value="<?php echo $npass; ?>"> </div></td>
                  </tr>
				   <tr>
					<td>Asal Madrasah</td>
					<td><div class="col-sm-10"><input type="text" class="form-control" name="imadrasah" maxlength="100" size="50" value="<?php echo $nmadrasah; ?>"> </div></td>
                  </tr>
				  <tr>
					<td></td>
					<td> <button type="submit" name="update" class="btn btn-primary">Simpan</button></td>
                  </tr>
                  </table> 
                 
                   
                
               
               
				
				
				
             
			<?php
				}	
				?>
             

            
           
        </div><!-- End Left side columns -->

      
      </div>
    </section>
<?php
 include "footer.php";
?>
 