zhensolid vor 1 Jahr
Ursprung
Commit
db194d7bf0
9 geänderte Dateien mit 298 neuen und 0 gelöschten Zeilen
  1. 1 0
      .htaccess
  2. 1 0
      .user.ini
  3. 1 0
      .well-known/acme-challenge/CTzy8N1nd12_uxtrWyOVGELDP2U94-FbtxFmpKQd3bw
  4. 7 0
      404.html
  5. 13 0
      config.php
  6. 149 0
      css/style.css
  7. 39 0
      index.html
  8. 30 0
      index.php
  9. 57 0
      search.php

+ 1 - 0
.htaccess

@@ -0,0 +1 @@
+ 

+ 1 - 0
.user.ini

@@ -0,0 +1 @@
+open_basedir=/mnt/mydata/Pay_Project/:/tmp/

+ 1 - 0
.well-known/acme-challenge/CTzy8N1nd12_uxtrWyOVGELDP2U94-FbtxFmpKQd3bw

@@ -0,0 +1 @@
+CTzy8N1nd12_uxtrWyOVGELDP2U94-FbtxFmpKQd3bw.qW5MHaUhmWRoHV-2BX4YpwFvpyR56OyCtAYvu8ueNlM

+ 7 - 0
404.html

@@ -0,0 +1,7 @@
+<html>
+<head><title>404 Not Found</title></head>
+<body>
+<center><h1>404 Not Found</h1></center>
+<hr><center>nginx</center>
+</body>
+</html>

+ 13 - 0
config.php

@@ -0,0 +1,13 @@
+<?php
+$host = 'localhost';
+$dbname = 'byc_mysql'; // 请替换为你的数据库名
+$username = 'kali';     // 请替换为你的数据库用户名
+$password = 'uKPAYkIZ2cFlKPN[';     // 请替换为你的数据库密码
+
+try {
+    $pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8", $username, $password);
+    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+} catch (PDOException $e) {
+    die("数据库连接失败: " . $e->getMessage());
+}
+?>

+ 149 - 0
css/style.css

