加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
admin_schedule.php 6.10 KB
一键复制 编辑 原始数据 按行查看 历史
wenxin lai 提交于 2022-05-30 03:32 . update admin_schedule.php.
<?php
session_start(); //管理员查看排班信息?
if (!isset($_SESSION['username']) or !isset($_SESSION['identity']) or $_SESSION['identity'] != 2) {
header("Location:login.php");
exit();
}
$db = @mysqli_connect("localhost", "root", "123456", "MIS");
if (!$db) {
die("Fail to connect the database!!" . mysqli_connect_error());
}
mysqli_query($db, "begin");
mysqli_query($db, "set names utf8");
if (!isset($_POST['search']) or $_POST['search'] == "") {
$sql = "SELECT Schedule.Sno, Schedule.StartTime, Schedule.AppointedOrNot, Schedule.Dno, Doctor.Dname, Doctor.Department
FROM Schedule, Doctor
WHERE Schedule.Dno = Doctor.Dno";
} else {
$search = $_POST['search'];
$vague = "(Schedule.Sno LIKE '%$search%'
or Schedule.Dno LIKE '%$search%'
or Doctor.Dname LIKE '%$search%'
or Schedule.StartTime LIKE '%$search%'
or Schedule.Department LIKE '%$search%)";
$sql = "SELECT Schedule.Sno, Schedule.StartTime, Schedule.AppointedOrNot, Schedule.Dno, Doctor.Dname, Doctor.Department
FROM Schedule, Doctor
WHERE $vague
AND Schedule.Dno = Doctor.Dno";
}
$course_info = mysqli_query($db, $sql);
mysqli_query($db, "commit");
mysqli_close($db);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./style/admin/admin_course.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css">
<script type="text/javascript" src="./style/admin/admin.js"></script>
<title>武汉大学挂号系统</title>
</head>
<body>
<div class="container" >
<table class="identity">
<tr>
<td rowspan="2">
<img class="icon" src="./style/admin/admin.png">
</td>
<td class="identity_text">管理员</td>
</tr>
</table>
<div onclick="choose('logout')">
<i id="logout" class="fas fa-sign-out-alt"></i>
</div>
<div>
<button class="backup" onclick="javascript:window.location.href='backup.php'">备份</button>
</div>
<div>
<button class="restore" onclick="javascript:window.location.href='restore.php'">恢复</button>
</div>
<div class="admin">
<div class="option" onclick="choose('user')">
<i id="user" class="fas fa-users"></i>
<div class="option_text">用户</div>
</div>
<div class="option" onclick="choose('schedule')">
<i id="course" class="fas fa-book-open"></i>
<div class="option_text">排班</div>
</div>
<div class="option" onclick="choose('drug')">
<i id="course" class="fas fa-book-open"></i>
<div class="option_text">药品</div>
</div>
<!-- <div class="option" onclick="choose('grade')">
<i id="grade" class="fas fa-award"></i>
<div class="option_text">成绩</div>
</div> -->
</div>
<div class="course">
<h1>Schedule</h1>
<form action="add_delete_sche.php" method="POST">
<div class="form">
<div class="item">
<i class="fab fa-cuttlefish"></i>
<input type="text" name="Sno" placeholder="Schedule_number">
</div>
<div class="item">
<i class="fab fa-cuttlefish"></i>
<input type="text" name="Dno" placeholder="doctor_number">
</div>
<div class="item">
<i class="fas fa-user-tie"></i>
<input type="text" name="StartTime" placeholder="Start_time">
</div>
<div class="item">
<i class="fas fa-user-tie"></i>
<input type="text" name="AppointedOrNot" placeholder="Appoint_or_not">
</div>
<div class="operation">
<i class="fas fa-exchange-alt"></i>
<li><input id="insert" type="radio" name="operation_choice" value="1" checked></li>
<li><input id="delete" type="radio" name="operation_choice" value="-1"></li>
</div>
<button>Submit</button>
</div>
</form>
</div>
<form action="" method="POST">
<div class="search_box">
<input class="search_content" type="text" name="search" placeholder="search">
<button class="search_btn"><i class="fas fa-search"></i></button>
</div>
</form>
<div class="course_info">
<div class="info_box">
<table>
<thread>
<tr>
<th>排班编号</th>
<th>排班开始时间</th>
<th>医生编号</th>
<th>医生姓名</th>
<th>是否预约</th>
</tr>
</thread>
<tbody>
<?php
while ($row = mysqli_fetch_array($course_info)) {
echo"<tr><td>";
echo $row['Sno'], "</td><td>";
echo $row['StartTime'], "</td><td>";
echo $row['Dno'], "</td><td>";
echo $row['Dname'], "</td><td>";
echo $row['AppointedOrNot'], "</td><td>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化