MINI MINI MANI MO
<!doctype html>
<?php
session_start();
if($_SESSION['admin_id'] == "")
{
include("session.php");
}
include("connect.php");
$strSQL = "SELECT * FROM admin WHERE admin_id = '".$_SESSION['admin_id']."' ";
$objQuery = mysqli_query($objCon,$strSQL);
$objResult = mysqli_fetch_array($objQuery,MYSQLI_ASSOC);
?>
<html>
<head>
<?php include("assets/include/link.php"); ?>
</head>
<body>
<div class="wrapper">
<?php include("nav-menu.php"); ?>
<div class="main-panel">
<?php include("assets/include/account.php"); ?>
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card card-plain">
<div class="header">
<h4 class="title"><a href="branch.php">Branch Vibharam Hospital</a></h4>
</div>
<?php
$strSQL ="SELECT a.*, b.*
FROM branch a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
ORDER BY branch_no ASC";
$objQuery = mysqli_query($objCon,$strSQL);
?>
<div class="content table-responsive table-full-width">
<a href="add_branch.php">
<button type="button" rel="tooltip" class="btn btn-info btn-simple btn-icon">
<i class="fa fa-plus-circle"></i> Add Branch
</button>
</a>
<a href="order_branch.php">
<button type="button" rel="tooltip" class="btn btn-info btn-simple btn-icon">
<i class="fa fa-sort fa-lg"></i> Ranking
</button>
</a>
<table class="table table-hover">
<thead>
<th style="width:30%;">Hospital Logo</th>
<th style="width:30%;">Hospital</th>
<th style="width:15%;">Last Modified</th>
<th style="width:25%;"><div align="center">Manage</div></th>
</thead>
<?php
while($objResult = mysqli_fetch_array($objQuery,MYSQLI_ASSOC))
{
?>
<tbody>
<tr>
<td><img src="../upload_file/<?php echo $objResult["logo"];?>" alt="image" height="65"/></td>
<td><?php echo $objResult["company_1"];?></td>
<td><?php echo $objResult["username"];?></td>
<td>
<div align="center">
<a href="add_branchpic.php?branch_id=<?php echo $objResult['branch_id'];?>">
<button type="button" rel="tooltip" class="btn btn-default btn-simple btn-icon" title="เพิ่มรูปภาพ">
<i class="fa fa-picture-o"></i> Image
</button>
</a>
<button type="button" rel="tooltip" class="btn btn-default btn-sm btn-simple" onclick="window.location.href='edit_branch.php?branch_id=<?php echo $objResult['branch_id'];?>'" title="แก้ไขข้อมูล">
<i class="fa fa-pencil-square" aria-hidden="true"></i> Edit
</button>
<?php
$strSQL3 = "SELECT * FROM branch_pic WHERE branch_id ='".$objResult["branch_id"]."'";
$objQuery3 = mysqli_query($objCon,$strSQL3);
$objResult3 = mysqli_fetch_array($objQuery3,MYSQLI_ASSOC);
?>
<?php
if($objResult3["pic"] == "")
{
?>
<a href="JavaScript:if(confirm('Are you sure you want to delete this item ?')==true){window.location='deletebranch.php?branch_id=<?php echo $objResult['branch_id'];?>&logo=<?php echo $objResult["logo"];?>'}">
<button type="button" rel="tooltip" class="btn btn-danger btn-simple btn-icon" title="ลบข้อมูล">
<i class="fa fa-window-close" aria-hidden="true"></i> Remove
</button>
</a>
<?php
}else{
?>
<a href="JavaScript:if(confirm('Are you sure you want to delete this item ?')==true){window.location='deletebranch.php?branch_id=<?php echo $objResult['branch_id'];?>&logo=<?php echo $objResult["logo"];?>'}">
<button type="button" rel="tooltip" class="btn btn-danger btn-simple btn-icon" disabled>
<i class="fa fa-window-close" aria-hidden="true"></i> Remove
</button>
</a>
<?php
}
?>
</div>
</td>
</tr>
</tbody>
<?php
}
?>
</table>
<table class="table">
<tr><td> </td></tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<?php include("assets/include/script.php"); ?>
<?php include "texteditor.php"; ?>
</html>
<?php
mysqli_close($objCon);
?>
OHA YOOOO