<?php require_once 'functions.php'; $message = ''; $message_type = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $web_sn = cleanInput($_POST['web_sn'] ?? ''); $username = cleanInput($_POST['username'] ?? ''); $school = cleanInput($_POST['school'] ?? ''); if (empty($web_sn) || empty($username) || empty($school)) { $message = '请填写完整信息'; $message_type = 'danger'; } else { if (addRegistration($web_sn, $username, $school)) { $message = '登记成功!'; $message_type = 'success'; } else { $message = '登记失败,请重试'; $message_type = 'danger'; } } } ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>高校网页售卖查重登记系统</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; } .card { box-shadow: 0 10px 30px rgba(0,0,0,0.2); border: none; border-radius: 15px; } .btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; } .btn-primary:hover { background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%); } </style> </head> <body> <div class="container py-5"> <div class="row justify-content-center"> <div class="col-lg-6 col-md-8 col-12"> <div class="card p-4"> <div class="text-center mb-4"> <h2 class="fw-bold text-primary">高校网页售卖查重登记系统</h2> <p class="text-muted">请填写以下信息进行购买登记</p> </div> <?php if ($message): ?> <div class="alert alert-<?= $message_type ?> alert-dismissible fade show" role="alert"> <?= $message ?> <button type="button" class="btn-close" data-bs-dismiss="alert"></button> </div> <?php endif; ?> <form method="POST" action=""> <div class="mb-3"> <label for="web_sn" class="form-label">网页序号 <span class="text-danger">*</span></label> <input type="text" class="form-control" id="web_sn" name="web_sn" required placeholder="请输入网页序号"> </div> <div class="mb-3"> <label for="username" class="form-label">姓名 <span class="text-danger">*</span></label> <input type="text" class="form-control" id="username" name="username" required placeholder="请输入姓名"> </div> <div class="mb-4"> <label for="school" class="form-label">所在学校名称 <span class="text-danger">*</span></label> <input type="text" class="form-control" id="school" name="school" required placeholder="请输入所在学校名称"> </div> <button type="submit" class="btn btn-primary w-100 py-3 fs-5">提交登记</button> </form> <div class="text-center mt-4"> <a href="check.php" class="text-decoration-none"> <button class="btn btn-outline-secondary">去查重查询</button> </a> </div> </div> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> </body> </html>