One Hat Cyber Team
Your IP :
18.216.67.94
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:
index2.php
<?php session_start(); if (!isset($_SESSION['user_email'])) { header("Location: login.php"); exit(); } include 'addcaigou.php'; ?> <!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" /> <!--! 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>Admin & Dashboard</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:: Content Section !--> <div class="edash-content-section"> <!-- Start:: card --> <div class="edash-apps-main-card card position-relative" id="edash-apps-main-card"> <!-- Start:: row --> <div class="row g-0 overflow-hidden"> <!--! ================================ !--> <!--! Start:: edash-main-content !--> <!--! ================================ !--> <div class="edash-main-content col position-relative overflow-hidden"> <!-- Start:: edash-main-content-header --> <div class="edash-main-content-header ht-80 px-3 px-md-4 d-flex align-items-center justify-content-between gap-3"> <!-- Start:: edash-content-header-left --> <h4 class="mb-0">采购中心</h4> <!-- End:: edash-content-header-left --> <!-- Start:: edash-content-header-right --> <a href="javascript:void(0);" class="btn btn-md btn-primary" id="addKanbanBoard"> <i class="fi fi-br-plus"></i> <span class="ms-2">添加产品</span> </a> <!-- End:: edash-content-header-right --> </div> <!-- End:: edash-main-content-header --> <hr class="my-0" /> <!-- Start:: edash-main-content-body --> <!---------dT----------------> <div class="table-responsive edash-main-content-body edash-without-aside-footer p-0 position-relative ps--active-y"> <table class="table-gap-hover table table-hover overflow-hidden mb-0 px-4" style="border-spacing: 0 0.75rem; border-collapse: separate;"> <thead> <tr> <th scope="col" class="border-top border-start">#</th> <th scope="col" class="border-top">产品名称</th> <th scope="col" class="border-top">数量</th> <th scope="col" class="border-top">品牌名称</th> <th scope="col" class="border-top">公司名称</th> <th scope="col" class="border-top">状态</th> <th scope="col" class="border-top">日期</th> <th scope="col" class="text-end border-top border-end">操作</th> </tr> </thead> <tbody> <?php $servername = "localhost"; $username = "t001"; $password = "ZRTsRb6Ycp585AEC"; $dbname = "t001"; // 创建连接 $conn = new mysqli($servername, $username, $password, $dbname); // 检查连接 if ($conn->connect_error) { die("连接失败: " . $conn->connect_error); } // 查询数据库获取数据 $sql = "SELECT id, aname, amountss, bname, cname, remark, time FROM caigou ORDER BY id DESC"; $result = $conn->query($sql); if ($result->num_rows > 0) { // 输出数据 while($row = $result->fetch_assoc()) { $createdAt = new DateTime($row['time']); $currentDate = new DateTime(); $currentDayOfWeek = $currentDate->format('N'); // 获取当前星期几(1 = Monday, 7 = Sunday) $createdDayOfWeek = $createdAt->format('N'); // 获取记录添加日期的星期几 // 初始化状态 $status = 'Completed'; if ($createdDayOfWeek > 7 || ($createdDayOfWeek > 3 && $currentDayOfWeek <= 7) || ($createdDayOfWeek > 7 && $currentDayOfWeek > 3)) { $status = 'unfinished'; } echo "<tr>"; echo "<td class='border-top border-start'><span class='avatar-text'>" . htmlspecialchars($row['id']) . "</span></td>"; echo "<td class='border-top'><a href='javascript:void(0);' class='d-flex gap-3 align-items-center'>"; echo "<div class='flex-shrink-0'>"; echo "<div>" . htmlspecialchars($row['aname']) . "</div>"; echo "<div class='fs-12 fw-normal text-muted'>" . htmlspecialchars($row['remark']) . "</div>"; echo "</div></a></td>"; echo "<td class='border-top'><a>" . htmlspecialchars($row['amountss']) . "</a></td>"; echo "<td class='border-top'><a>" . htmlspecialchars($row['bname']) . "</a></td>"; echo "<td class='border-top'><a>" . htmlspecialchars($row['cname']) . "</a></td>"; // 根据状态显示对应的badge if ($status == 'Completed') { echo "<td class='border-top'><a href='javascript:void(0)' class='badge bg-danger-subtle text-danger'>unfinished</a></td>"; } else { echo "<td class='border-top'><a href='javascript:void(0)' class='badge bg-success-subtle text-success'>Completed</a></td>"; } echo "<td class='border-top'>" . htmlspecialchars($row['time']) . "</td>"; echo '<td class="text-end border-top border-end"><a href="update.php?id=' . $row['id'] . '" class="btn btn-sm btn-primary"><i class="fi fi-br-box"></i></a></td>'; echo "</tr>"; } } else { echo "<tr><td colspan='8' class='text-center'>暂无数据</td></tr>"; } $conn->close(); ?> </tbody> </table> </div> <!---------dT----------------> <!-- End:: edash-main-content-body --> </div> <!--! ================================ !--> <!--! End:: edash-main-content !--> <!--! ================================ !--> </div> <!-- End:: row --> </div> <!-- End:: card --> </div> <!--! End:: Content Section !--> </div> <!--! ================================================================ !--> <!--! End:: Page Content !--> <!--! ================================================================ !--> </main> <!--! ================================================================ !--> <!--! End:: Main Content !--> <!--! ================================================================ !--> </div> <!--! ================================================================ !--> <!--! End:: Main Wrapper !--> <!--! ================================================================ !--> <!--! ================================================================ !--> <!--! Start:: JS Files !--> <!--! ================================================================ !--> <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> <!--! ================================================================ !--> <!--! End:: JS Files !--> <!--! ================================================================ !--> </body> </html>
Simpan