<?php
include_once '../includes/processes.php';
$Process = new Login_Process;

$pageLink = basename($_SERVER['REQUEST_URI']);
$Process->check_status($pageLink);
if($_SESSION['dept_id']!=7) {
	
	header("location:../");
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Rpair Track Sheet</title>
	<link rel="icon" type="image/ico" href="img/airicon.ico"/>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet"  href="css/customstyle.css">
	 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
	<script src="table/js/jquery.js"></script>
	<script src="table/js/jquery.dataTables.js"></script>
	<script src="table/js/dataTables.bootstrap.js"></script>
  </head>
  <body>
    <header>
    <div class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
          <a href="" class="navbar-brand">Rpair Track Sheet</a>
        </div>
        <div class="collapse navbar-collapse" id="example">
          <ul class="nav navbar-nav">
            <li><a href="index.php"><span  class="glyphicon glyphicon-home"></span> Home</a></li>
            <li><a href="display.php"><span class="glyphicon glyphicon-list-alt"></span> View List</a></li>
            <li class="active"><a href="update_table.php"><span class="glyphicon glyphicon-pencil"></span> Update List</a></li>
			            <li><a href="advance_search.php"><span class="glyphicon glyphicon-search"></span> Advance Search</a></li>

             <li>
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <span class="glyphicon glyphicon-user"></span> Super Admin
            <span class="caret"></span>
            </a>
            <ul class="dropdown-menu">
              <li><a href="add_user.php"><span class="glyphicon glyphicon-plus-sign"></span> Add User</a></li>
              <li><a href="view_user.php"><span class="glyphicon glyphicon-list-alt"></span> View User</a></li>
              <li><a href="add_item.php"><span class="glyphicon glyphicon-shopping-cart"></span> Add item</a></li>

            </ul>
            </li>
          </ul>
           <form action="search.php" method="POST" class="navbar-form navbar-left" role="search">
            <div class="form-group">
              <input type="text" name="search" class="form-control" placeholder="Search Here">
            </div>
            <button name="submit" type="submit" class="btn btn-primary "><span class="glyphicon glyphicon-search"></span></button>

          </form>
             <ul class="nav navbar-nav  navbar-left " >
		   <li>
		   <form action="homepage.php" method="POST" class="navbar-form">
            <a href="" class="dropdown-toggle" data-toggle="dropdown">
            <span class="glyphicon glyphicon-user"> </span>
            <span class="caret"></span>
            </a>
            <ul class="dropdown-menu">
              <li><a href="change_password.php"><span class="glyphicon glyphicon-wrench"></span> Change password</a></li>
			  <li class="divider"></li>
				<li>
				<button name="logout" type="submit" class="btn btn-group-justified btn-danger">
				<span class="glyphicon glyphicon-log-out ">Logout</span>
				</button>
				</li>
            </ul>
			</form>
		  </ul>
        </div>
      </div>
    </div>
    </header>
    <div class="container padding-top-120">
    <div class="table-responsive">
    <table class="table table-bordered table-hover table-condensed" id="">
    <thead>
      <tr class="info">
            <th>S/n</th>
            <th>Name of item</th>
            <th>Serial number</th>
            <th>Originating station</th>
            <th>date in</th>
            <th>problem</th>
            <th>Date sent</th>
            <th>Work done</th>
            <th>Date returned</th>
            <th>Remark</th>
            <th>Update</th>
      </tr>
    </thead>
      <tbody>
<?php
   if(isset($_POST['update'])){

      $id= $_POST['id'];

$query="SELECT * FROM repair_list  WHERE id='$id'";
$get=mysql_query($query);
while ($display=mysql_fetch_assoc($get)){

    echo "<tr><form action=update.php method=post>";
	echo "<td><input disabled type=text name=id value='".$display['id']."'</td>";
	echo "<td><input disabled  type=text name=name_of_item value='".$display['name_of_item']."'</td>";
	echo "<td><input disabled  type=text name=serial_number value='".$display['serial_number']."'</td>";
	echo "<td><input disabled  type=text name=originating_station value='".$display['originating_station']."'</td>";
	echo "<td><input disabled  type=text name=date_in value='".$display['date_in']."'</td>";
	echo "<td><input disabled  type=text name=problem value='".$display['problem']."'</td>";
	echo "<td><input disabled  type=text name=date_sent value='".$display['date_sent']."'</td>";
	echo "<td><input disabled type=text name=work_done value='".$display['work_done']."'</td>";
	echo "<td><input disabled type=text name=date_returned value='".$display['date_returned']."'</td>";
	echo "<td><input disabled type=text name=remark value='".$display['remark']."'</td>";
	echo "<td><input disabled type=submit name='update' value=Update class='btn btn-xs btn-primary' /></td>";
	echo "</form></tr>";
}
		 }

?>
	  </tbody>
    </table>
    </div>
	<form action="excel.php" method="post" class="padding-top-20 magin-top-35" >
	<button name="export_excel" type="submit" class="btn btn-success">
		<span class="glyphicon glyphicon-save "> Download</span>
	</button>
	</form>
    </div>


	<script>

	</script>

  </body>
</html>
