403Webshell
Server IP : 172.67.187.206  /  Your IP : 172.71.28.155
Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586
User : SYSTEM ( 0)
PHP Version : 5.6.30
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Inetpub/www/work/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Inetpub/www/work/out3.php
<?php
/**
 * ไฟล์ลงเวลากลับ (CLI) [cite: 2025-07-09]
 */
require_once 'config.php';
require_once 'functions.php';

$target_u_id = 3; 
$today = date('Y-m-d');
$time_out = '16:45:00'; // ตั้งค่าเวลากลับคงที่ หรือใช้ date('H:i:s')

// ค้นหาข้อมูลการลงเวลาของวันนี้ [cite: 2025-07-09]
$sql_check = "SELECT * FROM attendance WHERE u_id = '$target_u_id' AND att_date = '$today'";
$res_check = mysqli_query($conn, $sql_check);

if (mysqli_num_rows($res_check) > 0) {
    // มีข้อมูลเข้างานแล้ว ให้บันทึกเวลากลับ [cite: 2025-07-09]
    $sql_update = "UPDATE attendance SET time_out = '$time_out' 
                   WHERE u_id = '$target_u_id' AND att_date = '$today'";
    
    if (mysqli_query($conn, $sql_update)) {
        echo "[SUCCESS] Checked-out: ID $target_u_id at $time_out\n";
    } else {
        echo "[ERROR] " . mysqli_error($conn) . "\n";
    }
} else {
    // กรณีลืมลงเวลาเข้า แต่อยากลงเวลากลับเลย ให้ระบบสร้างข้อมูลให้ใหม่
    $sql_force = "INSERT INTO attendance (u_id, att_date, time_in, time_out, work_location, work_detail) 
                  VALUES ('$target_u_id', '$today', '00:00:00', '$time_out', 'office', 'ปฏิบัติงานในสำนักงาน')";
    
    if (mysqli_query($sql_force)) {
        echo "[WARNING] No check-in found. Forced Check-out created at $time_out\n";
    }
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit