diff --git a/api_73_5_e_insert.php b/api_73_5_e_insert.php new file mode 100644 index 0000000..ef9e3a8 --- /dev/null +++ b/api_73_5_e_insert.php @@ -0,0 +1,27 @@ +query($sql_check); + +if ($result_check->num_rows > 0) { + // 如果已有记录,直接返回码值 + echo $code; +} else { + // 插入新记录 + $sql_insert = "INSERT INTO nucleic_acid_test_2 (id, name, address, event_time, code) VALUES ('$id', '$name', '$address', $event_time, '$code')"; + if ($link->query($sql_insert) === TRUE) { + echo $code; + } else { + echo "插入失败: " . $link->error; + } +} diff --git a/api_73_5_e_select.php b/api_73_5_e_select.php new file mode 100644 index 0000000..143fde2 --- /dev/null +++ b/api_73_5_e_select.php @@ -0,0 +1,50 @@ +query($sql_red); + +if ($result_red->num_rows > 0) { + // 存在红码时空交集,赋红码并入库 + $sql_check = "SELECT * FROM nucleic_acid_test_2 WHERE id = '$id' AND address = '$address' AND event_time = $event_time"; + $result_check = $conn->query($sql_check); + if ($result_check->num_rows == 0) { + $sql_insert = "INSERT INTO nucleic_acid_test_2 (id, name, address, event_time, code) VALUES ('$id', '$name', '$address', $event_time, '3')"; + $conn->query($sql_insert); + } + echo "3"; + $conn->close(); + exit; +} + +// 查询是否存在黄码时空交集 +$sql_yellow = "SELECT * FROM nucleic_acid_test_2 + WHERE (address = '$address' OR ABS(event_time - $event_time) < 1800) AND code = '2'"; +$result_yellow = $conn->query($sql_yellow); + +if ($result_yellow->num_rows > 0) { + // 存在黄码时空交集,赋黄码并入库 + $sql_check = "SELECT * FROM nucleic_acid_test_2 WHERE id = '$id' AND address = '$address' AND event_time = $event_time"; + $result_check = $conn->query($sql_check); + if ($result_check->num_rows == 0) { + $sql_insert = "INSERT INTO nucleic_acid_test_2 (id, name, address, event_time, code) VALUES ('$id', '$name', '$address', $event_time, '2')"; + $conn->query($sql_insert); + } + echo "2"; + $conn->close(); + exit; +} + +// 无风险,返回绿码 +echo "1"; +?> diff --git a/drop_tables.php b/drop_tables.php new file mode 100644 index 0000000..2a0bdae --- /dev/null +++ b/drop_tables.php @@ -0,0 +1,28 @@ +"; +$queryString="insert into user_70(name,address,password)values('mike','shanghai','c4ca4238a0b923820dcc509a6f75849b')"; +mysqli_query($link,$queryString); +echo mysqli_error($link)."
"; +$queryString="insert into user_70(name,address,password)values('rose','beijing','c4ca4238a0b923820dcc509a6f75849b')"; +mysqli_query($link,$queryString); +echo mysqli_error($link)."
"; \ No newline at end of file diff --git a/form_test_1.php b/form_test_1.php new file mode 100644 index 0000000..c93aed2 --- /dev/null +++ b/form_test_1.php @@ -0,0 +1,27 @@ + + +
+ 姓名:
+ 年龄:

+
+ +
+ \ No newline at end of file diff --git a/img_code_1.php b/img_code_1.php new file mode 100644 index 0000000..abfc623 --- /dev/null +++ b/img_code_1.php @@ -0,0 +1,20 @@ + +=$maxRows){ + $offset=$_GET['offset']; + } + } + if($_GET['action']=='bottom'){ + if($maxRows%$rowsOfPage==0){ + //整页 + $offset=$maxRows-$rowsOfPage; + }else{ + //非整页 + $offset=$maxRows-$maxRows%$rowsOfPage; + //20 10 20-10 25-25%10 20 + } + + } + +}else{ + //第一次进入,偏移量为0 + $offset=0; +} +$queryString="select * from user_70 limit $offset,$rowsOfPage"; +$rs=mysqli_query($link,$queryString); +//用循环语句,从数据集中读出每一条记录 +echo ""; +//id,name,password,gender,birthday,course,hometown,resume +echo ""; +$pattern = '/(\d+)/'; +while ($row=mysqli_fetch_assoc($rs)){ + preg_match_all($pattern, $row['name'], $matches); + echo ""; + echo ""; + echo ""; + +} +echo ""; +echo "
姓名列表
".($matches[0][0]+1)."".$row['name']."
+首页 +| +上一页 +| +下一页 +| +末页 +
"; diff --git a/my_first_program.php b/my_first_program.php new file mode 100644 index 0000000..a1c856a --- /dev/null +++ b/my_first_program.php @@ -0,0 +1,4 @@ + 0) { + // 更新记录 + $update_query = "UPDATE patient_90 SET + patient_name = '$patient_name', + patient_gender = '$patient_gender', + patient_address = '$patient_address' + WHERE patient_id = '$patient_id'"; + mysqli_query($conn, $update_query); + } else { + // 插入新记录 + $insert_query = "INSERT INTO patient_90 + (patient_id, patient_name, patient_gender, patient_address) + VALUES + ('$patient_id', '$patient_name', '$patient_gender', '$patient_address')"; + mysqli_query($conn, $insert_query); + } + } catch (Exception $e) { + die("数据保存失败: " . $e->getMessage()); + } +} +?> + + + + + + + 患者建档 + + +

患者建档

+
+ +
+ + +
+ + + > + + > +
+ + +
+ + +
+ + diff --git a/program_85.php b/program_85.php new file mode 100644 index 0000000..3c5a134 --- /dev/null +++ b/program_85.php @@ -0,0 +1,29 @@ + + + + + + 姓名与地址查询 + + + +
+ + + + + + + + + + + + + +
+ + 0) { + $sql = "SELECT * FROM user_70 WHERE " . implode(" " . strtoupper($searchLogic) . " ", $conditions); + $stmt = $link->prepare($sql); + $stmt->bind_param($types, ...$params); + $stmt->execute(); + $result = $stmt->get_result(); + + $rowCount = $result->num_rows; + echo "

[" . $rowCount . "]

"; // 显示记录数 + + if ($rowCount > 0) { + while ($row = $result->fetch_assoc()) { + echo "

姓名: " . htmlspecialchars($row['name']) . " 地址: " . htmlspecialchars($row['address']) . "

"; + } + } + + $stmt->close(); + } else { + // 如果没有提供查询条件则不执行查询 + echo "

[0]

"; + } +} + ?> \ No newline at end of file diff --git a/upload/test_upload.txt b/upload/test_upload.txt new file mode 100644 index 0000000..af6c779 --- /dev/null +++ b/upload/test_upload.txt @@ -0,0 +1 @@ +6rlWseYg4VDRzwkAjLo \ No newline at end of file diff --git a/www/admin/back_index.php b/www/admin/back_index.php new file mode 100644 index 0000000..af1ee59 --- /dev/null +++ b/www/admin/back_index.php @@ -0,0 +1,14 @@ + + + + + + main + + + + + + + diff --git a/www/admin/left.html b/www/admin/left.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/www/admin/left.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/www/admin/right.html b/www/admin/right.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/www/admin/right.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/www/admin/top.html b/www/admin/top.html new file mode 100644 index 0000000..566549b --- /dev/null +++ b/www/admin/top.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file