Pārlūkot izejas kodu

fix: update template

igb 3 nedēļas atpakaļ
vecāks
revīzija
aab191d262
3 mainītis faili ar 13 papildinājumiem un 9 dzēšanām
  1. 8 4
      index.php
  2. 1 1
      system/css/loginlayout.css
  3. 4 4
      system/login.php

+ 8 - 4
index.php

@@ -5,9 +5,13 @@ $ip = getIp();
 $act = $_GET['act'] ?? '';
 
 if ($act == "logout") {
+    // Check if the session variable exists before using it
+    $employeeName = $_SESSION['employee_name'] ?? 'Unknown User';
+    $currentTime = date('Y-m-d H:i:s');
+    $loginAct = $employeeName . " " . $currentTime . "从" . $ip . "退出系统";
+    
     $stmt = $conn->prepare("INSERT INTO logrecord (loginName, loginTime, loginAct) VALUES (?, ?, ?)");
-    $loginAct = $_SESSION['employee_name'] . " " . date('Y-m-d H:i:s') . "从" . $ip . "退出系统";
-    $stmt->bind_param("sss", $_SESSION['employee_name'], date('Y-m-d H:i:s'), $loginAct);
+    $stmt->bind_param("sss", $employeeName, $currentTime, $loginAct);
     $stmt->execute();
     
     // 清除所有session变量
@@ -174,7 +178,7 @@ if ($act == "login") {
                 <div class='icon'>
                     <img alt="" src='images/lock_icon_copy.png'>
                 </div>
-                <input name="loginpwd" id="loginpwd" placeholder='密码' maxlength="16" type='password' a>
+                <input name="loginpwd" id="loginpwd" placeholder='密码' maxlength="16" type='password'  a>
                 <div class='validation'>
                     <img alt="" src='images/tick.png'>
                 </div>
@@ -183,7 +187,7 @@ if ($act == "login") {
                 <div class='icon'>
                     <img alt="" src='images/key.png'>
                 </div>
-                <input name="logincode" id="logincode" placeholder='验证码' maxlength="5" type='text'  >
+                <input name="logincode" id="logincode" placeholder='验证码' maxlength="5" type='text' inputmode="none" >
 
             </div>
             <div class='login_fields__code'>

+ 1 - 1
system/css/loginlayout.css

@@ -11,7 +11,7 @@ position:relative;
 }
 #loginform{
 width:420px;height:140px;
-padding:120px;
+padding:120px 80px;
 }
 #loginuser,#loginpwd,#logincode{
 background:none;

+ 4 - 4
system/login.php

@@ -165,16 +165,16 @@ if ($act == "login") {
     cursor: pointer;
     position: absolute;
     top: 120px;
-    left: 450px; /* 原来是380px,向右移动 */
+    left: 410px; /* 原来是380px,向右移动 */
 }
 </style>
 </head>
 <body>
 <div id="container">
     <form id="loginform" name="loginform" method="post">
-        <div class="loginuser"><label for="loginuser">用户帐号:</label><input type="text" id="loginuser" name="loginuser" maxlength="50" autocomplete="off" /></div>
-        <div class="loginpwd"><label for="loginpwd">用户密码:</label><input type="password" id="loginpwd" name="loginpwd" maxlength="50" autocomplete="off" /></div>
-        <div class="logincode"><label for="logincode">验 证 码:</label><input type="text" id="logincode" name="logincode" maxlength="5" autocomplete="off" /><span id="showlogincode"></span></div>
+        <div class="loginuser"><label for="loginuser">用户帐号:</label><input type="text" id="loginuser" name="loginuser" maxlength="50" autocomplete="off" placeholder="输入用户帐号" /></div>
+        <div class="loginpwd"><label for="loginpwd">用户密码:</label><input type="password" id="loginpwd" name="loginpwd" maxlength="50" autocomplete="off" placeholder="输入用户密码" /></div>
+        <div class="logincode"><label for="logincode">验 证 码:</label><input type="text" id="logincode" name="logincode" maxlength="5" autocomplete="off" placeholder="输入验证码"/><span id="showlogincode"></span></div>
         <div><input type="submit" id="loginbtn" name="loginbtn" value="登陆" /></div>
         <div id="formmsg"></div>
     </form>