Viewing file: student_batch.php (3.92 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE html> <html lang="en">
<?php include 'head.php';?> <style> body { font-family: Arial, sans-serif; margin: 0; padding: 20px; }
h1, h2 { text-align: center; }
.branch-list { list-style-type: none; padding: 0; text-align: center; }
.branch-list li { margin: 10px 0; }
.branch-list a { text-decoration: none; color: #333; font-weight: bold; }
.branch-list a:hover { color: #4CAF50; }
/* Add more styling as needed */
table { border-collapse: collapse; border-spacing: 0; width: 100%; margin: 0 auto; border:2; }
th, td { padding: 10px; text-align: left; }
th { background-color: #04AA6D; color: white; } label, input { width: 200px; } </style> <body>
<!-- ======= Header ======= --> <?php include 'menubar.php';?>
<?php include 'sidebar.php';?>
<main id="main" class="main">
<?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ include 'connect.php'; $var = $_GET['ID'];
// Attempt select query execution $sql = "SELECT * FROM admission where ID='$var'"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_array($result)){ $studentid= $row['enrollment'] ; $name=$row['name']; $std_mobile= $row['mobile'].','.$row['mobile2'] ; $feesamount=$row['course_fees'] ; $batch=$row['batchtime'] ; $table_no=$row['table_no'] ; } // Free result set mysqli_free_result($result); } else{ } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?>
<br><br> <h2>Update Batch, Table No & Discount </h2> <hr> <form action="student_batch.php" method="POST"> <label for="student_id" width='100'>Student ID:</label> <input type="text" width='100' id="student_id" name="student_id" value='<?php echo $studentid ?>' readonly ><br> <label for="student_id" width='100'>Name:</label> <input type="text" width='100' id="student_name" name="student_name" value='<?php echo $name ?>' readonly ><br> <label for="student_id" width='100'>Batch:</label> <input type="text" width='100' id="student_batch" name="student_batch" value='<?php echo $batch ?>' ><br>
<label for="fees_month" width='100'>Desk No:</label> <input type="text" width='100' id="desk_no" name="desk_no" value='<?php echo $table_no ?>' ><br>
<label for="student_id" width='100'>New Fees:</label> <input type="text" width='100' id="fees_amount" name="fees_amount" value='<?php echo $feesamount ?>' ><br><br> <label for="student_id" width='100'></label> <input type="submit" value="UPDATE" disable> </form>
<?php
include 'connect.php';
if ($_SERVER["REQUEST_METHOD"] == "POST") { $studentid = mysqli_real_escape_string($link, $_POST['student_id']); $tableno = mysqli_real_escape_string($link, $_POST['desk_no']); $batch= mysqli_real_escape_string($link, $_POST['student_batch']); $newfees= mysqli_real_escape_string($link, $_POST['fees_amount']);
// Attempt update query execution $sql = "UPDATE admission SET table_no='$tableno', batch_time='$batch', course_fees=$newfees, enrollment='$newfees' WHERE enrollment='$studentid'"; if (mysqli_query($link, $sql)) { echo "Records were updated successfully."; } else { echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }
} // Close connection mysqli_close($link); ?>
<?php // Check if the HTTP_REFERER is set if (isset($_SERVER['HTTP_REFERER'])) { $previousPage = htmlspecialchars($_SERVER['HTTP_REFERER']); echo "<p><a href=\"$previousPage\">Go Back</a></p>"; } else { echo "<p>No previous page available.</p>"; } ?> <a href="viewregistraion.php">VIEW WEB PAGE</a>
</main><!-- End #main --> <br> <?php include 'footer.php';?>
</body>
</html>
|