Gestionnaire de fichiers - Editer - /home/kridsana/webapp.cm.in.th/663012801/u66301280002/P001/index.php
Arrière
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> คำนวณคะแนนรวมและเกรด </title> <style> body { font-family: Verdana; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: #ff0000; } .form-container { background-color: #fff; padding: 30px; border-radius: 15px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); width: 320px; text-align: center; border: 3px solid #ff6f91; } h2 { color: #ff3f34; font-size: 24px; } label { font-size: 15px; color: #333; display: block; margin-top: 10px; text-align: left; } input[type="number"] { width: 100%; padding: 10px; margin-top: 5px; border: 2px solid #ff6f91; border-radius: 5px; box-sizing: border-box; background-color: #ffe6e9; font-size: 16px; } input[type="submit"] { margin-top: 20px; background-color: #ff3f34; color: #fff; border: none; padding: 12px; width: 100%; border-radius: 8px; cursor: pointer; font-size: 18px; font-weight: bold; } input[type="submit"]:hover { background-color: #e53229; } .result { margin-top: 25px; font-size: 18px; color: #ff3f34; font-weight: bold; } </style> </head> <body> <div class="form-container"> <h2>คำนวณคะแนนรวมและเกรด</h2> <form method="post" action=""> <label for="score1">คะแนนจิตพิสัย (20 คะแนน):</label> <input type="number" id="score1" name="score1" max="20" required> <label for="score2">คะแนนแบบทดสอบ (30 คะแนน):</label> <input type="number" id="score2" name="score2" max="30" required> <label for="score3">คะแนนงาน (20 คะแนน):</label> <input type="number" id="score3" name="score3" max="20" required> <label for="score4">คะแนนสอบปลายภาค (30 คะแนน):</label> <input type="number" id="score4" name="score4" max="30" required> <input type="submit" value="คำนวณคะแนนรวม"> </form> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $score1 = $_POST["score1"]; $score2 = $_POST["score2"]; $score3 = $_POST["score3"]; $score4 = $_POST["score4"]; $total = $score1 + $score2 + $score3 + $score4; 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 "<strong>ผลการคำนวณคะแนนรวมและเกรด</strong><br>"; echo "คะแนนรวม: " . $total . "<br>"; echo "เกรดที่ได้: " . $grade . "<br>"; echo "</div>"; } ?> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Génération de la page: 0.4 |
proxy
|
phpinfo
|
Réglages