Viewing file: print_fees_receipt.php (5.89 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) */ $link = mysqli_connect("localhost", "itce_user", "rb!itc838", "itce_data"); // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); }
$var = $_GET['ID']; // Attempt select query execution $sql = "SELECT * FROM monthly_fees where ID='$var'"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_array($result)){ $studentid= $row['student_id'] ; $name= $row['student_name'] ; $std_mobile= $row['student_mobile1'].','.$row['student_mobile2'] ; $feesamount=$row['paid_fees']; $fees_deposit_date=$row['payment_date']; $fees_month= $row['fees_month'] ; $fees_year= $row['fees_year'] ; $total_present_days= $row['total_present_days'] ;
} // 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); ?> <?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ $link = mysqli_connect("localhost", "itce_user", "rb!itc838", "itce_data"); // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); }
// Attempt select query execution $sql = "SELECT * FROM admission where enrollment='$studentid'"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_array($result)){ $course= $row['course'] ;
} // 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); ?> <br><br> <style> body { font-family: 'Arial', sans-serif; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; height: 100vh; }
.receipt { width: 500px; height: 600px; padding: 20px; border: 2px solid #333; /* Border effect */ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); background-color: #fff; color: #333; text-align: left; position: relative; }
.logo { max-width: 80px; max-height: 80px; margin: 0 auto 20px; /* Center the logo horizontally and add margin below */ display: block; /* Ensure the logo is a block element */ }
.header { font-size: 24px; margin-bottom: 20px; color: #007BFF; }
.content { font-size: 18px; margin-bottom: 20px; }
.print-button { text-align: center; margin-top: 20px; }
/* Additional styling for a clean and professional look */ p { margin: 8px 0; }
strong { font-weight: bold; }
hr { border: 1px solid #ddd; margin: 20px 0; }
/* Print styles */ @media print { body * { visibility: hidden; }
.receipt, .receipt * { visibility: visible; }
.receipt { position: absolute; left: 0; top: 0; } } </style> </head> <body> <div class="receipt" id="printableReceipt"> <img class="logo" src="images/logo.jpg" alt="Logo"> <div class="header"><center>ITCE STUDENT FEES RECEIPT</center></div> <div class="content"> <p><strong>Student ID:</strong><?php echo $studentid ?></p> <p><strong>Student Name:</strong> <?php echo $name ?></p> <p><strong>Course:</strong><?php echo $course ?></p> <p><strong>Paid Fees:</strong><?php echo $feesamount ?>Rs.</p> <p><strong>Payment Date:</strong> <?php echo $fees_deposit_date ?></p> <p><strong>Mobile :</strong> <?php echo $std_mobile ?></p> <p><strong>Total Present Days:</strong> <?php echo $total_present_days ?></p> <hr> <p><strong>Total Amount Paid:</strong> <?php echo $feesamount ?>Rs.</p> </div> </div>
<div class="print-button"> <button onclick="printReceipt()">Print</button> </div>
<script> function printReceipt() { window.print(); } </script> </body> </html>
</main><!-- End #main --> <br> <?php include 'footerr.php';?>
</body>
</html>
|