<?php 
    session_start();
    if(!$_SESSION['id']){
        header('location:index.php');
    }
    require_once '../system/conn.php';
?>
<!doctype html>
<html lang="en" class="semi-dark">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="assets/css/pace.min.css" rel="stylesheet" />
	<script src="assets/js/pace.min.js"></script>
    <link href="assets/plugins/perfect-scrollbar/css/perfect-scrollbar.css" rel="stylesheet" />
    <link href="assets/plugins/simplebar/css/simplebar.css" rel="stylesheet" />
    <link href="assets/plugins/metismenu/css/metisMenu.min.css" rel="stylesheet" />
    <link href="assets/plugins/datatable/css/dataTables.bootstrap5.min.css" rel="stylesheet" />
    <link href="assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/bootstrap-extended.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">
    <link href="assets/css/icons.css" rel="stylesheet">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
    <link href="assets/css/dark-theme.css" rel="stylesheet" />
    <link href="assets/css/semi-dark.css" rel="stylesheet" />
    <link href="assets/css/header-colors.css" rel="stylesheet" />
    <title>UTCPL</title>
  </head>
  <body>
    <div class="wrapper">
    <?php include'system/header.php'?>
	    <div class="page-content-wrapper">
         <div class="page-content">
          <!--start breadcrumb-->
          <div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
            <div class="breadcrumb-title pe-3">View Branch Details</div>
          </div>
			<hr/>
				<div class="card">
					<div class="card-body">
						<div class="table-responsive">
							<table id="example2" class="table table-striped table-bordered">
								<tbody>
								    <?php 
                                        $stmt1 = $conn->prepare(" SELECT * FROM `branch` WHERE id='".$_GET['id']."' ");
                                        $stmt1->execute();
                                        $sql = $stmt1->fetchAll(); 
                                        //print_r($stmt1);exit;
                                        foreach($sql as $row) 
                                        { ?>
                                    <tr>
                                        <th>Branch Id</th>
                                        <td>
                                           <?php echo $row['id'];?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Branch Name</th>
                                        <td><?php echo $row['name'];?></td>
                                    </tr>
                                    <tr>
                                        <th>Status</th>
                                        <td>
                                            <?php
                                            if($row['status']==0){ ?>
                                              <a href="status-branch.php?id=<?php echo $row['id'];?>&status=<?php echo $row['status'];?>"><span class="badge bg-light-warning text-warning w-100">Inactive</span></a>
                                            <?php }else{ ?>
                                              <a href="status-branch.php?id=<?php echo $row['id'];?>&status=<?php echo $row['status'];?>"><span class="badge bg-light-success text-success w-100">Active</span></a>
                                          <?php } ?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Userame</th>
                                        <td><?php echo $row['username'];?></td>
                                    </tr>
                                    <tr>
                                        <th>Password</th>
                                        <td><?php echo $row['pwd_original']; ?></td>
                                    </tr>
                                    
                                    <?php  }?>
								</tbody>
								
							</table>
						</div>
					</div>
				</div>
             

          </div>
          <!-- end page content-->
         </div>
<?php include'system/footer.php'?>