加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
export_prescription.php 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
wenxin lai 提交于 2022-05-27 16:38 . 患者预约挂号查看导出处方
<?php
session_start();
#导出处方单
if (!isset($_SESSION['username']) or !isset($_SESSION['identity']) or ($_SESSION['identity'] != 1 && $_SESSION['identity'] != 0)) {
header("Location:login.php");
exit();
}
$filename = "prescription.xls";
header("Content-Type: application/vnd.ms-execl");
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-Disposition: attachment; filename=$filename");
header("Pragma: no-cache");
header("Expires: 0");
$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");
$info = mysqli_query($db, $_SESSION['sql']);
echo "排班号:"."\t";
echo "患者编号"."\t";
echo "患者姓名"."\t";
echo "医生科室"."\t";
echo "医生编号"."\t";
echo "医生姓名"."\t";
echo "诊断"."\t";
echo "药品号"."\t";
echo "药品名"."\t";
echo "药品数"."\n";
while ($row = mysqli_fetch_array($info)) {
echo $row['Sno']."\t";
echo $row['Pno']."\t";
echo $row['Pname']."\t";
echo $row['Department']."\t";
echo $row['Dno']."\t";
echo $row['Dname']."\t";
echo $row['Diagnosis']."\t";
echo $row['DrugNo']."\t";
echo $row['DrugName']."\t";
echo $row['DrugNum']."\t";
}
mysqli_query($db, "commit");
mysqli_close($db);
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化