Şuanki Dizin: /home/wwwdreamtechnolo/www/vahtuksanghatana.com/vahtuk_society/ |
Şuanki Dosya : /home/wwwdreamtechnolo/www/vahtuksanghatana.com/vahtuk_society/account_statement.php |
<?php require_once('lib/functions.php'); $db = new login_function(); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); if(!isset($_SESSION['current_login_admin'])) { header("Location:index.php"); } // if (isset($_POST['search'])) // { // $from_date = $_POST['order_id_from']; // $to_date = $_POST['order_id_to']; // $customer_id = $_POST['jamin_name']; // $loan_id = $_POST['loan_id']; // } $order_id_from = ""; $order_id_to = ""; $customer_id = ""; $loan_id = ""; $month = ""; if (isset($_POST['search'])) { $month = isset($_POST['months']) ? implode(", ", $_POST['months']) : ""; // Convert the selected months to a string $customer_id = $_POST['jamin_name']; if(isset($_POST['loan_id'])) { $loan_id = $_POST['loan_id']; } $_SESSION['filter_month'] = $month; $_SESSION['filter_customer_id'] = $customer_id; $_SESSION['filter_loan_id'] = $loan_id; } else if (isset($_POST['print_page'])) { // Handle the month as an array $month = isset($_POST['months']) ? implode(", ", $_POST['months']) : ""; // Convert the selected months to a string $customer_id = $_POST['customer_id']; $loan_id = $_POST['loan_id']; // Save the values to the session $_SESSION['filter_month'] = $month; $_SESSION['filter_customer_id'] = $customer_id; $_SESSION['filter_loan_id'] = $loan_id; // Redirect to the print page echo "<script>window.location.href = 'delivery_orders_print.php';</script>"; } // Retrieve values from the session if available else if (isset($_SESSION['filter_month'])) { $month = $_SESSION['filter_month']; // $order_id_from = $_SESSION['filter_order_id_from']; // $order_id_to = $_SESSION['filter_order_id_to']; $customer_id = $_SESSION['filter_customer_id']; $loan_id = $_SESSION['filter_loan_id']; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Passbook</title> <link rel="stylesheet" href="styles.css"> </head> <style type="text/css"> body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #fff; } .passbook { width: 30%; margin: 20px auto; border: 1px solid #ccc; padding: 20px; box-sizing: border-box; } .header { margin-bottom: 20px; text-align: center; /* Center-align for better layout on smaller screens */ position: relative; } .header h1 { color: red; font-size: 28px; margin: 0; font-weight: 800; } h2 { font-size: 18px; font-family: sans-serif; margin: 5px 0; font-weight: 200; color: black; } .details { display: flex; justify-content: space-between; margin-bottom: 20px; background-color: #d1e7d1; padding: 10px; flex-wrap: wrap; /* Allow wrapping for small screens */ } .logo { height:70px; border-radius:100px; width:70px; position:absolute; margin-left:20px; } .details h3 { margin: 0; font-size: 16px; flex: 1 1 50%; /* Each item takes 50% width on small screens */ text-align: center; /* Center-align text for a cleaner look */ } .number { color: red; font-weight: bold; } table { width: 100%; border-collapse: collapse; } table th, table td { border: 1px solid #ccc; text-align: center; font-size: 14px; padding:10px; padding: 4px; } table th { background-color: #185CD1; color: white; font-size: 16px; font-weight: bold; } .red-text { color: red; font-weight: bold; } .green-text { color: green; font-weight: bold; } /* Media Query for Mobile Devices */ @media (max-width: 768px) { .header h1 { font-size: 24px; } h2 { font-size: 16px; } .details { padding: 5px; } .details h3 { font-size: 14px; flex: 1 1 100%; /* Take full width on very small screens */ } table th, table td { font-size: 12px; padding: 8px; } } /* Media Query for Very Small Devices */ @media (max-width: 670px) { .header h1 { font-size: 20px; } .passbook{ width: 100%; } h2 { font-size: 14px; } .details h3 { font-size: 12px; } table th, table td { font-size: 10px; padding: 5px; } } .no-border { border: none; } .print_button { background-color: orangered; border: none; outline: none; height: 50px; width: 100px; font-size: 18px; color: white; font-weight: 800; border-radius: 4x; cursor: pointer; } @media print{ .print_button{ display: none; } .back{ display: none; } .passbook{ width: 70%; } .logo { height:100px; position:absolute; border-radius:100px; width:100px; margin-top :-10px; margin-left:40px; } } .back { font-size: 20px; font-weight: 800; color: orangered; text-decoration: underline; text-transform: capitalize; cursor: pointer; } </style> <body> <div class="passbook"> <img src="2121.jpeg" class="logo"> <div class="header"> <h1 >PASS-BOOK</h1> <h1 style="text-align:center; color:#333333;">MAHASANGH<br>BINVYAJI SOCIETY</h1> </div> <table border="1"> <thead> <tr style="background-color: #8F9651;"> <?php $name=$db->get_name_by_id($customer_id); $Loan_amount = $db->get_loadn_amount_for_account_stmt($customer_id, $loan_id); $loan_open_date = $db->get_loan_date_for_account_stmt($customer_id); ?> <th style="background-color: #8F9651;color: #7B0D1D;font-weight: 800;font-size: 19;text-transform: capitalize;" colspan="3"><?php echo $name; ?></th> <th style="background-color: #8F9651;color: #7B0D1D;font-weight: 800;font-size: 19;" colspan="2">Account Number : <?php echo $customer_id; ?></th> </tr> <?php if($Loan_amount>0) { ?> <tr> <td colspan="5" style="color:orangered !important; font-size:17px; padding:15px;">Loan Amount : Rs. <?php echo $Loan_amount; ?>/-</td> </tr> <?php } ?> </thead> <thead> <tr> <th>Month/Year</th> <th>Shares</th> <th>Loan Fed</th> <th>Balance Loan Amount</th> </tr> </thead> <?php $total_shares = 0; $current_loan_amount = 0; // $current_loan_amount = $Loan_amount; $total_paid_amount = 0; //Get registration date of sabhasad $registered_sabhasad_date = $db->get_registered_date_by_sabhasad_id($customer_id); $registration_date_data = explode("-",$registered_sabhasad_date); $reg_day = "01"; $reg_month = $registration_date_data[1]; $reg_year = $registration_date_data[0]; $current_month = date("m"); $current_year = date("Y"); //Calculate differnce months between two dates $date1 = $reg_year."-".$reg_month."-".$reg_day; $date2 = $current_year."-".$current_month."-".$reg_day; $ts1 = strtotime($date1); $ts2 = strtotime($date2); $year1 = date('Y', $ts1); $year2 = date('Y', $ts2); $month1 = date('m', $ts1); $month2 = date('m', $ts2); $months_diff = ((($year2 - $year1) * 12) + ($month2 - $month1)) + 1; for($month_count = 1; $month_count <= $months_diff; $month_count++) { //Current date got $current_statement_month = $date1; //Fetch all shares statement of this month $disp_registration_date_data = explode("-",$current_statement_month); $disp_reg_day = "01"; $disp_reg_month = $disp_registration_date_data[1]; $disp_reg_year = $disp_registration_date_data[0]; $current_statement_month_to_pass = $disp_reg_year."-".$disp_reg_month; //echo $loan_open_date; $display_month = ""; if($disp_reg_month=="01") { $display_month = "Jan"; } else if($disp_reg_month=="02") { $display_month = "Feb"; } else if($disp_reg_month=="03") { $display_month = "Mar"; } else if($disp_reg_month=="04") { $display_month = "Apr"; } else if($disp_reg_month=="05") { $display_month = "May"; } else if($disp_reg_month=="06") { $display_month = "Jun"; } else if($disp_reg_month=="07") { $display_month = "Jul"; } else if($disp_reg_month=="08") { $display_month = "Aug"; } else if($disp_reg_month=="09") { $display_month = "Sep"; } else if($disp_reg_month=="10") { $display_month = "Oct"; } else if($disp_reg_month=="11") { $display_month = "Nov"; } else if($disp_reg_month=="12") { $display_month = "Dec"; } $paid_amount_data = $db->get_paid_amount_history_of_users($customer_id,$loan_id,$current_statement_month_to_pass); if(!empty($paid_amount_data)) { foreach($paid_amount_data as $pay_record) { $res_id = $pay_record[0]; $sabhasad_id = $pay_record[1]; $payment_date = $pay_record[2]; $account_number = $pay_record[3]; $parvesh_fee = $pay_record[4]; $service_charge = $pay_record[5]; $shares = $pay_record[6]; $karj_hapta = $pay_record[7]; $farm_fee = $pay_record[8]; $vilamb_akar = $pay_record[9]; $res_date = $pay_record[10]; $res_time = $pay_record[11]; $total_shares = floatval($total_shares) + floatval($shares); $total_paid_amount = floatval($total_paid_amount) + floatval($karj_hapta); if($karj_hapta=="") { $karj_hapta = "-"; } $needle = $disp_reg_year."-".$disp_reg_month; if (strpos($loan_open_date,$needle) !== false) { $current_loan_amount = $Loan_amount; } ?> <tr> <td style="font-weight:600; background-color: <?php echo $record ? '#44D86F' : '#CF454A'; ?>;"><?php echo $display_month."-".$disp_reg_year; ?></td> <td style="font-weight:600; background-color: <?php echo $record ? '#44D86F' : '#CF454A'; ?>;"><?php echo $shares; ?></td> <td style="font-weight:600; background-color: <?php echo $record ? '#44D86F' : '#CF454A'; ?>;"><?php echo $karj_hapta; ?></td> <td style="font-weight:600; background-color: <?php echo $record ? '#44D86F' : '#CF454A'; ?>;"><?php echo $current_loan_amount = floatval($current_loan_amount) - floatval($karj_hapta); ?></td> </tr> <?php } } else { ?> <tr> <td style="font-weight:600; background-color: <?php echo $record ? '#44D86F' : '#CF454A'; ?>;"><?php echo $display_month."-".$disp_reg_year; ?></td> <td style="font-weight:600; background-color: <?php echo $record ? '#44D86F' : '#CF454A'; ?>;">-</td> <td style="font-weight:600; background-color: <?php echo $record ? '#44D86F' : '#CF454A'; ?>;">-</td> <td style="font-weight:600; background-color: <?php echo $record ? '#44D86F' : '#CF454A'; ?>;"><?php echo $current_loan_amount; ?></td> </tr> <?php } //Add 1 Month to current date $date1 = strtotime($date1); $date1 = date("Y-m-d", strtotime("+1 month", $date1)); } ?> <tr> <td style="font-weight:800">TOTAL</td> <td style="font-weight:800;color:green"><?php echo $total_shares; ?></td> <td style="font-weight:800"><?php echo $total_paid_amount; ?></td> <!--<td style="font-weight:800"><?php echo $total_loan_amount_fed; ?></td>--> <td style="font-weight:800" class="red-text"><?php echo $current_loan_amount; ?></td> </tr> <tr> <?php $jamin_id = $db->get_jamin_all_nameby_id_by_loan_id_and_sabhasad_id($customer_id, $loan_id); $jamin_name = ""; if ($jamin_id !== false && !empty($jamin_id)) { $jamin_name_str = implode(", ", $jamin_id); foreach ($jamin_id as $id) { $jamin_name = $db->fetch_jamin_names($id); } } ?> <td style="font-weight:800" colspan="6" style="align-item:justify;">जमीनदाराचे नाव <?php echo $jamin_name; ?></td> </tr> </table> </div> <center><button class="print_button" onclick="window.print();">Print</button></center> <br> <center><a class="back" href="dashboard.php">Back To Home</a></center> </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