代码拉取完成,页面将自动刷新
<?php
session_start();
if (!isset($_SESSION['username']) or !isset($_SESSION['identity']) or $_SESSION['identity'] != 1) {
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");
$username = $_SESSION['username'];
$name = mysqli_fetch_array(mysqli_query($db, "SELECT Dname FROM Doctor WHERE Dno ='$username'"))['Dname'];
if ($name == "") {
$name = "医生";
}
if (!isset($_POST['search']) or $_POST['search'] == "") {
$sql = "SELECT DrugNo,DrugName
FROM Drug";
} else {
$search = $_POST['search'];
$vague = "(Drug.DrugNo LIKE '%$search%' or Drug.DrugName LIKE '%$search%')";
$sql = "SELECT DrugNo,DrugName
FROM Drug;
WHERE $vague";
}
$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/teacher/teacher_course.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css">
<script type="text/javascript" src="./style/teacher/doctor.js"></script>
<title>武汉大学挂号系统</title>
</head>
<body>
<div class="container" >
<table class="identity">
<tr>
<td rowspan="2">
<img class="icon" src="./style/teacher/teacher.png">
</td>
<td class="identity_text"><?php echo $name; ?></td>
</tr>
</table>
<div onclick="choose('logout')">
<i id="logout" class="fas fa-sign-out-alt"></i>
</div>
<div class="teacher">
<div class="option" onclick="choose('doctor')">
<i id="teacher" class="fas fa-user"></i>
<div class="option_text">个人信息</div>
</div>
<div class="option" onclick="choose('pre')">
<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>
<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['DrugNo'], "</td><td>";
echo $row['DrugName'], "</td><td>";
}
?>
</tbody>
</table>
</div>
</div>
<button class="output" onclick="javascript:window.location.href='output.php'">
<p>EXPORT</p>
<div class="loading ">
<div></div>
<div></div>
<div></div>
</div>
<svg class='checkmark' width='15px' height='15px' stroke='white' stroke-width="2px" fill='none'>
<polyline points='1,5 6,9 14,1'></polyline>
</svg>
</button>
</div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$($('.output').click(
function() {
$(this).toggleClass('active');
setTimeout(
() => {
$(this).toggleClass('verity');
}, 2000
)
}
))
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。