Viewing file: updatefees_from_id.php (7.01 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 enrollment='$var'"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ echo '<table style="width: 100%" >'; echo '<tr style="background-color: white;">'; echo '<td style="width: 88px">Student ID</td>'; echo '<td style="width: 133px">Year</td>'; echo '<td style="width: 133px">Month Name</td>'; echo '<td style="width: 133px">Amount</td>'; echo '<td style="width: 133px">Reg Date</td>'; echo '</tr>'; while($row = mysqli_fetch_array($result)){ $studentid= $row['enrollment'] ; $name= $row['name'] ; $std_mobile= $row['mobile'].','.$row['mobile2'] ; $feesamount=$row['course_fees']; $fees_deposit_date=$row['regDate']; echo '<tr>'; echo '<td style="width: 88px">'.$studentid.'</td>'; echo '<td style="width: 133px">'.$name.'</td>'; echo '<td style="width: 133px">'.$std_mobile.'</td>'; echo '<td style="width: 133px">'.$feesamount.'</td>'; echo '<td style="width: 133px">'.$fees_deposit_date.'</td>'; echo '</tr>'; } echo '</table>'; // Free result set mysqli_free_result($result); } else{ echo "Not Available any old Payment"; exit; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?>
<h2>Fees Details:</h2> <?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ include 'connect.php';
// Attempt select query execution $sql = "SELECT * FROM monthly_fees where student_id='$studentid' order by ID ASC"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ echo "<table>"; echo "<tr>"; echo "<th>Serial</th>"; echo "<th>Student ID</th>"; echo "<th>Name</th>"; echo "<th>Mobile</th>"; echo "<th>Month</th>"; echo "<th>Year</th>"; echo "<th>Amount</th>"; echo "<th>Date</th>"; echo "<th>Receipt</th>"; echo "</tr>"; while($row = mysqli_fetch_array($result)) { $rowid=$row['ID']; echo "<tr>"; echo "<td>" . $row['ID'] . "</td>"; echo "<td>" . $row['student_id'] . "</td>"; echo "<td>" . $row['student_name'] . "</td>"; echo "<td>" . $row['student_mobile1']. "</td>"; echo "<td>" . $row['fees_month'] . "</td>"; echo "<td>" . $row['fees_year'] . "</td>"; echo "<td>" . $row['paid_fees'] . "</td>"; $new_fees_month=$row['deposit_fees_month']+1; echo "<td>" .$row['deposit_fees_date'].'/'.$row['deposit_fees_month'].'/'.$row['deposit_fees_year']. "</td>"; echo "<td style='width: 133px'><a href='print_fees_receipt.php?ID=".$rowid. "'>Receipt</a></td>"; echo "</tr>"; $old_year=$row['fees_year'] ; $old_month=$row['fees_month']; } echo "</table>"; // Free result set mysqli_free_result($result); } else{ $old_month=date('m'); $old_year=date('Y'); $fees_date=date('d/m/Y'); } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }
if($old_month=='12') { $newmonths='01'; $newyears=$old_year+1; } else { $newmonths=$old_month+1; $newmonths= str_pad($newmonths, 2, '0', STR_PAD_LEFT); $newyears=$old_year; } $fees_date=date('d/m/Y'); // Close connection mysqli_close($link); ?> <!-- Insert Form --> <form action="insert_fees.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'>Mobile:</label> <input type="text" width='100' id="student_mobile" name="student_mobile" value='<?php echo $std_mobile ?>' ><br>
<label for="fees_month" width='100'>Month:</label> <input type="number" width='100' id="fees_month" name="fees_month" value='<?php echo $newmonths ?>' ><br>
<label for="fees_year">Year:</label> <input type="number" id="fees_year" name="fees_year" value='<?php echo $newyears ?>'><br>
<label for="student_id" width='100'>Present Days:</label> <input type="text" width='100' id="present" name="present" value='0' ><br>
<label for="fees_amount">Fees Amount:</label> <input type="number" id="fees_amount" name="fees_amount" value='<?php echo $feesamount ?>' ><br>
<label for="payment_date">Payment Date:</label> <select name="day" id="day"> <?php $todaydate=date('d'); for ($i = 1; $i <= 31; $i++) { echo "<option value='$todaydate'>$todaydate</option>"; echo "<option value=\"$i\"" . ($i == $dateComponents['day'] ? ' selected' : '') . ">$i</option>"; } ?> </select>
<select name="month" id="month"> <?php $todaymonth=date('m'); for ($i = 1; $i <= 12; $i++) { echo "<option value'$todaymonth'>$todaymonth</option>"; echo "<option value=\"$i\"" . ($i == $dateComponents['month'] ? ' selected' : '') . ">$i</option>"; } ?> </select>
<select name="year" id="year"> <?php $todayyear=date('Y'); $currentYear = date('Y'); echo "<option value'$currentYear'>$currentYear</option>"; ?> </select> <br><br> <label for="student_id" width='100'></label> <input type="submit" value="Insert"> </form>
</body> </html>
<script> // Get the input element var inputElement = document.getElementById("fees_month");
// Remove non-numeric characters using regular expression inputElement.value = inputElement.value.replace(/[^0-9]/g, ''); </script> </main><!-- End #main -->
<?php include 'footer.php';?>
</body>
</html>
|