Şuanki Dizin: /home/wwwdreamtechnolo/www/vahtuksanghatana.com/admin/ |
Şuanki Dosya : /home/wwwdreamtechnolo/www/vahtuksanghatana.com/admin/excel-print-vehical-report.php |
<?php require_once("lib/function.php"); $db = new login_function(); $flag = 0; $success_msg = 0; $from_date_v =date("d-m-Y"); $to_date_v =date("d-m-Y"); $vaehical_no =""; ob_start(); if(!isset($_SESSION['current_login_admin'])) { header("Location:/admin/index.php"); } if(isset($_SESSION['current_login_admin'])) { $email = $_SESSION['current_login_admin']; } if(isset($_SESSION['from_date_v'])) { $from_date_v = $_SESSION['from_date_v']; $to_date_v = $_SESSION['to_date_v']; $vehical_no = $_SESSION['vehical_no']; } ?> <style> .col-md-12 { width:100%; margin:auto; margin-top:20px; } table,th,td { text-align:center; text-transform:uppercase; border:1px solid grey; } </style> <style> .col-md-12 { width:100%; margin:auto; margin-top:20px; } table,th,td { text-align:center; text-transform:uppercase; border:1px solid grey; } .col-md-12 { width:100%; margin:auto; margin-top:20px; } table,th { text-align:center; border:1px solid grey; //text-transform:uppercase; } table,td { text-align:center; border:1px solid grey; //text-transform:uppercase; font-size:13px; } @media only screen and (max-width: 600px) { .col-md-12 { width:100%; } .alert { width:100%; } .side-row { width:49%; display:inline-table; } } .my-custom-scrollbar { position: relative; height: 300px; overflow: auto; } .table-wrapper-scroll-y { display: block; } .main_head { width:1000px; margin:auto; font-size:14px; padding:10px; padding-top:0px; box-shadow:0px 0px 5px 1px #DFDFDF; border:1px solid #CCCCCC; } .main_head>h1,h2,h4,h6 { text-align:center; margin:5px; } .sub_head { border-bottom:1px dashed #CCCCCC; background-color:#FCFCFC; text-align:center; margin-bottom:8px; padding-top:2px; padding-bottom:10px; position:relative; line-height:40px; } .logo { position: absolute; left:50px; top:11px; height:70px; width:70px; border-radius:40px; } body { font-family:cambria; background-color:white; } label { text-align:left; font-size:16px; font-weight:bold; margin:4px; } .sub_txtline { font-size:14px; font-weight:bold; line-height:25px; font-family:cambria; font-weight:bold; } h6 { font-size:16px !important; } thead { background-color:#efefef; font-size:13px; } .table-bordered td, .table-bordered th { border: 1px solid grey; -webkit-print-color-adjust: exact; } .link { background-color:#208F86 !important; font-size:17px; font-family:cambria; color:#FFFFFF; padding:10px; border-radius:10px; font-weight:bold; border:1px solid #666; margin-top:15px; text-transform:Uppercase; } .table td, .table th { padding: .5rem; vertical-align: top; border-top: 1px solid #e9ecef; } </style> <meta charset="UTF-8"> <body style="background-color:white;"> <div class="main_head"> <div class="sub_head"> <img src="images/logo.png" style="float:left!important; margin-left:20px; margin-top:10px;"> <h1 style="margin-bottom:10px;margin-top:25px; font-weight:bold; font-size:25px; line-height:25px; margin-top:15px;">VAHATUK SANGHATANA</h1> <div style="font-size:14px; text-align:center; width:100%; line-height:20px;"><p><b> Vehical Report</b><br /> <b>Report From : <?php echo $from_date_v; ?> To : <?php echo $to_date_v; ?></b></p></div> </div> <div> <h2> <center>Vehical Report</center> </h2> </div> <table class="table table-bordered table-hover" id="example" style="overflow-x:auto;overflow-y:auto; width:100%!important;" cellpadding=0 cellspacing=0> <thead> <tr style="text-align:center;"> <th>Sr No</th> <th>Vehical No</th> <th>Driving Licence Expiry</th> <th>Fitness Upto Date</th> <th>Insurance Expiry</th> <th>PUC Expiry</th> <th>Permit Expiry</th> <th>Other1</th> <th>Other2</th> <th>images</th> <th>Date</th> <th>Time</th> </tr> </thead> <tbody> <?php $users_data = array (); $users_data = $db-> get_all_vehical_entry($from_date_v,$to_date_v,$vehical_no); if(!empty($users_data)) { $counter =0; foreach($users_data as $record) { $res_id = $users_data[$counter][0]; $res_veh_no = $users_data[$counter][1]; $res_name = $users_data[$counter][2]; $res_mobile_number = $users_data[$counter][3]; $res_address = $users_data[$counter][4]; $res_fitness_upto_date = $users_data[$counter][5]; $res_lic_expiry = $users_data[$counter][6]; $res_insurance_expiry = $users_data[$counter][7]; $res_puc_expiry = $users_data[$counter][8]; $res_permit_expiry =$users_data[$counter][9]; $res_other_1 = $users_data[$counter][10]; $res_other_2 = $users_data[$counter][11]; $res_image = $users_data[$counter][12]; $res_date = $users_data[$counter][13]; $res_time = $users_data[$counter][14]; ?> <tr class="odd gradeX"> <td><?php echo$counter+1;?></td> <td><?php echo$res_veh_no;?></td> <!--<td><?php echo$res_name; ?></td> <td><?php echo$res_mobile_number;?></td> <td><?php echo$res_address;?></td>--> <td><?php echo $res_fitness_upto_date ;?></td> <td><?php echo $res_lic_expiry ;?></td> <td><?php echo $res_insurance_expiry;?></td> <td><?php echo$res_puc_expiry;?></td> <td ><?php echo$res_permit_expiry;?></td> <td ><?php echo$res_other_1;?></td> <td ><?php echo$res_other_2;?></td> <td><?php echo$res_image;?></td> <td><?php echo$res_date;?></td> <td><?php echo$res_time;?></td> </tr> <?php $counter++; } } else { ?> <td colspan="11">No Data Found..</td> <?php } ?> </tbody> </table> <?php if(isset($_GET['excel'])) { $excelData = ""; $filename = "users_report_".date('Y-m-d') . ".xls"; header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=\"$filename\""); //header("Content-Type: text/csv"); //header("Content-Disposition: attachment; filename=$filename.csv"); $show_coloumn = false; if(!empty($std_data)) { foreach($std_data as $record) { if(!$show_coloumn) { // display field/column names in first row echo $excelData = implode("\t", array_keys($record)) . "\n"; $show_coloumn = true; } echo $excelData = implode("\t", array_values($record)) . "\n"; } } exit; } else if(isset($_GET['print'])) { ?> <script> window.print(); </script> <?php } ?> </div> </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