Beispiel #1
0
<?php

include '../includes/dbutil.php';
//extract($_POST);
$check_count = get_row_count("tbl_state");
if ($check_count > 0) {
    $states = select_columns_rows_by_condition("tbl_state t", "t.id,t.state_name", "order by t.id asc");
    foreach ($states as $st_info1) {
        //$product_info=$product_info1;
        $results[] = $st_info1;
    }
    $results['status'] = "success";
    echo json_encode($results);
} else {
    echo json_encode(array("status" => "failed"));
}
Beispiel #2
0
			$sq=mysql_query("select * from driver_reg where id='$driver_id'");
			$ar=mysql_fetch_array($sq);
			$driver_name=$ar['driver_name'];
			$driver_mobile=$ar['mobile'];
			$sql1=mysql_query("select * from trip_reg where driver_id='$driver_id' and status='0' order by id desc");
			//if(mysql_num_rows($sql1)==0){ echo "<div class='admin_faile'>Presently No Cabs found.</div>"; }
			$arr=mysql_fetch_array($sql1);
			$trip_id=$arr['id'];
			$cab_id=$arr['cab_id'];
			$sql2=mysql_query("select * from cab_reg where id='$cab_id'");
			$arr1=mysql_fetch_array($sql2);
			$cab_type=$arr1['cartype'];
			$cab_no=$arr1['vehicle_reg'];*/
$count = get_row_count_by_condition("trip_reg", "where status <> 0");
if ($count > 0) {
    $arr = select_columns_rows_by_condition("trip_reg t INNER JOIN driver_reg d INNER JOIN cab_reg c", "t.*,d.driver_name,d.mobile as driver_mobile, c.vehicle_reg", "on t.cab_id=c.id and t.driver_id=d.id where t.status <> 0");
    foreach ($arr as $row) {
        if ($row['status'] == 0) {
            $status_loc = "Pending";
        } else {
            if ($row['status'] == 1) {
                $status_loc = "Cab assigned";
            } else {
                if ($row['status'] == 2) {
                    $status_loc = "In travel";
                } else {
                    if ($row['status'] == 3) {
                        $status_loc = "completed";
                    } else {
                        if ($row['status'] == 4) {
                            $status_loc = "In transit";
Beispiel #3
0
<?php

include '../includes/dbutil.php';
include 'includes/validation.php';
$parameters = array("state_id");
$is_parameter_available = is_post_parameters_exists($parameters);
if ($is_parameter_available == 0) {
    extract($_POST);
    $check_count = get_row_count_by_condition("tbl_city", "where state_id='" . $state_id . "' ");
    if ($check_count > 0) {
        $cities = select_columns_rows_by_condition("tbl_city t", "t.id,t.city_name", "where t.state_id='" . $state_id . "'");
        foreach ($cities as $ct_info1) {
            //$product_info=$product_info1;
            $results[] = $ct_info1;
        }
        $results['status'] = "success";
        echo json_encode($results);
    } else {
        echo json_encode(array("status" => "There is no data"));
    }
} else {
    echo json_encode(array("status" => "failed"));
}
?>