Şuanki Dizin: /home/wwwdreamtechnolo/www/vahtuksanghatana.com/ssociety-7-12-2024/ |
Şuanki Dosya : /home/wwwdreamtechnolo/www/vahtuksanghatana.com/ssociety-7-12-2024/view_pavati.php |
<?php require_once('lib/functions.php'); $db = new login_function(); if(isset($_GET['pavati_id'])) { $pavati_id = $_GET['pavati_id']; $_SESSION['pavati_id'] = $pavati_id; // echo $pavati_id; } else if(isset($_SESSION['pavati_id'])) { echo $pavati_id = $_SESSION['pavati_id']; } if (isset($_GET['res_id'])) { $res_id = $_GET['res_id']; $_SESSION['res_id'] = $res_id; // Store in session for future requests } else if (isset($_SESSION['res_id'])) { // Otherwise, check if 'res_id' is set in session $res_id = $_SESSION['res_id']; } $total_shares = 0; $users_data = array(); $users_data = $db->get_payment_id_wise($res_id); if (!empty($users_data)) { foreach ($users_data as $record) { // Extract values from the current record $res_id = $record[0]; $sabhasad_id = $record[1]; $payment_date = $record[2]; $accont_number = $record[3]; $parvesh_fee = $record[4]; $service_charge = $record[5]; $shares1 = $record[6]; $karj_hapta = $record[7]; $farm_fee = $record[8]; $vilamb_akar = $record[9]; $res_date = $record[10]; $res_time = $record[11]; // Accumulate shares into total_shares $total_shares += floatval($shares1); // Use += to add the shares1 to the total_shares // Optional: Output the name of the person based on sabhasad_id $name = $db->get_name_by_id($sabhasad_id); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Receipt Design</title> <style> body { font-family: 'Arial', sans-serif; margin: 0; padding: 0; background-color: #fff; } .receipt-container { width: 600px; margin: 20px auto; background: #fff; border: 1px solid #000; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .header { text-align: center; margin-bottom: 20px; } .header p { margin: 5px 0; } .header h1 { font-size: 22px; margin: 5px 0; } .header h2 { font-size: 18px; margin: 5px 0; } .header h3 { font-size: 16px; margin: 5px 0; } .info-section { margin-bottom: 20px; font-size: 16px; } .info-section div { margin: 5px 0; } .info-section span { display: inline-block; width: 150px; } .table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } .table th, .table td { border: 1px solid #000; text-align: left; padding: 5px; font-size: 14px; } .table th { text-align: center; text-transform: capitalize; font-weight: bold; } .footer { font-size: 16px; } .footer div { text-transform: capitalize; margin: 10px 0; } .footer .signature { text-align: right; } .print_button { width: 150px; height: 40px; background-color: bisque; border: 3px solid #000; cursor: pointer; border-radius: 8px; } </style> </head> <body> <?php function numToWordsRec($number) { $words = array( 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' ); if ($number < 20) { return $words[$number]; } if ($number < 100) { return $words[10 * floor($number / 10)] . ' ' . $words[$number % 10]; } if ($number < 1000) { return $words[floor($number / 100)] . ' hundred ' . numToWordsRec($number % 100); } if ($number < 1000000) { return numToWordsRec(floor($number / 1000)) . ' thousand ' . numToWordsRec($number % 1000); } return numToWordsRec(floor($number / 1000000)) . ' million ' . numToWordsRec($number % 1000000); } $users_data1 = array(); $users_data1 = $db->get_payment_details_for_pavati($pavati_id); if (!empty($users_data1)) { $counter = 0; $counter1 = 1; foreach ($users_data1 as $record) { $res_id = $users_data1[$counter][0]; $sabhasad_id = $users_data1[$counter][1]; $payment_date = $users_data1[$counter][2]; $accont_number = $users_data1[$counter][3]; $parvesh_fee = $users_data1[$counter][4]; $service_charge = $users_data1[$counter][5]; $shares = $users_data1[$counter][6]; $karj_hapta = $users_data1[$counter][7]; $farm_fee = $users_data1[$counter][8]; $vilamb_akar = $users_data1[$counter][9]; $res_date = $users_data1[$counter][10]; $res_time = $users_data1[$counter][11]; $other1 = $users_data1[$counter][12]; $other_desc = $users_data1[$counter][13]; $formatted_payment = date('d/m/Y', strtotime($payment_date)); $name = $db->get_name_by_id($sabhasad_id); $total_amount = floatval($parvesh_fee) + floatval($service_charge) + floatval($shares) + floatval($karj_hapta) + floatval($farm_fee) + floatval($vilamb_akar)+ floatval($other1); $total_amount_in_words = numToWordsRec($total_amount); ?> <div class="receipt-container"> <div class="header"> <p style="float:left;"><strong>Reg. No. PN/5173</strong></p> <p style="float:right;font-weight: 19px"><strong>पावती नं. <?php echo $res_id; ?></strong></p><br> <h4 style="margin-left: -420px !important; width: 1500px; margin: 0px; margin-top: 20px; font-weight: 800; font-size: 34px;font-family: Yatra One, system-ui;">वाहतुक संघटना संयुक्त महासंघ<span style="font-size:20px"> महाराष्ट्र राज्य</span></h4> <h2>महासंघ बिनव्याजी सोसायटी</h2> <p>३२/९ डी, मौलाली चौक, दक्षिण सदर बाजार, सोलापूर.</p> </div> <hr> <div class="info-section"> <div><span>नाव:</span><span style="margin-left:-110px"> <?php echo $name; ?> </span></div> <div style="display: flex;"> <div style="margin-left: 0px;"><span >दिनांक:</span> <span style="margin-left:-96px"><?php echo $formatted_payment; ?></span></div> <div style="margin-left: 50px;"><span>खाते नं.:</span> <span style="border:1px solid black;margin-left: -100px;height:20px;border-radius: 4px;text-align:center;font-weight: 800"><?php echo $accont_number; ?></span></div> </div> </div> <table class="table"> <thead> <tr> <th>नं.</th> <th>तपशील</th> <th>रुपये</th> </tr> </thead> <tbody> <?php if ($parvesh_fee >= 0): ?> <tr> <td style=" text-align: center;"><?php echo $counter1 ++; ?></td> <td>प्रवेश फी</td> <td style=" text-align: center;"><?php echo $parvesh_fee; ?></td> </tr> <?php endif; ?> <?php if ($service_charge >= 0): ?> <tr> <td style=" text-align: center;"><?php echo $counter1 ++; ?></td> <td>सर्व्हिस चार्ज</td> <td style=" text-align: center;"><?php echo $service_charge; ?></td> </tr> <?php endif; ?> <?php if ($shares >= 0): ?> <tr> <td style=" text-align: center;"><?php echo $counter1 ++; ?></td> <td>शेअर्स</td> <td style=" text-align: center;"><?php echo $shares; ?></td> </tr> <?php endif; ?> <?php if ($karj_hapta >= 0): ?> <tr> <td style=" text-align: center;"><?php echo $counter1 ++; ?></td> <td>कर्ज हप्ता</td> <td style=" text-align: center;"><?php echo $karj_hapta; ?></td> </tr> <?php endif; ?> <?php if ($farm_fee >= 0): ?> <tr> <td style=" text-align: center;"><?php echo $counter1 ++; ?></td> <td>फार्म फी</td> <td style=" text-align: center;"><?php echo $farm_fee; ?></td> </tr> <?php endif; ?> <?php if ($vilamb_akar >= 0): ?> <tr> <td style=" text-align: center;"><?php echo $counter1 ++; ?></td> <td>विलंब आकार</td> <td style=" text-align: center;"><?php echo $vilamb_akar; ?></td> </tr> <?php endif; ?> <?php if ($other1 >= 0): ?> <tr> <td style=" text-align: center;"><?php echo $counter1 ++; ?></td> <td>इतर - (<?php echo $other_desc; ?>)</td> <td style=" text-align: center;"><?php echo $other1; ?></td> </tr> <?php endif; ?> <tr> <td></td> <td style="font-weight: 800;font-size: 16px;">एकूण</td> <td style="font-weight: 800;font-size: 16px;text-align: center;"><?php echo $total_amount; ?></td> </tr> </tbody> </table> <div class="footer"> <div>येणे बाकी : ___________</div> <div>एकूण शेअर्स: <?php echo $total_shares; ?></div> <div>अक्षरी रुपये: <?php echo $total_amount_in_words; ?> रुपये रोक मिळाले.</div> <div class="signature">खजिनदार / सचिव</div> </div> </div> <?php $counter++; } } ?> <center><button class="print_button" onclick="printReceipt()">Print Receipt</button></center> <script> function printReceipt() { document.querySelector('button').style.display = 'none'; window.print(); } window.onafterprint = function() { location.reload(); }; </script> </body> </html>
Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4