File: //home/cafsindia/allyindian_com/sbltt/dashboard/admin_call.php
<?php
require ("../app/dbconnect.php");
$dbconnect = new dbconnect;
$db = $dbconnect->connect();
$frm = $_POST['frm'];
//Enquire follow
if($frm === "get_enquire_follow"){
$cur_month = $_POST['cur_month'];
$enquire_info = mysql_query("SELECT ncd,customer_name,phone_number,alt_number,cust_email,cust_address,from_date,to_date,frm.city_name as frm_city_name, des.city_name as to_city_name,cust_type,trip_type FROM sblt_enquiry INNER JOIN sblt_customers on sblt_customers.cust_id = sblt_enquiry.cust_id INNER JOIN sblt_city frm on frm.city_id = sblt_enquiry.orgin INNER JOIN sblt_city des on des.city_id = sblt_enquiry.destination WHERE sblt_enquiry.status = '1' and sblt_enquiry.enquiry_sts = '1' and sblt_enquiry.created_date like '$cur_month%'");
$tr_line = "";
$count = 0;
while($enquire_info_rslt = mysql_fetch_array($enquire_info)){
$count++;
$customer_name = $enquire_info_rslt['customer_name'];
$phone_number = $enquire_info_rslt['phone_number'];
$alt_number = $enquire_info_rslt['alt_number'];
$cust_email = $enquire_info_rslt['cust_email'];
$cust_address = $enquire_info_rslt['cust_address'];
$from_date = date('d-m-Y', strtotime($enquire_info_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($enquire_info_rslt['to_date']));
$origin = $enquire_info_rslt['frm_city_name'];
$destination = $enquire_info_rslt['to_city_name'];
$cust_type = $enquire_info_rslt['cust_type'];
$trip_type = $enquire_info_rslt['trip_type'];
$ncd = date('d-m-Y', strtotime($enquire_info_rslt['ncd']));
if(!$cust_type)
{
$cust_type = "-";
}
if($cust_type=="1")
{
$cust_type = "Aggregate";
}
if($cust_type=="2")
{
$cust_type = "Corporate";
}
if($cust_type=="3")
{
$cust_type = "Individual";
}
if($cust_type=="4")
{
$cust_type = "Package";
}
if($cust_type=="5")
{
$cust_type = "Travel Agent";
}
if(!$trip_type)
{
$trip_type = "-";
}
if($trip_type=="1")
{
$trip_type = "Airport";
}
if($trip_type=="2")
{
$trip_type = "City Use";
}
if($trip_type=="3")
{
$trip_type = "Event";
}
if($trip_type=="4")
{
$trip_type = "Local";
}
if($trip_type=="5")
{
$trip_type = "Out Station";
}
if($trip_type=="6")
{
$trip_type = "Package";
}
if($trip_type=="7")
{
$trip_type = "SBLE";
}
if($trip_type=="8")
{
$trip_type = "Station";
}
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name</td>
<td>$phone_number</td>
<td>$alt_number</td>
<td>$cust_email</td>
<td>$cust_address</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$origin</td>
<td>$destination</td>
<td>$cust_type</td>
<td>$trip_type</td>
<td style='white-space: nowrap;'>$ncd</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>Alt Number</th>
<th>Customer Email</th>
<th>Customer Address</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Customer Type</th>
<th>Trip Type</th>
<th>NCD</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//Enquire confirm
if($frm === "get_enquire_confirm"){
$cur_month = $_POST['cur_month'];
$enquire_confirm_info = mysql_query("SELECT ncd,customer_name,phone_number,alt_number,cust_email,cust_address,from_date,to_date,frm.city_name as frm_city_name, des.city_name as to_city_name,cust_type,trip_type FROM sblt_enquiry INNER JOIN sblt_customers on sblt_customers.cust_id = sblt_enquiry.cust_id INNER JOIN sblt_city frm on frm.city_id = sblt_enquiry.orgin INNER JOIN sblt_city des on des.city_id = sblt_enquiry.destination WHERE sblt_enquiry.status = '1' and sblt_enquiry.enquiry_sts = '2' and sblt_enquiry.created_date like '$cur_month%'");
$tr_line = "";
$count = 0;
while($enquire_confirm_rslt = mysql_fetch_array($enquire_confirm_info)){
$count++;
$customer_name = $enquire_confirm_rslt['customer_name'];
$phone_number = $enquire_confirm_rslt['phone_number'];
$alt_number = $enquire_confirm_rslt['alt_number'];
$cust_email = $enquire_confirm_rslt['cust_email'];
$cust_address = $enquire_confirm_rslt['cust_address'];
$from_date = date('d-m-Y', strtotime($enquire_confirm_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($enquire_confirm_rslt['to_date']));
$origin = $enquire_confirm_rslt['frm_city_name'];
$destination = $enquire_confirm_rslt['to_city_name'];
$cust_type = $enquire_confirm_rslt['cust_type'];
$trip_type = $enquire_confirm_rslt['trip_type'];
$ncd = date('d-m-Y', strtotime($enquire_confirm_rslt['ncd']));
if(!$cust_type)
{
$cust_type = "-";
}
if($cust_type=="1")
{
$cust_type = "Aggregate";
}
if($cust_type=="2")
{
$cust_type = "Corporate";
}
if($cust_type=="3")
{
$cust_type = "Individual";
}
if($cust_type=="4")
{
$cust_type = "Package";
}
if($cust_type=="5")
{
$cust_type = "Travel Agent";
}
if(!$trip_type)
{
$trip_type = "-";
}
if($trip_type=="1")
{
$trip_type = "Airport";
}
if($trip_type=="2")
{
$trip_type = "City Use";
}
if($trip_type=="3")
{
$trip_type = "Event";
}
if($trip_type=="4")
{
$trip_type = "Local";
}
if($trip_type=="5")
{
$trip_type = "Out Station";
}
if($trip_type=="6")
{
$trip_type = "Package";
}
if($trip_type=="7")
{
$trip_type = "SBLE";
}
if($trip_type=="8")
{
$trip_type = "Station";
}
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name</td>
<td>$phone_number</td>
<td>$alt_number</td>
<td>$cust_email</td>
<td>$cust_address</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$origin</td>
<td>$destination</td>
<td>$cust_type</td>
<td>$trip_type</td>
<td style='white-space: nowrap;'>$ncd</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>Alt Number</th>
<th>Customer Email</th>
<th>Customer Address</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Customer Type</th>
<th>Trip Type</th>
<th>NCD</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//Enquire cancel
if($frm === "get_enquire_cancel"){
$cur_month = $_POST['cur_month'];
$enquire_cancel_info = mysql_query("SELECT ncd,customer_name,phone_number,alt_number,cust_email,cust_address,from_date,to_date,frm.city_name as frm_city_name, des.city_name as to_city_name,cust_type,trip_type FROM sblt_enquiry INNER JOIN sblt_customers on sblt_customers.cust_id = sblt_enquiry.cust_id INNER JOIN sblt_city frm on frm.city_id = sblt_enquiry.orgin INNER JOIN sblt_city des on des.city_id = sblt_enquiry.destination WHERE sblt_enquiry.status = '1' and sblt_enquiry.enquiry_sts = '3' and sblt_enquiry.created_date like '$cur_month%'");
$tr_line = "";
$count = 0;
while($enquire_cancel_rslt = mysql_fetch_array($enquire_cancel_info)){
$count++;
$customer_name = $enquire_cancel_rslt['customer_name'];
$phone_number = $enquire_cancel_rslt['phone_number'];
$alt_number = $enquire_cancel_rslt['alt_number'];
$cust_email = $enquire_cancel_rslt['cust_email'];
$cust_address = $enquire_cancel_rslt['cust_address'];
$from_date = date('d-m-Y', strtotime($enquire_cancel_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($enquire_cancel_rslt['to_date']));
$origin = $enquire_cancel_rslt['frm_city_name'];
$destination = $enquire_cancel_rslt['to_city_name'];
$cust_type = $enquire_cancel_rslt['cust_type'];
$trip_type = $enquire_cancel_rslt['trip_type'];
$ncd = date('d-m-Y', strtotime($enquire_cancel_rslt['ncd']));
if(!$cust_type)
{
$cust_type = "-";
}
if($cust_type=="1")
{
$cust_type = "Aggregate";
}
if($cust_type=="2")
{
$cust_type = "Corporate";
}
if($cust_type=="3")
{
$cust_type = "Individual";
}
if($cust_type=="4")
{
$cust_type = "Package";
}
if($cust_type=="5")
{
$cust_type = "Travel Agent";
}
if(!$trip_type)
{
$trip_type = "-";
}
if($trip_type=="1")
{
$trip_type = "Airport";
}
if($trip_type=="2")
{
$trip_type = "City Use";
}
if($trip_type=="3")
{
$trip_type = "Event";
}
if($trip_type=="4")
{
$trip_type = "Local";
}
if($trip_type=="5")
{
$trip_type = "Out Station";
}
if($trip_type=="6")
{
$trip_type = "Package";
}
if($trip_type=="7")
{
$trip_type = "SBLE";
}
if($trip_type=="8")
{
$trip_type = "Station";
}
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name</td>
<td>$phone_number</td>
<td>$alt_number</td>
<td>$cust_email</td>
<td>$cust_address</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$origin</td>
<td>$destination</td>
<td>$cust_type</td>
<td>$trip_type</td>
<td style='white-space: nowrap;'>$ncd</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>Alt Number</th>
<th>Customer Email</th>
<th>Customer Address</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Customer Type</th>
<th>Trip Type</th>
<th>NCD</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//booking follow
if($frm === "get_booking_follow"){
$cur_month = $_POST['cur_month'];
$booking_follow_info = mysql_query("SELECT customer_name,phone_number,alt_number,cust_email,cust_address,from_date,to_date,frm.city_name as frm_city_name, des.city_name as to_city_name,cust_type,trip_type FROM sblt_booking INNER JOIN sblt_customers on sblt_customers.cust_id = sblt_booking.cust_id INNER JOIN sblt_city frm on frm.city_id = sblt_booking.orgin INNER JOIN sblt_city des on des.city_id = sblt_booking.destination WHERE sblt_booking.status = '1' and sblt_booking.booking_sts = '1' and sblt_booking.from_date like '$cur_month%'");
$tr_line = "";
$count = 0;
while($booking_follow_rslt = mysql_fetch_array($booking_follow_info)){
$count++;
$customer_name = $booking_follow_rslt['customer_name'];
$phone_number = $booking_follow_rslt['phone_number'];
$alt_number = $booking_follow_rslt['alt_number'];
$cust_email = $booking_follow_rslt['cust_email'];
$cust_address = $booking_follow_rslt['cust_address'];
$from_date = date('d-m-Y', strtotime($booking_follow_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($booking_follow_rslt['to_date']));
$origin = $booking_follow_rslt['frm_city_name'];
$destination = $booking_follow_rslt['to_city_name'];
$cust_type = $booking_follow_rslt['cust_type'];
$trip_type = $booking_follow_rslt['trip_type'];
if(!$cust_type)
{
$cust_type = "-";
}
if($cust_type=="1")
{
$cust_type = "Aggregate";
}
if($cust_type=="2")
{
$cust_type = "Corporate";
}
if($cust_type=="3")
{
$cust_type = "Individual";
}
if($cust_type=="4")
{
$cust_type = "Package";
}
if($cust_type=="5")
{
$cust_type = "Travel Agent";
}
if(!$trip_type)
{
$trip_type = "-";
}
if($trip_type=="1")
{
$trip_type = "Airport";
}
if($trip_type=="2")
{
$trip_type = "City Use";
}
if($trip_type=="3")
{
$trip_type = "Event";
}
if($trip_type=="4")
{
$trip_type = "Local";
}
if($trip_type=="5")
{
$trip_type = "Out Station";
}
if($trip_type=="6")
{
$trip_type = "Package";
}
if($trip_type=="7")
{
$trip_type = "SBLE";
}
if($trip_type=="8")
{
$trip_type = "Station";
}
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name</td>
<td>$phone_number</td>
<td>$alt_number</td>
<td>$cust_email</td>
<td>$cust_address</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$origin</td>
<td>$destination</td>
<td>$cust_type</td>
<td>$trip_type</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>Alt Number</th>
<th>Customer Email</th>
<th>Customer Address</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Customer Type</th>
<th>Trip Type</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//booking confirm
if($frm === "get_booking_confirm"){
$cur_month = $_POST['cur_month'];
$booking_confirm_info = mysql_query("SELECT customer_name,phone_number,alt_number,cust_email,cust_address,from_date,to_date,frm.city_name as frm_city_name, des.city_name as to_city_name,cust_type,trip_type FROM sblt_booking INNER JOIN sblt_customers on sblt_customers.cust_id = sblt_booking.cust_id INNER JOIN sblt_city frm on frm.city_id = sblt_booking.orgin INNER JOIN sblt_city des on des.city_id = sblt_booking.destination WHERE sblt_booking.status = '1' and sblt_booking.booking_sts = '2' and sblt_booking.from_date like '$cur_month%'");
$tr_line = "";
$count = 0;
while($booking_confirm_rslt = mysql_fetch_array($booking_confirm_info)){
$count++;
$customer_name = $booking_confirm_rslt['customer_name'];
$phone_number = $booking_confirm_rslt['phone_number'];
$alt_number = $booking_confirm_rslt['alt_number'];
$cust_email = $booking_confirm_rslt['cust_email'];
$cust_address = $booking_confirm_rslt['cust_address'];
$from_date = date('d-m-Y', strtotime($booking_confirm_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($booking_confirm_rslt['to_date']));
$origin = $booking_confirm_rslt['frm_city_name'];
$destination = $booking_confirm_rslt['to_city_name'];
$cust_type = $booking_confirm_rslt['cust_type'];
$trip_type = $booking_confirm_rslt['trip_type'];
if(!$cust_type)
{
$cust_type = "-";
}
if($cust_type=="1")
{
$cust_type = "Aggregate";
}
if($cust_type=="2")
{
$cust_type = "Corporate";
}
if($cust_type=="3")
{
$cust_type = "Individual";
}
if($cust_type=="4")
{
$cust_type = "Package";
}
if($cust_type=="5")
{
$cust_type = "Travel Agent";
}
if(!$trip_type)
{
$trip_type = "-";
}
if($trip_type=="1")
{
$trip_type = "Airport";
}
if($trip_type=="2")
{
$trip_type = "City Use";
}
if($trip_type=="3")
{
$trip_type = "Event";
}
if($trip_type=="4")
{
$trip_type = "Local";
}
if($trip_type=="5")
{
$trip_type = "Out Station";
}
if($trip_type=="6")
{
$trip_type = "Package";
}
if($trip_type=="7")
{
$trip_type = "SBLE";
}
if($trip_type=="8")
{
$trip_type = "Station";
}
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name</td>
<td>$phone_number</td>
<td>$alt_number</td>
<td>$cust_email</td>
<td>$cust_address</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$origin</td>
<td>$destination</td>
<td>$cust_type</td>
<td>$trip_type</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>Alt Number</th>
<th>Customer Email</th>
<th>Customer Address</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Customer Type</th>
<th>Trip Type</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//booking Created
if($frm === "get_booking_created"){
$date = $_POST['date'];
$booking_confirm_info = mysql_query("SELECT customer_name,phone_number,alt_number,cust_email,cust_address,from_date,to_date,frm.city_name as frm_city_name, des.city_name as to_city_name,cust_type,trip_type,sblt_booking.booking_sts,sblt_booking.created_date FROM sblt_booking INNER JOIN sblt_customers on sblt_customers.cust_id = sblt_booking.cust_id INNER JOIN sblt_city frm on frm.city_id = sblt_booking.orgin INNER JOIN sblt_city des on des.city_id = sblt_booking.destination WHERE sblt_booking.status = '1' and sblt_booking.created_date like '$date%'");
$tr_line = "";
$count = 0;
while($booking_confirm_rslt = mysql_fetch_array($booking_confirm_info)){
$count++;
$customer_name = $booking_confirm_rslt['customer_name'];
$phone_number = $booking_confirm_rslt['phone_number'];
$alt_number = $booking_confirm_rslt['alt_number'];
$cust_email = $booking_confirm_rslt['cust_email'];
$cust_address = $booking_confirm_rslt['cust_address'];
$from_date = date('d-m-Y', strtotime($booking_confirm_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($booking_confirm_rslt['to_date']));
$origin = $booking_confirm_rslt['frm_city_name'];
$destination = $booking_confirm_rslt['to_city_name'];
$cust_type = $booking_confirm_rslt['cust_type'];
$trip_type = $booking_confirm_rslt['trip_type'];
$booking_sts = $booking_confirm_rslt['booking_sts'];
$created_date = date('d-m-Y', strtotime($booking_confirm_rslt['created_date']));
if($booking_sts === "1"){
$booking_sts = "Followup";
}else
if($booking_sts === "2"){
$booking_sts = "Confirm";
}else
if($booking_sts === "3"){
$booking_sts = "Cancelled";
}
if(!$cust_type)
{
$cust_type = "-";
}
if($cust_type=="1")
{
$cust_type = "Aggregate";
}
if($cust_type=="2")
{
$cust_type = "Corporate";
}
if($cust_type=="3")
{
$cust_type = "Individual";
}
if($cust_type=="4")
{
$cust_type = "Package";
}
if($cust_type=="5")
{
$cust_type = "Travel Agent";
}
if(!$trip_type)
{
$trip_type = "-";
}
if($trip_type=="1")
{
$trip_type = "Airport";
}
if($trip_type=="2")
{
$trip_type = "City Use";
}
if($trip_type=="3")
{
$trip_type = "Event";
}
if($trip_type=="4")
{
$trip_type = "Local";
}
if($trip_type=="5")
{
$trip_type = "Out Station";
}
if($trip_type=="6")
{
$trip_type = "Package";
}
if($trip_type=="7")
{
$trip_type = "SBLE";
}
if($trip_type=="8")
{
$trip_type = "Station";
}
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name</td>
<td>$phone_number</td>
<td>$alt_number</td>
<td>$cust_email</td>
<td>$cust_address</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$origin</td>
<td>$destination</td>
<td>$cust_type</td>
<td>$trip_type</td>
<td>$created_date</td>
<td>$booking_sts</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>Alt Number</th>
<th>Customer Email</th>
<th>Customer Address</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Customer Type</th>
<th>Trip Type</th>
<th>Created</th>
<th>status</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//booking cancel
if($frm === "get_booking_cancel"){
$cur_month = $_POST['cur_month'];
$booking_cancel_info = mysql_query("SELECT customer_name,phone_number,alt_number,cust_email,cust_address,from_date,to_date,frm.city_name as frm_city_name, des.city_name as to_city_name,cust_type,trip_type FROM sblt_booking INNER JOIN sblt_customers on sblt_customers.cust_id = sblt_booking.cust_id LEFT JOIN sblt_city frm on frm.city_id = sblt_booking.orgin LEFT JOIN sblt_city des on des.city_id = sblt_booking.destination WHERE sblt_booking.status = '1' and booking_sts = '3' and sblt_booking.from_date like '$cur_month%'");
$tr_line = "";
$count = 0;
while($booking_cancel_rslt = mysql_fetch_array($booking_cancel_info)){
$count++;
$customer_name = $booking_cancel_rslt['customer_name'];
$phone_number = $booking_cancel_rslt['phone_number'];
$alt_number = $booking_cancel_rslt['alt_number'];
$cust_email = $booking_cancel_rslt['cust_email'];
$cust_address = $booking_cancel_rslt['cust_address'];
$from_date = date('d-m-Y', strtotime($booking_cancel_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($booking_cancel_rslt['to_date']));
$origin = $booking_cancel_rslt['frm_city_name'];
$destination = $booking_cancel_rslt['to_city_name'];
$cust_type = $booking_cancel_rslt['cust_type'];
$trip_type = $booking_cancel_rslt['trip_type'];
if(!$cust_type)
{
$cust_type = "-";
}
if($cust_type=="1")
{
$cust_type = "Aggregate";
}
if($cust_type=="2")
{
$cust_type = "Corporate";
}
if($cust_type=="3")
{
$cust_type = "Individual";
}
if($cust_type=="4")
{
$cust_type = "Package";
}
if($cust_type=="5")
{
$cust_type = "Travel Agent";
}
if(!$trip_type)
{
$trip_type = "-";
}
if($trip_type=="1")
{
$trip_type = "Airport";
}
if($trip_type=="2")
{
$trip_type = "City Use";
}
if($trip_type=="3")
{
$trip_type = "Event";
}
if($trip_type=="4")
{
$trip_type = "Local";
}
if($trip_type=="5")
{
$trip_type = "Out Station";
}
if($trip_type=="6")
{
$trip_type = "Package";
}
if($trip_type=="7")
{
$trip_type = "SBLE";
}
if($trip_type=="8")
{
$trip_type = "Station";
}
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name</td>
<td>$phone_number</td>
<td>$alt_number</td>
<td>$cust_email</td>
<td>$cust_address</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$origin</td>
<td>$destination</td>
<td>$cust_type</td>
<td>$trip_type</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>Alt Number</th>
<th>Customer Email</th>
<th>Customer Address</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Customer Type</th>
<th>Trip Type</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//Vehicle total
if($frm === "get_vehicle_total_info"){
$cur_month = $_POST['cur_month'];
$vehicle_total_info = mysql_query("SELECT sblt_operation.operation_id,tour_no, from_date, to_date,customer_name, phone_number, operation_sts, GROUP_CONCAT(vehicle_no SEPARATOR ',') AS vehicle_no,trip_days, bus_count,frm.city_name as frm_city_name, des.city_name as to_city_name,bus_count FROM sblt_operation LEFT JOIN sblt_operation_line on sblt_operation_line.operation_id = sblt_operation.operation_id LEFT JOIN sblt_vehicle on sblt_vehicle.vehicle_id = sblt_operation_line.op_vehicle_id LEFT JOIN sblt_customers on sblt_customers.cust_id = sblt_operation.cust_id LEFT JOIN sblt_trip_type on sblt_trip_type.trip_type_id = sblt_operation.trip_type LEFT JOIN sblt_booking_type on sblt_booking_type.booking_type_id = sblt_operation.cust_type LEFT JOIN sblt_city frm on frm.city_id = sblt_operation.orgin LEFT JOIN sblt_city des on des.city_id = sblt_operation.destination WHERE sblt_operation.from_date like '$cur_month%' group by sblt_operation.operation_id");
$tr_line = "";
$count = 0;
while($vehicle_total_info_rslt = mysql_fetch_array($vehicle_total_info)){
$count++;
$customer_name = $vehicle_total_info_rslt['customer_name'];
$phone_number = $vehicle_total_info_rslt['phone_number'];
$from_date = date('d-m-Y', strtotime($vehicle_total_info_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($vehicle_total_info_rslt['to_date']));
$orgin = $vehicle_total_info_rslt['frm_city_name'];
$destination = $vehicle_total_info_rslt['to_city_name'];
$trip_days = $vehicle_total_info_rslt['trip_days'];
$vehicle_no = $vehicle_total_info_rslt['vehicle_no'];
$bus_count = $vehicle_total_info_rslt['bus_count'];
$operation_sts = $vehicle_total_info_rslt['operation_sts'];
if($operation_sts=="2")
{
$operation_sts = "Confirm";
}
if($operation_sts=="3")
{
$operation_sts = "Cancelled";
}
if($operation_sts=="4")
{
$operation_sts = "Completed";
}
if($operation_sts=="5")
{
$operation_sts = "On Progress";
}
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name </td>
<td>$phone_number</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$orgin</td>
<td>$destination</td>
<td>$trip_days</td>
<td>$bus_count</td>
<td>$vehicle_no</td>
<td>$operation_sts</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Trip Days</th>
<th>Bus Count</th>
<th>Vehicle No</th>
<th>Status</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//Vehicle assign
if($frm === "get_vehicle_assign"){
$cur_month = $_POST['cur_month'];
$vehicle_assign_info = mysql_query("SELECT sblt_operation.operation_id,tour_no, from_date, to_date,customer_name, phone_number, bus_count,GROUP_CONCAT(vehicle_no SEPARATOR ',') AS vehicle_no,trip_days, bus_count,frm.city_name as frm_city_name, des.city_name as to_city_name FROM sblt_operation INNER JOIN sblt_operation_line on sblt_operation_line.operation_id = sblt_operation.operation_id LEFT JOIN sblt_vehicle on sblt_vehicle.vehicle_id = sblt_operation_line.op_vehicle_id LEFT JOIN sblt_customers on sblt_customers.cust_id = sblt_operation.cust_id LEFT JOIN sblt_trip_type on sblt_trip_type.trip_type_id = sblt_operation.trip_type LEFT JOIN sblt_booking_type on sblt_booking_type.booking_type_id = sblt_operation.cust_type LEFT JOIN sblt_city frm on frm.city_id = sblt_operation.orgin LEFT JOIN sblt_city des on des.city_id = sblt_operation.destination WHERE sblt_operation.from_date like '$cur_month%' and sblt_operation.operation_sts != '3' group by sblt_operation.operation_id");
$tr_line = "";
$count = 0;
while($vehicle_assign_rslt = mysql_fetch_array($vehicle_assign_info)){
$count++;
$customer_name = $vehicle_assign_rslt['customer_name'];
$phone_number = $vehicle_assign_rslt['phone_number'];
$from_date = date('d-m-Y', strtotime($vehicle_assign_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($vehicle_assign_rslt['to_date']));
$orgin = $vehicle_assign_rslt['frm_city_name'];
$destination = $vehicle_assign_rslt['to_city_name'];
$trip_days = $vehicle_assign_rslt['trip_days'];
$vehicle_no = $vehicle_assign_rslt['vehicle_no'];
$bus_count = $vehicle_assign_rslt['bus_count'];
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name </td>
<td>$phone_number</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$orgin</td>
<td>$destination</td>
<td>$trip_days</td>
<td>$bus_count</td>
<td>$vehicle_no</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Trip Days</th>
<th>Bus Count</th>
<th>Vehicle No</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//Vehicle pending sblt_operation_line.op_line_id IS NULL and
if($frm === "get_vehicle_pending"){
$cur_month = $_POST['cur_month'];
$vehicle_pending_info = mysql_query("SELECT sblt_operation.operation_id,from_date,to_date,customer_name, phone_number, trip_days, bus_count,frm.city_name as frm_city_name, des.city_name as to_city_name FROM sblt_operation LEFT JOIN sblt_operation_line on sblt_operation_line.operation_id = sblt_operation.operation_id LEFT JOIN sblt_vehicle on sblt_vehicle.vehicle_id = sblt_operation_line.op_vehicle_id LEFT JOIN sblt_customers on sblt_customers.cust_id = sblt_operation.cust_id LEFT JOIN sblt_trip_type on sblt_trip_type.trip_type_id = sblt_operation.trip_type LEFT JOIN sblt_booking_type on sblt_booking_type.booking_type_id = sblt_operation.cust_type LEFT JOIN sblt_city frm on frm.city_id = sblt_operation.orgin LEFT JOIN sblt_city des on des.city_id = sblt_operation.destination WHERE op_line_id is null and sblt_operation.from_date like '$cur_month%' and sblt_operation.operation_sts != '3'");
$tr_line = "";
$count = 0;
while($vehicle_pending_rslt = mysql_fetch_array($vehicle_pending_info)){
$count++;
$customer_name = $vehicle_pending_rslt['customer_name'];
$phone_number = $vehicle_pending_rslt['phone_number'];
$from_date = date('d-m-Y', strtotime($vehicle_pending_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($vehicle_pending_rslt['to_date']));
$orgin = $vehicle_pending_rslt['frm_city_name'];
$destination = $vehicle_pending_rslt['to_city_name'];
$trip_days = $vehicle_pending_rslt['trip_days'];
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name </td>
<td>$phone_number</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$orgin</td>
<td>$destination</td>
<td>$trip_days</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Trip Days</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}else
//Vehicle cancell
if($frm === "get_vehicle_cancel"){
$cur_month = $_POST['cur_month'];
$vehicle_cancel_info = mysql_query("SELECT sblt_operation.operation_id,tour_no, from_date, to_date,customer_name, phone_number, bus_count, GROUP_CONCAT(vehicle_no SEPARATOR ',') AS vehicle_no,trip_days, bus_count,frm.city_name as frm_city_name, des.city_name as to_city_name FROM sblt_operation LEFT JOIN sblt_operation_line on sblt_operation_line.operation_id = sblt_operation.operation_id LEFT JOIN sblt_vehicle on sblt_vehicle.vehicle_id = sblt_operation_line.op_vehicle_id LEFT JOIN sblt_customers on sblt_customers.cust_id = sblt_operation.cust_id LEFT JOIN sblt_trip_type on sblt_trip_type.trip_type_id = sblt_operation.trip_type LEFT JOIN sblt_booking_type on sblt_booking_type.booking_type_id = sblt_operation.cust_type LEFT JOIN sblt_city frm on frm.city_id = sblt_operation.orgin LEFT JOIN sblt_city des on des.city_id = sblt_operation.destination WHERE sblt_operation.from_date like '$cur_month%' and sblt_operation.operation_sts = '3' group by sblt_operation.operation_id");
$tr_line = "";
$count = 0;
while($vehicle_cancel_rslt = mysql_fetch_array($vehicle_cancel_info)){
$count++;
$customer_name = $vehicle_cancel_rslt['customer_name'];
$phone_number = $vehicle_cancel_rslt['phone_number'];
$from_date = date('d-m-Y', strtotime($vehicle_cancel_rslt['from_date']));
$to_date = date('d-m-Y', strtotime($vehicle_cancel_rslt['to_date']));
$orgin = $vehicle_cancel_rslt['frm_city_name'];
$destination = $vehicle_cancel_rslt['to_city_name'];
$trip_days = $vehicle_cancel_rslt['trip_days'];
$vehicle_no = $vehicle_cancel_rslt['vehicle_no'];
$bus_count = $vehicle_cancel_rslt['bus_count'];
$tr_line .= "<tr>
<td style='text-align:center !important;'>$count</td>
<td>$customer_name </td>
<td>$phone_number</td>
<td style='white-space: nowrap;'>$from_date</td>
<td style='white-space: nowrap;'>$to_date</td>
<td>$orgin</td>
<td>$destination</td>
<td>$trip_days</td>
<td>$bus_count</td>
<td>$vehicle_no</td>
</tr>";
}
echo "<table id='detail_list' class='table table-bordered col-style'>
<thead>
<tr>
<th>Sl.No</th>
<th>Customer Name</th>
<th>Phone Number</th>
<th>From Date</th>
<th>To Date</th>
<th>Origin</th>
<th>Destination</th>
<th>Trip Days</th>
<th>Bus Count</th>
<th>Vehicle No</th>
</tr>
</thead>
<tbody>$tr_line</tbody>
</table>";
}
?>