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);
if (isset($_POST['id'])) {
$strSQL3 = "UPDATE package SET
status = '".$_POST["status"]."',admin_id = '".$_SESSION["admin_id"]."'
WHERE pack_id = '".$_POST["id"]."' ";
$objQuery3 = mysqli_query($objCon,$strSQL3);
}
?>
<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="package.php">Package Vibharam Hospital</a></h4>
</div>
<div class="header">
<h6 class="title"><a href="package.php"> Package (TH)</a> | <a href="package2.php"> Package (EN)</a> | <a href="package3.php"> Package (CN)</a> | <a href="package4.php"> Package (JP)</a> | <a href="package5.php"> Package (MM)</a> | <a class="text-primary" href="package6.php"> Package (ARA)</a> </h6>
</div>
<?php
date_default_timezone_set('Asia/Bangkok');
$strSQL ="SELECT a.*, b.admin_id, b.username
FROM package a
LEFT JOIN admin b
ON a.admin_id=b.admin_id
ORDER BY pack_id DESC";
$objQuery = mysqli_query($objCon,$strSQL);
?>
<div class="content table-responsive table-full-width">
<a href="add_package6.php">
<button type="button" rel="tooltip" class="btn btn-info btn-simple btn-icon">
<i class="fa fa-plus-circle"></i> Add Package
</button>
</a>
<table class="table table-hover">
<thead>
<th style="width:25%;">Package Images</th>
<th style="width:25%;">Package</th>
<th style="width:15%;">Date</th>
<th style="width:10%;">Status</th>
<th style="width:10%;">Last Modified</th>
<th style="width:15%;"><div align="center">Manage</div></th>
</thead>
<?php
while($objResult = mysqli_fetch_array($objQuery,MYSQLI_ASSOC))
{
?>
<?php
if($objResult["pack6"] != "")
{
?>
<tbody>
<tr>
<td><img src="../upload_file/<?php echo $objResult["img"];?>" alt="image" style="width:50%;"/></td>
<td><?php echo $objResult["pack6"];?></td>
<td><?php echo date("jS F Y",strtotime($objResult["packdate"]));?></td>
<td>
<input type="checkbox" id="<?php echo $objResult["pack_id"]; ?>" class="toggle-event" name="<?php echo $objResult["pack_id"]; ?>" data-size="small"
<?php $status = $objResult["status"];?>
<?php if ($status == 1) { echo "checked"; } ?> data-toggle="toggle" data-on="On" data-off="Off" data-onstyle="primary" data-offstyle="default">
</td>
<td><?php echo $objResult["username"];?></td>
<td>
<div align="center">
<button type="button" rel="tooltip" class="btn btn-default btn-sm btn-simple" onclick="window.location.href='edit_pack6.php?pack_id=<?php echo $objResult['pack_id'];?>'" title="แก้ไขข้อมูล">
<i class="fa fa-pencil-square" aria-hidden="true"></i> Edit
</button>
<a href="JavaScript:if(confirm('Are you sure you want to delete this item ?')==true){window.location='deletepack.php?pack_id=<?php echo $objResult['pack_id'];?>&img=<?php echo $objResult["img"];?>'}">
<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>
</div>
</td>
</tr>
</tbody>
<?php
}else{
}
?>
<?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