@@ -0,0 +1,149 @@
+body { 
+    display: flex; 
+    align-items: center; 
+    justify-content: center; 
+    height: 100vh; 
+    font-family: Arial, sans-serif; 
+}
+
+.container { 
+    text-align: center; 
+}
+
+.search-bar { 
+    padding: 10px; 
+    font-size: 16px; 
+    width: 300px; 
+}
+
+.button { 
+    padding: 10px 20px; 
+    font-size: 16px; 
+}
+
+.result {
+    margin-top: 20px;
+    padding: 20px;
+    border-radius: 8px;
+    background-color: #f8f9fa;
+    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+    max-width: 600px;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+.result-item {
+    padding: 15px;
+    border-bottom: 1px solid #dee2e6;
+    text-align: left;
+}
+
+.result-item:last-child {
+    border-bottom: none;
+}
+
+.result-label {
+    font-weight: bold;
+    color: #495057;
+    margin-right: 10px;
+}
+
+.result-value {
+    color: #212529;
+}
+
+.no-result {
+    color: #dc3545;
+    padding: 15px;
+}
+
+.success-result {
+    color: #28a745;
+}
+
+/* 搜索结果样式 */
+.result-header {
+    margin-bottom: 30px;
+    padding-bottom: 15px;
+    border-bottom: 2px solid #eee;
+}
+
+.debtor-name {
+    color: #2c3e50;
+    margin: 0 0 10px 0;
+}
+
+.remaining-debt {
+    font-size: 18px;
+    color: #34495e;
+}
+
+.remaining-debt span {
+    font-weight: bold;
+    color: #e74c3c;
+}
+
+.repayment-section h3 {
+    color: #2c3e50;
+    margin-bottom: 20px;
+}
+
+.repayment-list {
+    display: flex;
+    flex-direction: column;
+    gap: 15px;
+}
+
+.repayment-item {
+    display: flex;
+    padding: 15px;
+    background: white;
+    border-radius: 8px;
+    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
+    transition: transform 0.2s;
+}
+
+.repayment-item:hover {
+    transform: translateY(-2px);
+    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
+}
+
+.repayment-date {
+    min-width: 100px;
+    color: #7f8c8d;
+    font-size: 14px;
+}
+
+.repayment-details {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    gap: 20px;
+}
+
+.repayment-amount {
+    font-weight: bold;
+    color: #27ae60;
+    font-size: 16px;
+}
+
+.repayment-method {
+    color: #34495e;
+    background: #f7f9fc;
+    padding: 4px 12px;
+    border-radius: 4px;
+    font-size: 14px;
+}
+
+.repayment-comment {
+    color: #95a5a6;
+    font-size: 14px;
+}
+
+.no-repayments, .no-result, .no-input {
+    color: #7f8c8d;
+    text-align: center;
+    padding: 20px;
+    background: #f8f9fa;
+    border-radius: 8px;
+} 

+ 39 - 0
index.html

@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>恭喜,站点创建成功!</title>
+    <style>
+        .container {
+            width: 60%;
+            margin: 10% auto 0;
+            background-color: #f0f0f0;
+            padding: 2% 5%;
+            border-radius: 10px
+        }
+
+        ul {
+            padding-left: 20px;
+        }
+
+            ul li {
+                line-height: 2.3
+            }
+
+        a {
+            color: #20a53a
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <h1>恭喜, 站点创建成功!</h1>
+        <h3>这是默认index.html,本页面由系统自动生成</h3>
+        <ul>
+            <li>本页面在FTP根目录下的index.html</li>
+            <li>您可以修改、删除或覆盖本页面</li>
+            <li>FTP相关信息,请到“面板系统后台 > FTP” 查看</li>
+        </ul>
+    </div>
+</body>
+</html>

+ 30 - 0
index.php

@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="UTF-8">
+    <title>欠款查询系统</title>
+    <link rel="stylesheet" href="css/style.css">
+</head>
+<body>
+
+<div class="container">
+    <h1>欠款查询系统</h1>
+    <form id="searchForm">
+        <input type="text" id="debtorName" name="debtorName" placeholder="请输入姓名" class="search-bar" required>
+        <button type="button" onclick="searchDebt()" class="button">查询</button>
+    </form>
+    <div id="result" class="result"></div>
+</div>
+
+<script>
+function searchDebt() {
+    const debtorName = document.getElementById('debtorName').value;
+    fetch(`search.php?debtorName=${encodeURIComponent(debtorName)}`)
+        .then(response => response.text())
+        .then(data => document.getElementById('result').innerHTML = data)
+        .catch(error => console.error('查询出错:', error));
+}
+</script>
+
+</body>
+</html>

+ 57 - 0
search.php

@@ -0,0 +1,57 @@
+<?php
+require 'config.php';
+
+if (isset($_GET['debtorName'])) {
+    $debtorName = $_GET['debtorName'];
+
+    // 检查总欠款数据库中是否存在该姓名
+    $stmt = $pdo->prepare("SELECT * FROM Debtors WHERE debtor_name = :debtorName");
+    $stmt->execute(['debtorName' => $debtorName]);
+    $debtor = $stmt->fetch(PDO::FETCH_ASSOC);
+
+    if ($debtor) {
+        // 获取还款记录
+        $repaymentStmt = $pdo->prepare("SELECT * FROM Repayments WHERE debtor_name = :debtorName ORDER BY repayment_date DESC");
+        $repaymentStmt->execute(['debtorName' => $debtorName]);
+        $repayments = $repaymentStmt->fetchAll(PDO::FETCH_ASSOC);
+
+        // 获取视图中的欠款信息
+        $viewStmt = $pdo->prepare("SELECT * FROM DebtStatus WHERE 姓名 = :debtorName");
+        $viewStmt->execute(['debtorName' => $debtorName]);
+        $viewData = $viewStmt->fetch(PDO::FETCH_ASSOC);
+
+        // 更新后的输出格式
+        echo "<div class='result-header'>";
+        echo "<h2 class='debtor-name'>{$debtor['debtor_name']}</h2>";
+        echo "<p class='remaining-debt'>当前欠款余额: <span>¥{$viewData['剩余欠款金额']}</span></p>";
+        echo "</div>";
+
+        echo "<div class='repayment-section'>";
+        echo "<h3>还款记录</h3>";
+
+        if ($repayments) {
+            echo "<div class='repayment-list'>";
+            foreach ($repayments as $repayment) {
+                echo "<div class='repayment-item'>";
+                echo "<div class='repayment-date'>{$repayment['repayment_date']}</div>";
+                echo "<div class='repayment-details'>";
+                echo "<div class='repayment-amount'>¥{$repayment['repayment_amount']}</div>";
+                echo "<div class='repayment-method'>{$repayment['repayment_method']}</div>";
+                if (!empty($repayment['comments'])) {
+                    echo "<div class='repayment-comment'>{$repayment['comments']}</div>";
+                }
+                echo "</div>";
+                echo "</div>";
+            }
+            echo "</div>";
+        } else {
+            echo "<p class='no-repayments'>暂无还款记录</p>";
+        }
+        echo "</div>";
+    } else {
+        echo "<div class='no-result'>未找到相关记录</div>";
+    }
+} else {
+    echo "<div class='no-input'>请输入姓名进行查询</div>";
+}
+?>