ok
Direktori : /home2/selectio/www/subamangala/admin/ui-api/ |
Current File : /home2/selectio/www/subamangala/admin/ui-api/tickets-grand-total-api.php |
<?php ob_start(); session_start(); include "../config/config.php"; $conditions=""; if(isset($_POST['seat_blocking']) && $_POST['seat_blocking']=="seat_blocking" && $_POST['seat_blocking']!=''){ $conditions.=" and tbl_tickets.block_seats=1"; } if($_SESSION['tn_trans_connect']['usertype_id']==1 || $_SESSION['tn_trans_connect']['id']==1){ if(isset($_POST['bus_id']) && $_POST['bus_id']!=0 && $_POST['bus_id']!=''){ $conditions.=" and b.bus_id=".$_POST['bus_id']; } }else if($_SESSION['tn_trans_connect']['usertype_id']==2){ $conditions.=" and b.created_by=".$_SESSION['tn_trans_connect']['id']; }else if($_SESSION['tn_trans_connect']['usertype_id']==3){ $conditions.=" and b.bus_id in (".$_SESSION['tn_trans_connect']['bus_code'].")"; } if(isset($_POST['trip_id']) && $_POST['trip_id']!=0 && $_POST['trip_id']!=''){ $conditions.=" and b.trip_id=".$_POST['trip_id']; } if(isset($_POST['trip_date']) && $_POST['trip_date']!=0 && $_POST['trip_date']!=''){ $conditions.=" and b.trip_date='".$_POST['trip_date']."'"; } if(isset($_POST['trip_status']) && $_POST['trip_status']!=0 && $_POST['trip_status']!=''){ $conditions.=" and b.trip_status=".$_POST['trip_status']; } if(isset($_POST['pnr_number']) && $_POST['pnr_number']!=0 && $_POST['pnr_number']!=''){ $conditions.=" and b.pnr_number='".$_POST['pnr_number']."'"; } if(isset($_POST['booking_status']) && $_POST['booking_status']!=''){ $conditions.=" and tbl_tickets.status='".$_POST['booking_status']."'"; } if(isset($_POST['booking_source']) && $_POST['booking_source']!=0 && $_POST['booking_source']!=''){ $conditions.=" and b.source='".$_POST['booking_source']."'"; } if(isset($_POST['booking_users']) && $_POST['booking_users']!=''){ $conditions.=" and b.created_by='".$_POST['booking_users']."'"; } if(isset($_POST['pickup_city']) && $_POST['pickup_city']!=0 && $_POST['pickup_city']!=''){ $conditions.=" and b.from_city='".$_POST['pickup_city']."'"; } if(isset($_POST['drop_city']) && $_POST['drop_city']!=0 && $_POST['drop_city']!=''){ $conditions.=" and b.to_city='".$_POST['drop_city']."'"; } if(isset($_POST['gender']) && $_POST['gender']!=''){ $conditions.=" and tbl_tickets.gender='".$_POST['gender']."'"; } $statement = $pdo->prepare("SELECT SUM(b.amount) as tickets_amount FROM tbl_tickets b where 1=1 $conditions"); $statement->execute(); $emp_data = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); foreach ($emp_data as $data){ ?> <div class="row"> <div class="col-md-4"> <button class="btn btn-success btn-lg" style="width: 100%;"><span><?php echo "Grand Total - <i class='fa fa-inr'></i> " . $data['tickets_amount'] ;?></span></button> </div> </div> <?php } ?>