This commit is contained in:
2025-01-08 12:19:48 +08:00
parent 1389a32e22
commit f4441e4f64
11 changed files with 176 additions and 17 deletions

36
bmi_631_1.php Normal file
View File

@ -0,0 +1,36 @@
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$height = $_POST['height'];
$weight = $_POST['weight'];
if ($height!= "" && $weight!= "") {
$bmi = $weight / ($height * $height);
if ($bmi >= 18.50 && $bmi <= 23.90) {
$result = "BMI指数正常";
} else {
$result = "BMI指数异常";
}
} else {
$result = "请输入完整的身高和体重信息";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BMI健康指标计算器</title>
</head>
<body>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
身高(米): <input type="text" id="height" name="height" placeholder="请输入身高"><br>
体重(千克): <input type="text" id="weight" name="weight" placeholder="请输入体重"><br>
<input type="submit" id="ok" name="ok" value="确定">
</form>
<?php if (isset($result)) {?>
<p><?php echo $result;?></p>
<?php }?>
</body>
</html>

6
bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

7
bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,8 @@
<?php
$link=mysqli_connect('localhost','user_20250103_58056','0PHoN2YsWaQdSJY','exam_20250103_58056');
mysqli_query($link,'set names utf8');
// 设置默认时区
date_default_timezone_set("Asia/Shanghai");
<?php
$link=mysqli_connect('localhost','user_20250103_58023','BlxFQtLkKWQm57R','exam_20250103_58023');
mysqli_query($link,'set names utf8');
// 设置默认时区
date_default_timezone_set("Asia/Shanghai");

5
jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
VPS server address : 125.64.9.222<br>VPS server port : 58023<br>VPS FTP user name : user_20250103_58023<br>VPS FTP user pass : BlxFQtLkKWQm57R<br>VPS FTP port : 21<br>VPS database name : exam_20250103_58023<br>VPS database user name : user_20250103_58023<br>VPS database pass : BlxFQtLkKWQm57R<br><br>VPS spring boot port : 58323<br>

42
search_73.php Normal file
View File

@ -0,0 +1,42 @@
<?php
require_once "db_config.php"; // 引入数据库配置
$conn = $link;
// 判断是否有表单提交过来的数据
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$search_name = $_POST['search_name'];
// 编写SQL查询语句从user_70表中根据姓名查找对应的地址信息
$sql = "SELECT address FROM user_70 WHERE name = '$search_name'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// 如果查询到数据,输出对应的地址
while ($row = $result->fetch_assoc()) {
echo $row["address"];
}
} else {
// 如果没有查询到数据,输出提示信息
echo "查无此人";
}
}
// 关闭数据库连接
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>姓名查询</title>
</head>
<body>
<!-- 创建form表单用于输入姓名进行查询 -->
<form action="search_73.php" method="post">
<label for="search_name">姓名:</label>
<input type="text" id="search_name" name="search_name">
<input type="submit" id="ok" name="ok" value="确定">
</form>
</body>
</html>

View File

