Current Directory:
/home/kridsana/webapp.cm.in.th/663012801/u66301280004/P001
Upload
Create File
File Name
Size
Actions
index.php
5136 bytes
Edit
|
Delete
|
Rename
|
Download
<!DOCTYPE html> <html lang="th"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>การประมวลผลคะแนน</title> <style> /* สไตล์เดิม */ @keyframes rainbow { 0% { background-color: #ff9a9e; } 15% { background-color: #fad0c4; } 30% { background-color: #fbc2eb; } 45% { background-color: #a1c4fd; } 60% { background-color: #c2e9fb; } 75% { background-color: #d4fc79; } 90% { background-color: #96e6a1; } 100% { background-color: #ff9a9e; } } body { font-family: 'Roboto', sans-serif; background: linear-gradient(135deg, #6e8efb, #a777e3); animation: rainbow 10s infinite; display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; color: #444; } .container { width: 100%; max-width: 500px; padding: 40px; background-color: #ffffff; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); border-radius: 20px; text-align: center; transform: translateY(-10px); transition: transform 0.4s ease, box-shadow 0.4s ease; } .container:hover { transform: translateY(-15px); box-shadow: 0 30px 50px rgba(0, 0, 0, 0.4); } h2 { color: #a777e3; margin-bottom: 30px; font-size: 28px; font-weight: 700; } form { display: flex; flex-direction: column; gap: 20px; } label { text-align: left; color: #555; font-weight: bold; font-size: 16px; } input[type="number"] { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 10px; font-size: 16px; box-sizing: border-box; transition: all 0.3s ease; color: #333; background: #f3f4f6; } input[type="number"]:focus { border-color: #6e8efb; box-shadow: 0 0 8px rgba(110, 142, 251, 0.5); outline: none; } button { padding: 15px; background: linear-gradient(145deg, #6e8efb, #a777e3); color: #fff; font-size: 18px; border: none; border-radius: 10px; cursor: pointer; transition: background-color 0.3s ease, transform 0.3s ease; font-weight: bold; box-shadow: 0 8px 15px rgba(110, 142, 251, 0.3); } button:hover { background: linear-gradient(145deg, #a777e3, #6e8efb); transform: scale(1.05); } .result { margin-top: 30px; padding: 20px; background: #f0f3fa; border-radius: 10px; color: #6e8efb; font-size: 20px; font-weight: bold; box-shadow: 0 8px 15px rgba(110, 142, 251, 0.2); text-align: center; } </style> </head> <body> <div class="container"> <h2>กรอกคะแนน</h2> <form method="post" action=""> <label>จิตพิสัย (20 คะแนน):</label> <input type="number" name="attitude" max="20" required> <label>แบบทดสอบ (30 คะแนน):</label> <input type="number" name="quiz" max="30" required> <label>งาน (20 คะแนน):</label> <input type="number" name="work" max="20" required> <label>สอบปลายภาค (30 คะแนน):</label> <input type="number" name="final" max="30" required> <button type="submit" name="calculate">ประมวลผล</button> </form> <?php if ($_SERVER['REQUEST_METHOD'] === 'POST') { $attitude = $_POST['attitude']; $quiz = $_POST['quiz']; $work = $_POST['work']; $final = $_POST['final']; $total = $attitude + $quiz + $work + $final; $grade = ''; if ($total >= 80) { $grade = "A"; } elseif ($total >= 75) { $grade = "B+"; } elseif ($total >= 70) { $grade = "B"; } elseif ($total >= 65) { $grade = "C+"; } elseif ($total >= 60) { $grade = "C"; } elseif ($total >= 55) { $grade = "D+"; } elseif ($total >= 50) { $grade = "D"; } else { $grade = "F"; } echo "<div class='result'>"; echo "<h2>ผลการประมวลผล</h2>"; echo "รวมคะแนน: $total คะแนน<br>"; echo "เกรด: $grade"; echo "</div>"; } ?> </div> </body> </html>
Save Changes