Şuanki Dizin: /home/wwwdreamtechnolo/www/vahtuksanghatana.com/vahtuk_society/ |
Şuanki Dosya : /home/wwwdreamtechnolo/www/vahtuksanghatana.com/vahtuk_society/excel_report_download.php |
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); require_once('lib/functions.php'); $db = new login_function(); if(isset($_SESSION['current_login_admin'])) { $current_login_admin = $_SESSION['current_login_admin']; } if(!isset($_SESSION['current_login_admin'])) { header("location:index.php"); } $flag = 0; $amount_error=""; $success_msg =0; $expenses = ""; $amount = ""; if(isset($_POST['add_btn'])) { $expenses = $_POST['expenses']; $amount = $_POST['amount']; $added_by =$current_login_admin; $description = $_POST['description']; $title = $_POST['title']; if(!is_numeric($amount)) { $amount_error = "Please enter numeric Value"; $flag = 1; } if($flag==0) { $db->add_expenses_for_staff($expenses,$amount,$added_by,$description,$title); $success_msg = 1; } } if(isset($_GET['delete_id'])) { $del_id = $_GET['delete_id']; $db->delete_expenses_staff($del_id); $success_msg = 2; } $from_date=date("d-m-Y"); $to_date=date("d-m-Y"); $s_name=""; $loan_id=""; if(isset($_POST['search'])) { $s_name = $_POST['s_name']; $from_date = $_POST['from_date']; $to_date = $_POST['to_date']; $loan_id = $_POST['loan_id']; $_SESSION['filter_s_name'] = $s_name; $_SESSION['filter_from_date'] = $from_date; $_SESSION['filter_to_date'] = $to_date; $_SESSION['filter_loan_id'] = $loan_id; } else if(isset($_POST['search_page'])) { $s_name = $_POST['s_name']; $from_date = $_POST['from_date']; $to_date = $_POST['to_date']; $loan_id = $_POST['loan_id']; $_SESSION['filter_s_name'] = $s_name; $_SESSION['filter_from_date'] = $from_date; $_SESSION['filter_to_date'] = $to_date; $_SESSION['filter_loan_id'] = $loan_id; echo "<script>window.location.href = 'print_billing_report.php';</script>"; } else if(isset($_SESSION['filter_s_name'])) { $s_name = $_SESSION['filter_s_name']; $from_date = $_SESSION['filter_from_date']; $to_date = $_SESSION['filter_to_date']; $loan_id = $_SESSION['filter_loan_id']; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width initial-scale=1.0"> <title>FRENDDY FOODIES BILL</title> <!-- GLOBAL MAINLY STYLES--> <link href="css/bootstrap.min.css" rel="stylesheet" /> <link href="css/font-awesome.min.css" rel="stylesheet" /> <link href="css/line-awesome.min.css" rel="stylesheet" /> <link href="css/themify-icons.css" rel="stylesheet" /> <link href="css/animate.min.css" rel="stylesheet" /> <link href="css/toastr.min.css" rel="stylesheet" /> <link href="css/bootstrap-select.min.css" rel="stylesheet" /> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"> <!-- THEME STYLES--> <link href="css/main.min.css" rel="stylesheet" /> <link href="datatable/datatables.min.css" rel="stylesheet" /> <link href="css/animate.css" rel="stylesheet" type="text/css" media="all"> <script src="js/wow.min.js"></script> <style> .tbl-design { border:1px dashed #6BD089 !important; background:#C8EFD4; padding:7px; color:#B21016; font-weight:bold; margin:5px; font-size:13px; font-family:arial; display:inline-table; } .tbl-design:hover{ color:#000000; border:1px dashed #6BD089 !important; background:#005174; color:#FFFFFF; } .active_table { color:#000000; border:1px dashed #6BD089 !important; background:#005174; color:#FFFFFF; } .active_table_exist { background:orangered; } </style> </head> <body class="fixed-navbar"> <div class="page-wrapper" style="min-height:500px;"> <?php include('header.php'); ?> <?php include('side-bar.php'); ?> <div class="content-wrapper"> <div class="row" style="padding:0px; margin:0px; margin-top:15px; border-radius:15px;"> <?php if ($success_msg == 1) { ?> <div class="alert alert-success"> Expenses Added Successfully. </div> <?php } if ($success_msg == 2) { ?> <div class="alert alert-success"> Expenses Deleted Successfully. </div> <?php } ?> </div> <div class="ibox" style="border-radius:5px; padding:7px;"> <form class="form-pink" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" name="myForm" onsubmit="return validateForm()" autocomplete="off" enctype="multipart/form-data"> <div class="ibox-head"> <div class="ibox-title"><i class="fas fa-list" style="margin-right:10px;"></i>Excel Download Report</div> </div> <div class="ibox-body"> <div class="row"> <div class="col-sm-2 col-md-2 col-lg-2 form-group mb-6"> <label class="form-group mb-4 set-row label_marg"><b>From Date</b></label> <div class="input-group-icon input-group-icon-left set-row"> <span class="input-icon input-icon-left"><i class="fas fa-pen-square"></i></span> <input type="date" name="from_date" id="date_from" class="form-control form-control-air" value="<?php echo $from_date; ?>" placeholder="Enter Service" /> </div> </div> <div class="col-sm-3 col-md-3 col-lg-2 form-group mb-6"> <label class="form-group mb-4 set-row label_marg"><b>To Date</b></label> <div class="input-group-icon input-group-icon-left set-row"> <span class="input-icon input-icon-left"><i class="fas fa-pen-square"></i></span> <input type="date" name="to_date" id="date_to" class="form-control form-control-air" value="<?php echo $to_date; ?>" placeholder="Enter Service" /> </div> </div> <div class="col-sm-3 col-md-3 col-lg-3 form-group mb-6"> <label class="form-group mb-4 set-row label_marg"><b>Select sabhasad</b></label> <div class="input-group-icon input-group-icon-left set-row"> <select name="s_name" class="form-control form-control-air" id="main_category"> <option value="Select"> Select All </option> <?php $data = array(); $data = $db->get_all_sabhasad1(); $counter = 1; if(!empty($data)) { foreach($data as $record) { $id = $record[0]; $item_name = $record[1]; ?> <!-- <option value="<?php echo $id; ?>" ><?php echo $item_name; ?></option> --> <option value="<?php echo $id; ?>"<?php if($s_name==$id){ ?> selected <?php } ?>> <?php echo $item_name; ?></option> <?php } } ?> </select> </div> </div> <div class="col-sm-2 col-md-2 col-lg-2 form-group mb-6"> <label class="form-group mb-4 set-row label_marg"><b>Select Loan</b></label> <div class="input-group-icon input-group-icon-left set-row"> <span class="input-icon input-icon-left"><i class="fas fa-pen-square"></i></span> <select name="loan_id" class="form-control form-control-air" id="subcategory"> <option>Select Loan</option> </select> </div> </div> <div class="col-sm-3 col-md-3 col-lg-1 form-group mb-6" style="text-align:center; padding-left:10px; padding-right:0px; padding-top:24px;"> <button class="btn btn-pink btn-air" type="submit" name="search" style="width:100%;">Search</button> </div> <div class="col-sm-3 col-md-3 col-lg-1 form-group mb-6" style="text-align:center; padding-left:10px; padding-right:0px; padding-top:24px;"> <button id="downloadExcel" type="submit" name='export_data' class="btn btn-pink btn-air" value="Export to excel">Export to excel</button> </div> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script> $(document).ready(function() { $('#downloadExcel').click(function() { var tableData = []; $('.table tbody tr').each(function() { var rowData = []; $(this).find('td').each(function() { rowData.push($(this).text()); }); tableData.push(rowData); }); $.ajax({ url: 'excel_report_download.php', method: 'POST', data: { data: tableData }, success: function(response) { var blob = new Blob([response]); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = 'Mahasangh-Excel-Report.xls'; link.click(); } }); }); }); </script> <!-- <div class="col-sm-3 col-md-3 col-lg-1 form-group mb-6" style="text-align:center; padding-left:10px; padding-right:0px; padding-top:24px;"> <button class="btn btn-pink btn-air" type="submit" name="print" style="width:100%;">Print</button> </div> --> </div> </div> </form> <div class="page-content fade-in-up" style="min-height:800px ! Important;"> <div class="ibox" style="border-radius:5px; padding:7px;"> <div class="ibox-body" style="padding:7px; padding-top:0px;margin:20px;"> <div class="table-responsive" id="table_response" style="height:100%; width:100%; overflow:auto;"> <table class="table table-bordered table-hover" id="example" style="overflow-x:auto;overflow-y:auto;" cellpadding="0" cellspacing="0"> <thead class="thead-default thead-lg"> <tr> <th>Sr No</th> <th>नाव</th> <th>खाते क्र</th> <th>दिनांक</th> <!--<th>दिलेले कर्ज</th>--> <!--<th>Paid कर्ज</th>--> <th>प्रवेश फी</th> <th>सर्विस चार्ज</th> <th>शेअर्स</th> <th>कर्ज हप्ता</th> <th>फार्म फी</th> <th>विलंब आकार</th> <th>इतर फी</th> <th>इतर फी माहिती</th> <th>Entry Date</th> <th>Entry Time</th> </tr> </thead> <tbody> <?php $total_loan_given = 0; $total_of_paid_loan = 0; $total_shares = 0; $total_karj_hapta = 0; $total_of_pravesh_fee = 0; $total_of_svice_charge = 0; $total_of_farm_fee = 0; $total_of_vilamb_akar = 0; $total_of_other = 0; $individual_loan_total = 0; $individual_paid_loan_total = 0; $individual_shares_total = 0; $individual_karj_hapta_total = 0; $itotal_of_pravesh_fee = 0; $itota_of_svice_charge = 0; $itotal_of_farm_fee = 0; $itotal_of_vilamb_akar = 0; $itotal_of_other = 0; $itotal_of_loan=0; $itotal_of_paid_loan=0; $itotal_of_shares=0; $itotal_of_hapta=0; $irow_wise_coun=0; $ftotal_row_cunt=0; $previous_acc_no = null; $users_data = $db->get_loan_id_wise_for_search_excel($from_date, $to_date, $s_name, $loan_id); $processed_loans = []; if (!empty($users_data)) { $counter = 0; foreach ($users_data as $record) { $res_id = $record[0]; $sabhasad_id = $record[1]; $payment_date = $record[2]; $account_number = $record[3]; $parvesh_fee = $record[4]; $service_charge = $record[5]; $shares = $record[6]; $karj_hapta = $record[7]; $farm_fee = $record[8]; $vilamb_akar = $record[9]; $res_date = $record[10]; $res_time = $record[11]; $other = $record[12]; $other_desc = $record[13]; $loan_id = $record[14]; $name = $db->get_name_by_id($sabhasad_id); $mobile_no = $db->get_mobile_by_id($sabhasad_id); $aadhar_no = $db->get_adhaar_by_id($sabhasad_id); $paid_loan = $db->get_paid_loan_amount($sabhasad_id, $res_id); $Loan_amount = $db->get_loadn_amount_for_account_stmt($sabhasad_id, $loan_id); // echo "!!".$loan_id."<br>"; if (in_array($loan_id, $processed_loans)) { $Loan_amount = ""; } else { $processed_loans[] = $loan_id; // print_r( $processed_loans); } if ($previous_acc_no !== null && $account_number !== $previous_acc_no) { ?> <tr class="individual-total"> <td colspan="4" style="font-weight:800; text-align:center;">Total for Account: <?php echo $previous_acc_no; ?></td> <!--<td style="font-weight:800;"><?php echo $individual_loan_total; ?></td>--> <!--<td style="font-weight:800;"><?php echo $individual_paid_loan_total; ?></td>--> <td style="font-weight:800;"><?php echo $itotal_of_pravesh_fee; ?></td> <td style="font-weight:800;"><?php echo $itota_of_svice_charge; ?></td> <td style="font-weight:800;"><?php echo $individual_shares_total; ?></td> <td style="font-weight:800;"><?php echo $individual_karj_hapta_total; ?></td> <td style="font-weight:800;"><?php echo $itotal_of_farm_fee; ?></td> <td style="font-weight:800;" colspan="3"><?php echo $itotal_of_vilamb_akar; ?></td> <td style="font-weight:800;" colspan="2">Total : <?php echo $irow_wise_coun; ?></td> <td colspan="6"></td> </tr> <?php $individual_loan_total = 0; $individual_paid_loan_total = 0; $individual_shares_total = 0; $individual_karj_hapta_total = 0; $itotal_of_pravesh_fee = 0; $itota_of_svice_charge = 0; $itotal_of_farm_fee = 0; $itotal_of_vilamb_akar = 0; $itotal_of_other = 0; $itotal_of_loan=0; $itotal_of_paid_loan=0; $itotal_of_shares=0; $itotal_of_hapta=0; } $individual_loan_total += floatval($Loan_amount); $individual_paid_loan_total += floatval($paid_loan); $individual_shares_total += floatval($shares); $individual_karj_hapta_total += floatval($karj_hapta); $itotal_of_loan+= floatval($Loan_amount); $itotal_of_paid_loan+= floatval($paid_loan); $itotal_of_pravesh_fee += floatval($parvesh_fee); $itota_of_svice_charge += floatval($service_charge); $itotal_of_farm_fee += floatval($farm_fee); $itotal_of_vilamb_akar += floatval($vilamb_akar); $itotal_of_other += floatval($other); $itotal_of_shares += floatval($shares); $itotal_of_hapta += floatval($karj_hapta); $total_loan_given += floatval($Loan_amount); $total_of_paid_loan += floatval($paid_loan); $total_shares += floatval($shares); $total_karj_hapta += floatval($karj_hapta); $total_of_pravesh_fee += floatval($parvesh_fee); $total_of_svice_charge += floatval($service_charge); $total_of_farm_fee += floatval($farm_fee); $total_of_vilamb_akar += floatval($vilamb_akar); $total_of_other += floatval($other); $ftotal_row_cunt=$total_of_pravesh_fee+ $total_of_svice_charge+ $total_of_farm_fee+$total_of_vilamb_akar+$total_of_other+$total_of_paid_loan+ $total_shares+ $total_karj_hapta ; $irow_wise_coun=$itotal_of_paid_loan+$itotal_of_pravesh_fee+$itota_of_svice_charge+$itotal_of_farm_fee+$itotal_of_vilamb_akar+$itotal_of_other+ $itotal_of_shares+$itotal_of_hapta; $ftotal_row_cunt1=$ftotal_row_cunt; ?> <tr class="odd gradeX"> <td><?php echo $counter + 1; ?></td> <td><?php echo $name; ?></td> <td><?php echo $sabhasad_id; ?></td> <td><?php echo $payment_date; ?></td> <!--<td><?php echo $Loan_amount; ?></td>--> <!--<td><?php echo $paid_loan; ?></td>--> <td><?php echo $parvesh_fee; ?></td> <td><?php echo $service_charge; ?></td> <td><?php echo $shares; ?></td> <td><?php echo $karj_hapta; ?></td> <td><?php echo $farm_fee; ?></td> <td><?php echo $vilamb_akar; ?></td> <td><?php echo $other; ?></td> <td><?php echo $other_desc; ?></td> <td><?php echo $res_date; ?></td> <td><?php echo $res_time; ?></td> </tr> <?php $previous_acc_no = $account_number; $counter++; } if ($previous_acc_no !== null) { ?> <tr class="individual-total"> <td colspan="4" style="font-weight:800; text-align:center;">Total for Account: <?php echo $previous_acc_no; ?></td> <!--<td style="font-weight:800;"><?php echo $individual_loan_total; ?></td>--> <!--<td style="font-weight:800;"><?php echo $individual_paid_loan_total; ?></td>--> <td style="font-weight:800;"><?php echo $itotal_of_pravesh_fee; ?></td> <td style="font-weight:800;"><?php echo $itota_of_svice_charge; ?></td> <td style="font-weight:800;"><?php echo $individual_shares_total; ?></td> <td style="font-weight:800;"><?php echo $individual_karj_hapta_total; ?></td> <td style="font-weight:800;"><?php echo $itotal_of_farm_fee; ?></td> <td style="font-weight:800;" colspan="3"><?php echo $itotal_of_vilamb_akar; ?></td> <td style="font-weight:800;" colspan="2">Total : <?php echo $irow_wise_coun; ?></td> <td colspan="6"></td> </tr> <?php } ?> <tr> <td colspan="4" style="font-weight:800; text-align:center;">GRAND TOTAL</td> <!--<td style="font-weight:800"><?php echo $total_loan_given; ?></td>--> <!--<td style="font-weight:800"><?php echo $total_of_paid_loan; ?></td>--> <td style="font-weight:800;"><?php echo $total_of_pravesh_fee; ?></td> <td style="font-weight:800;"><?php echo $total_of_svice_charge; ?></td> <td style="font-weight:800"><?php echo $total_shares; ?></td> <td style="font-weight:800"><?php echo $total_karj_hapta; ?></td> <td style="font-weight:800;"><?php echo $total_of_farm_fee; ?></td> <td style="font-weight:800;" colspan="3"><?php echo $total_of_vilamb_akar; ?></td> <td style="font-weight:800;" colspan="2"> Total : <?php echo $ftotal_row_cunt1; ?></td> <td colspan="6"></td> </tr> <?php } ?> </tbody> </table> </div> <!--<div class="col-sm-6 col-md-6 col-lg-6 form-group mb-6"> <label class="form-group mb-4 set-row label_marg"><b></b></label> <br /> <br /> <label style="font-size:18px; font-weight:bold; margin-right:100px;"><input type="checkbox" name="bill_type" value="gst" class="gst_check" style="width:20px; height:20px; margin-right:10px;">GST BILL </label> </div>--> </div> </div> </div> </div> <?php include('footer.php'); ?> <?php //include('search.php'); ?> <div class="sidenav-backdrop backdrop"></div> <div class="preloader-backdrop"> <div class="page-preloader">Loading</div> </div> <script src="js/jquery.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/metisMenu.min.js"></script> <script src="js/jquery.slimscroll.min.js"></script> <script src="js/idle-timer.min.js"></script> <script src="js/toastr.min.js"></script> <script src="js/jquery.validate.min.js"></script> <script src="js/bootstrap-select.min.js"></script> <script src="datatable/datatables.min.js"></script> <script src="js/app.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#service_name1').on('change', function() { //alert(service_name1); var product_name_val = this.value; //alert(product_name_val); $.ajax({ url: "api/food-product-price.php", type: "POST", data: { product_id_val: product_name_val }, cache: false, success: function(result){ $("#single_price").val(result); } }); }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $("#quantity_txt").keyup(function(){ var single_price = $("#single_price").val(); var current_quantity = $("#quantity_txt").val(); $("#actual_amount1").val(parseFloat(single_price) * parseFloat(current_quantity)); }); }); </script> <script> $(function() { $('#example').DataTable({ pageLength: 100, fixedHeader: true, responsive: true, "sDom": 'rtip', columnDefs: [{ targets: 'no-sort', orderable: false }] }); var table = $('#example').DataTable(); $('#key-search').on('keyup', function() { table.search(this.value).draw(); }); }); </script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#main_category').on('change', function() { var selected_main_category = $('#main_category').val(); console.log("Selected Main Category: " + selected_main_category); // alert("Selected Main Category: " + selected_main_category); if (selected_main_category !== "") { $.ajax({ type: "POST", data: {'selected_main_category': selected_main_category}, url: "api/load_loan.php", success: function(data) { // alert(data); $("#subcategory").find('option').remove(); var data_new = JSON.parse(data); $("#amount").val(''); $("#subcategory").append("<option value=''>Select Subcategory</option>"); if (data_new.length > 0) { for (var i = 0; i < data_new.length; i++) { $("#subcategory").append("<option value='" + data_new[i][0] + "'>" + data_new[i][2] + "</option>"); } } else { $("#subcategory").append("<option value=''>No Subcategories Found</option>"); } }, error: function(xhr, status, error) { // alert("Error: " + error); } }); } else { $("#subcategory").find('option').remove(); $("#subcategory").append("<option value=''>Select Subcategory</option>"); } }); }); </script> <!-- PAGE LEVEL SCRIPTS--> </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