@ -3,8 +3,9 @@
<head>
<meta charset="UTF-8">
<title>操作表</title>
<!-- 确保 jQuery 库正确加载 -->
<script src="http://125.64.9.222:8022/public_libs/jquery.js"></script>
<link href="./bootstrap.min.css" rel="stylesheet">
<script src="./jquery.min.js"></script>
<script src="./bootstrap.min.js"></script>
<script>
// 确保在文档加载完成后执行
$(document).ready(function(operation, table) {
@ -35,16 +36,21 @@
</script>
</head>
<body>
<button data-operation="del">drop table</button>
<button data-operation="create">create table</button>
<button data-operation="select">select table</button>
<select id="mySelect">
<option value="user_70">user_70</option>
<option value="nucleic_acid_test_2">nucleic_acid_test_2</option>
<option value="patient_90">patient_90</option>
</select>
<button onclick="location.reload();">refresh</button>
<div id="result" style="border: 1px solid; margin-top:15px; margin-left: 20px; margin-right: 100px; padding: 50px">
<h1 class="text-center mb-4 mt-3">操作表</h1>
<div class="container-sm mt-4 w-75 border border-2 p-4 rounded-3">
<div class="d-flex h-100 ">
<button data-operation="del" class="btn btn-danger m-2">drop table</button>
<button data-operation="create" class="btn btn-success m-2">create table</button>
<button data-operation="select" class="btn btn-primary m-2">select table</button>
<select id="mySelect" class="form-select m-2 " aria-label="Select table">
<option value="user_70" selected>user_70</option>
<option value="nucleic_acid_test_2">nucleic_acid_test_2</option>
<option value="patient_90">patient_90</option>
</select>
<button class="btn btn-secondary m-2" onclick="location.reload();">refresh</button>
</div>
<div class="m-4" id="result" style="margin-top:15px; margin-left: 20px; margin-right: 100px; padding: 50px">
</div>
</div>
</body>
</html>

30
setup_2.php Normal file
View File

@ -0,0 +1,30 @@
<?php
include_once("db_config.php");
mysqli_set_charset($link, 'utf8');
$query_string = "create table user_70(name char(50),address char(50),password char(50))ENGINE=MyISAM DEFAULT CHARSET=utf8";
mysqli_query($link,$query_string);
$query_string = "insert into user_70(name,address,password)values('mike','chengdu','c4ca4238a0b923820dcc509a6f75849b')";
mysqli_query($link,$query_string);
$query_string = "insert into user_70(name,address,password)values('mike','beijing','c4ca4238a0b923820dcc509a6f75849b')";
mysqli_query($link,$query_string);
$query_string = "insert into user_70(name,address,password)values('tom','chengdu','c4ca4238a0b923820dcc509a6f75849b')";
mysqli_query($link,$query_string);
$query_string = "insert into user_70(name,address,password)values('rose','chengdu','c4ca4238a0b923820dcc509a6f75849b')";
mysqli_query($link,$query_string);
$eventTime=mktime(12,12,12,12,12,2022);
$query_string = "create table nucleic_acid_test_2(id varchar(50),name varchar(50),address varchar(50),event_time int,insert_time int,code varchar(1))ENGINE=MyISAM DEFAULT CHARSET=utf8";
mysqli_query($link,$query_string);
$query_string = "insert into nucleic_acid_test_2(id,name,address,event_time,insert_time,code)values('510103199010210012','mike','shanghai',$eventTime,'1597238637','3')";
mysqli_query($link,$query_string);
$query_string ="insert into nucleic_acid_test_2(id,name,address,event_time,insert_time,code)values('510103198310607013','rose','beijing',$eventTime,'1597242237','2')";
mysqli_query($link,$query_string);
$query_string = "create table patient_90(patient_id char(50),patient_name char(50),patient_gender char(1),patient_address char(50))ENGINE=MyISAM DEFAULT CHARSET=utf8";
mysqli_query($link,$query_string);
$query_string = "insert into patient_90 values('123456','王某','1','1')";
mysqli_query($link,$query_string);
echo "表创建成功"

24
setup_3.php Normal file
View File

@ -0,0 +1,24 @@
<?php
include_once "db_config.php";
$queryString ="create table patient_90(patient_id char(50),patient_name char(50),patient_gender char(1),patient_address char(50))ENGINE=MyISAM DEFAULT CHARSET=utf8";
mysqli_query($link, $queryString);
$queryString ="create table doctor_90(doctor_id char(50),doctor_name char(50),doctor_gender char(1), department_id char(50))ENGINE=MyISAM DEFAULT CHARSET=utf8";
mysqli_query($link, $queryString);
$queryString ="create table department_90(department_id char(50),department_name char(50),department_location char(50))ENGINE=MyISAM DEFAULT CHARSET=utf8";
mysqli_query($link, $queryString);
$queryString ="create table register_90(biz_id char(50),doctor_id char(50),patient_id char(50),register_date int,fee int,state char(1))ENGINE=MyISAM DEFAULT CHARSET=utf8";
mysqli_query($link, $queryString);
$queryString ="insert into patient_90(patient_id,patient_name,patient_gender,patient_address)values('510103001','张三','1','成都')";
mysqli_query($link, $queryString);
$queryString ="insert into patient_90(patient_id,patient_name,patient_gender,patient_address)values('510103002','李四','2','重庆')";
mysqli_query($link, $queryString);
$queryString ="insert into doctor_90(doctor_id,doctor_name,doctor_gender,department_id)values('510105001','王医生','2','001')";
mysqli_query($link, $queryString);
$queryString ="insert into doctor_90(doctor_id,doctor_name,doctor_gender,department_id)values('510105002','罗医生','1','002')";
mysqli_query($link, $queryString);
$queryString ="insert into doctor_90(doctor_id,doctor_name,doctor_gender,department_id)values('510105003','陈医生','1','001')";
mysqli_query($link, $queryString);
$queryString ="insert into department_90(department_id,department_name,department_location)values('001','内科','1楼2诊室')";
mysqli_query($link, $queryString);
$queryString ="insert into department_90(department_id,department_name,department_location)values('002','外科','1楼5诊室')";
mysqli_query($link, $queryString);

View File

@ -0,0 +1 @@
TipU5uMBK4WCb4D3zK3