📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
admission
/
admin
Dosya Düzenle: receipt.php
<?php session_start(); if (!isset($_SESSION['admin_logged_in'])) { header("Location: login.php"); exit; } include("connect.php"); if (!isset($_GET['formno'])) die("Invalid Request"); $formno = mysqli_real_escape_string($con, $_GET['formno']); $sql = "SELECT prereg.name, prereg.guroll, prereg.collegeroll, prereg.phone, prereg.email, prereg.admissionfor, personal_details.fathername, personal_details.gender, academic_details.stream, academic_details.sec, academic_details.sub1, academic_details.sub2, academic_details.majorstatus, fee_details.fees, fee_details.feeAmount, form_status.submission_date FROM form_status INNER JOIN prereg ON prereg.guroll = form_status.guroll AND prereg.collegeroll = form_status.collegeroll LEFT JOIN personal_details ON prereg.guroll = personal_details.guroll AND prereg.collegeroll = personal_details.collegeroll LEFT JOIN academic_details ON prereg.guroll = academic_details.guroll AND prereg.collegeroll = academic_details.collegeroll LEFT JOIN fee_details ON prereg.guroll = fee_details.guroll AND prereg.collegeroll = fee_details.collegeroll WHERE form_status.registrationformno = '$formno' LIMIT 1"; $res = mysqli_query($con, $sql); if (!$res || mysqli_num_rows($res) != 1) die("Form not found"); $row = mysqli_fetch_assoc($res); // ✅ Update payment_status to 'Paid' $guroll = mysqli_real_escape_string($con, $row['guroll']); $collegeroll = mysqli_real_escape_string($con, $row['collegeroll']); $updateSql = "UPDATE fee_details SET payment_status = 'Paid' WHERE guroll = '$guroll' AND collegeroll = '$collegeroll'"; mysqli_query($con, $updateSql); function convertNumberToWords($number) { $hyphen = '-'; $conjunction = ' and '; $separator = ', '; $negative = 'negative '; $dictionary = [ 0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine', 10 => 'ten', 11 => 'eleven', 12 => 'twelve', 13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen', 16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen', 19 => 'nineteen', 20 => 'twenty', 30 => 'thirty', 40 => 'forty', 50 => 'fifty', 60 => 'sixty', 70 => 'seventy', 80 => 'eighty', 90 => 'ninety', 100 => 'hundred', 1000 => 'thousand', 100000 => 'lakh', 10000000 => 'crore' ]; if (!is_numeric($number)) return false; if ($number < 0) return $negative . convertNumberToWords(abs($number)); $number = floor($number); // Ignore decimal part $string = null; switch (true) { case $number < 21: $string = $dictionary[$number]; break; case $number < 100: $tens = ((int) ($number / 10)) * 10; $units = $number % 10; $string = $dictionary[$tens]; if ($units) $string .= $hyphen . $dictionary[$units]; break; case $number < 1000: $hundreds = (int) ($number / 100); $remainder = $number % 100; $string = $dictionary[$hundreds] . ' ' . $dictionary[100]; if ($remainder) $string .= $conjunction . convertNumberToWords($remainder); break; default: $baseUnit = 10000000; if ($number < 10000000) $baseUnit = 100000; if ($number < 100000) $baseUnit = 1000; $numBaseUnits = (int) ($number / $baseUnit); $remainder = $number % $baseUnit; $string = convertNumberToWords($numBaseUnits) . ' ' . $dictionary[$baseUnit]; if ($remainder) $string .= $remainder < 100 ? $conjunction : $separator; if ($remainder) $string .= convertNumberToWords($remainder); break; } return $string; } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Admission Receipt</title> <style> @media print { body { margin: 0; size: A4 landscape; } } body { font-family: 'Segoe UI', sans-serif; width: 297mm; height: 210mm; margin: 0 auto; font-size: 13px; display: flex; justify-content: space-between; padding: 1mm; } .receipt-wrapper { display: flex; justify-content: space-between; width: 100%; } .receipt-column { width: 48%; border: 1px solid #000; padding: 10px; box-sizing: border-box; page-break-inside: avoid; } .header { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #000; padding-bottom: 6px; margin-bottom: 8px; } .header img { height: 50px; } .header div { flex: 1; text-align: center; } .header h1 { font-size: 20px; margin: 0; color: #2c3e50; } .header h4 { margin: 0; font-weight: 400; font-size: 13px; } .copy-label { text-align: center; font-weight: bold; text-transform: uppercase; font-size: 14px; margin-top: 4px; margin-bottom: 4px; } .receipt-title { text-align: center; font-size: 15px; font-weight: bold; margin: 6px 0; text-transform: uppercase; text-decoration: underline; } table { width: 100%; border-collapse: collapse; } table td { border: 1px solid #ccc; padding: 4px 6px; vertical-align: top; } .two-col td { width: 50%; } .highlight { font-weight: bold; color: #d35400; } .footer { margin-top: 120px; display: flex; justify-content: space-between; font-size: 12px; } .signature { text-align: right; } .signature p { margin: 2px 0; } .note { text-align: center; font-size: 11px; margin-top: 10px; color: #666; } </style> </head> <body onload="window.print()"> <div class="receipt-wrapper"> <?php $copies = ['Office Copy', 'Student Copy']; foreach ($copies as $copyLabel): ?> <div class="receipt-column"> <div class="header"> <img src="IMG/logo.png" alt="College Logo"> <div> <h1 style="margin-left: -20px;">MANGALDAI COLLEGE</h1> <h4 style="margin-left: -20px;">Affiliated to Gauhati University</h4> <h4 style="margin-left: -20px;">Session: 2025-26</h4> <?php $stream = strtolower($row['stream']); $course = ($stream === 'arts') ? 'BA' : (($stream === 'science') ? 'BSc' : (($stream === 'bca') ? 'BCA' : (($stream === 'bvoc') ? 'BVoc' : ''))); echo "<h4 style='margin-left: -20px;'>Admission for : {$course} " . htmlspecialchars($row['admissionfor']) . "</h4>"; ?> </div> </div> <div class="copy-label"><?= $copyLabel ?></div> <div class="receipt-title">Admission Receipt</div> <table class="two-col"> <tr><td colspan="2"><strong>Name</strong>: <?= htmlspecialchars($row['name']) ?></td></tr> <tr><td><strong>GU Roll No</strong>: <?= $row['guroll'] ?></td><td><strong>College Roll No</strong>: <?= $row['collegeroll'] ?></td></tr> <tr><td><strong>Phone</strong>: <?= $row['phone'] ?></td><td><strong>Email</strong>: <?= $row['email'] ?></td></tr> <tr><td colspan="2"><strong>Father's Name</strong>: <?= $row['fathername'] ?></td></tr> <tr><td><strong>Gender</strong>: <?= $row['gender'] ?></td><td><strong>Stream</strong>: <?= $row['stream'] ?></td></tr> <?php $m = $row['majorstatus']; $cm1 = $cm2 = ""; if ($m == "1 Major 1 Minor") { $cm1 = "Major : "; $cm2 = "Minor :"; } elseif ($m == "2 Minors") { $cm1 = "Minor 1 :"; $cm2 = "Minor 2 :"; } else { $m = "DSC"; } ?> <tr><td><strong><?= $cm1 ?></strong> <?= $row['sub1'] ?></td><td><strong><?= $cm2 ?></strong> <?= $row['sub2'] ?></td></tr> <tr><td><strong>SEC</strong>: <?= $row['sec'] ?></td><td></td></tr> <tr><td colspan="2"><strong>Scheme</strong>: <?= $m ?></td></tr> <tr> <td><strong>Fee Type</strong>: <?= $row['fees'] ?></td> <td> <strong>Fee Amount</strong>: <span class="highlight">₹<?= $row['feeAmount'] ?></span><br><br> <small>(<?= ucwords(convertNumberToWords($row['feeAmount'])) ?> Rupees only)</small> </td> </tr> </table> <div class="footer"> <div class="issued"> <p><strong>Issued on:</strong> <?= date('d M Y') ?></p> </div> <div class="signature"> <p>Authorized Signature</p> <p>_______________________</p> <p><small>Principal / Admission Incharge</small></p> </div> </div> <div class="note"> This is a computer-generated document. No signature is required </div> </div> <?php endforeach; ?> </div> </body> </html>
💾 Kaydet
İptal