📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
admission
Dosya Düzenle: challan.php
<?php session_start(); include("connect.php"); if (!isset($_GET['formno'])) { echo "Form number not provided."; exit; } $formno = $_GET['formno']; // Fetch form_status $sql = "SELECT * FROM form_status WHERE registrationformno = ?"; $stmt = $con->prepare($sql); $stmt->bind_param("s", $formno); $stmt->execute(); $formResult = $stmt->get_result(); if ($formResult->num_rows === 0) { echo "Invalid form number."; exit; } $formData = $formResult->fetch_assoc(); $guroll = $formData['guroll']; $collegeroll = $formData['collegeroll']; // Fetch preregistration details $sql0 = "SELECT * FROM prereg WHERE guroll = ? AND collegeroll = ?"; $stmt0 = $con->prepare($sql0); $stmt0->bind_param("ss", $guroll, $collegeroll); $stmt0->execute(); $pre = $stmt0->get_result()->fetch_assoc(); // Fetch fee_details $sql1 = "SELECT * FROM fee_details WHERE guroll = ? AND collegeroll = ?"; $stmt1 = $con->prepare($sql1); $stmt1->bind_param("ss", $guroll, $collegeroll); $stmt1->execute(); $fee = $stmt1->get_result()->fetch_assoc(); // Function to convert number to words function numberToWords($number) { $words = array( '', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen' ); $tens = array('', '', 'Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety'); $num = (int)$number; if ($num < 20) return $words[$num]; if ($num < 100) return $tens[intval($num / 10)] . ($num % 10 ? ' ' . $words[$num % 10] : ''); if ($num < 1000) return $words[intval($num / 100)] . ' Hundred' . ($num % 100 ? ' and ' . numberToWords($num % 100) : ''); if ($num < 100000) return numberToWords(intval($num / 1000)) . ' Thousand' . ($num % 1000 ? ' ' . numberToWords($num % 1000) : ''); return $number; // fallback } $amountNumeric = (float)$fee['feeAmount']; $amountText = numberToWords($amountNumeric) . ' Only'; // Assuming you already have $guroll $sql = "SELECT stream FROM academic_details WHERE guroll = ?"; $stmt = $con->prepare($sql); $stmt->bind_param("s", $guroll); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows === 0) { $stream = ''; // fallback if not found } else { $row = $result->fetch_assoc(); $stream = $row['stream']; } ?> <!DOCTYPE html> <html> <head> <title>Bank Challan</title> <style> body { margin: 0; padding: 0; font-family: Arial, sans-serif; font-size: 10pt; } @page { size: A4 landscape; margin: 10mm; } @media print { .print-button { display: none; } } .print-button { margin: 10px; text-align: center; } .challan-container { display: flex; width: 100%; justify-content: space-between; } .challan-copy { width: 32%; border: 1px solid #000; padding: 10px; box-sizing: border-box; } .logo-header { text-align: center; margin-bottom: 10px; } .logo-header img { width: 50px; vertical-align: middle; } .logo-header h2 { display: inline-block; margin: 0; vertical-align: middle; font-size: 14pt; } .copy-title { text-align: center; font-weight: bold; margin: 5px 0; text-transform: uppercase; font-size: 11pt; } .challan-table { width: 100%; border-collapse: collapse; } .challan-table td { padding: 4px; vertical-align: top; } .footer { margin-top: 15px; font-size: 9pt; text-align: center; } .bank-details { font-size: 9.5pt; margin-top: 10px; border-top: 1px dashed #444; padding-top: 6px; } hr { margin: 8px 0; } </style> </head> <body> <div class="print-button"> <button onclick="window.print()">🖨️ Print Challan</button> </div> <div class="challan-container"> <?php $copies = ['College Copy', 'Student Copy', 'Bank Copy']; foreach ($copies as $copy) { ?> <div class="challan-copy"> <div class="logo-header"> <img src="https://www.mangaldaicollege.org/img/logo.png" alt="College Logo"> <h2>Mangaldai College</h2><P> <h2>Bank Challan</h2> </div> <div class="copy-title"><?php echo $copy; ?></div> <hr> <table class="challan-table"> <tr><td><strong>Form/Challan No:</strong></td><td><?php echo htmlspecialchars($formno); ?></td></tr> <tr><td><strong>Student Name:</strong></td><td><?php echo $pre['name']; ?></td></tr> <tr><td><strong>GU Roll No:</strong></td><td><?php echo $guroll; ?></td></tr> <tr><td><strong>College Roll No:</strong></td><td><?php echo $collegeroll; ?></td></tr> <tr> <td><strong>Course:</strong></td> <td><?php echo $stream . ' (' . $pre['admissionfor'] . ')'; ?></td> </tr> <tr><td><strong>Admission Type:</strong></td><td><?php echo $fee['fees']; ?></td></tr> <tr><td><strong>Amount:</strong></td><td>₹<?php echo number_format($amountNumeric, 2); ?><br><small><em><?php echo $amountText; ?></em></small></td></tr> <tr><td><strong>Payment Type:</strong></td><td>Bank Challan</td></tr> <tr><td><strong></strong></td><td> </td></tr> <tr><td><strong>Transaction ID:</strong></td><td> </td></tr> <tr><td><strong> Transaction Date:</strong></td><td></td></tr> </table> <div class="bank-details"> <strong>Bank Account Details:</strong><br><br> <?php if ($stream === 'BCA') { echo "Bank Name: Bank of Baroda<br>"; echo "Branch: Mangaldai College Branch<br>"; echo "Account Name: DOEACC Fund<br>"; echo "Bank Account Number: <span style='font-weight:bold; font-size: larger;'>49840100000007</span><br>"; echo "IFSC Code: BARB0MANCOL"; } elseif ($stream === 'MLMDT' || $stream === 'FPT') { echo "Bank Name: Bank of Baroda<br>"; echo "Branch: Mangaldai College Branch<br>"; echo "Account Name: BVOC Fund<br>"; echo "Bank Account Number: <span style='font-weight:bold; font-size: larger;'>49840100001505</span><br>"; echo "IFSC Code: BARB0MANCOL"; } else { echo "Bank Name: Bank of Baroda<br>"; echo "Branch: Mangaldai College Branch<br>"; echo "Account Name: Current General Fund<br>"; echo "Bank Account Number: <span style='font-weight:bold; font-size: larger;'>49840200000006</span><br>"; echo "IFSC Code: BARB0MANCOL"; } ?> </div> <div class="footer"> Signature of Candidate: ___________________<br><br> Seal & Signature of Authority: ___________________<br><br> </div> </div> <?php } ?> </div> </body> </html>
💾 Kaydet
İptal