我正在使用phpmyadmin创建一个考勤系统。我目前正在使用以下列:日期,CardUID(因为我计划将RFID与之集成),超时,超时,迟到和宵禁。我还制作了一个html文件,该文件目前处于基本形式,没有CSS和其他内容。 The html screenshot
因此该代码旨在从html获取CardUID和时间。然后,代码将检查是否已经在数据库中输入了UID(包括超时),如果已输入,则将“ Time in in-time-”列放入“ Time in Time-in”,如果未输入,则将其更新为“ Time-out”柱。它还会检查“报到”日期的日期,如果它是在星期一降落的,则迟到时间与工作日的其余时间不同。所有时间的宵禁都是一样的。
<?php
include("Connect.php");
$dbselect = mysqli_select_db($conn, "att");
$DATE = date('d-m-y');
$UID = $_GET['uid'];
$TIME = $_GET['time'];
$TDY = FALSE;
$CURF = FALSE;
$sql_u = "SELECT * FROM `stuatte` WHERE EXISTS(SELECT * FROM `stuatte` WHERE `CardUID`='$UID' AND `Time-out`=NULL)";
$dayOfWeek = date("w", strtotime($DATE));
if($sql_u == TRUE){
if (date($TIME) < 1700) {
$CURF = true;
$TOUT = $TIME;
$sql = "UPDATE `stuatte` SET `Time-out`='$TOUT' WHERE `CardUID`='$UID'";
}
else{
$TOUT = $TIME;
$sql = "UPDATE `stuatte` SET `Time-out`='$TOUT' WHERE `CardUID`='$UID'";
}
mysqli_query($conn, $sql);
}
else{
if($dayOfWeek == 1){
if (date($TIME) > 1315) {
$TDY = TRUE;
$TIN = $TIME;
$sql ="INSERT INTO `stuatte`(`Date`, `CardUID`, `Time-in`, `Time-out`, `Tardy`, `Curfew`) VALUES ('$DATE','$UID','$TIN','$TOUT','$TDY','$CURF')";
}
else{
$TIN = $TIME;
$sql ="INSERT INTO `stuatte`(`Date`, `CardUID`, `Time-in`, `Time-out`, `Tardy`, `Curfew`) VALUES ('$DATE','$UID','$TIN','$TOUT','$TDY','$CURF')";
}
mysqli_query($conn, $sql);
}
else if($dayOfWeek == 2 || $dayOfWeek == 3 || $dayOfWeek == 4 || $dayOfWeek == 5){
if (date($TIME) > 1330) {
$TDY = TRUE;
$TIN = $TIME;
$sql ="INSERT INTO `stuatte`(`Date`, `CardUID`, `Time-in`, `Time-out`, `Tardy`, `Curfew`) VALUES ('$DATE','$UID','$TIN','$TOUT','$TDY','$CURF')";
}
else{
$TIN = $TIME;
$sql ="INSERT INTO `stuatte`(`Date`, `CardUID`, `Time-in`, `Time-out`, `Tardy`, `Curfew`) VALUES ('$DATE','$UID','$TIN','$TOUT','$TDY','$CURF')";
}
mysqli_query($conn, $sql);
}
}
header("refresh:1; url=UI.php");
?>
我的问题在于代码没有显示,据说是在html表中。感谢您抽出宝贵时间阅读本文,并可能对我有所帮助。