Last active
August 29, 2015 14:10
-
-
Save maksadbek/0a2c27c6045dc1144fa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case "handmade_next_status": | |
{ | |
$sql = "SELECT status FROM `max_taxi_incoming_orders` WHERE id = {$_REQUEST['id']}";//1,5,6,7 | |
$res = mysql_query($sql); | |
$status = mysql_result($res, 0, 'status'); | |
$new_status = $status; | |
switch ($status) { | |
case "1": { | |
$new_status = 5; | |
$sql = "UPDATE `max_taxi_incoming_orders` SET `status` = $new_status, `next_step` = $new_status WHERE id = {$_REQUEST['id']}"; | |
$res = mysql_query($sql); | |
} break; | |
case "5": { | |
$new_status = 6; | |
$sql = "UPDATE `max_taxi_incoming_orders` SET `status` = $new_status, `next_step` = $new_status WHERE id = {$_REQUEST['id']}"; | |
$res = mysql_query($sql); | |
} break; | |
/*case "6": { | |
$new_status = 7; | |
} break;*/ | |
} | |
if ($status == null || $status == 2 || $status == 4 || $status == 9) { | |
$to_date = date("Y-m-d H:i:s"); | |
$to_date = str_replace('T',' ', $to_date); | |
$to_date = explode(' ', $to_date); | |
$to_Date = explode('-', $to_date[0]); | |
$to_Time = explode(':', $to_date[1]); | |
$testD = mktime($to_Time[0], $to_Time[1]+3, $to_Time[2], $to_Date[1], $to_Date[2], $to_Date[0]); | |
$to_date = date('Y-m-d H:i:s', $testD); | |
$sql = "UPDATE | |
`max_taxi_incoming_orders` | |
SET | |
`driver_id` = {$_REQUEST['driver_id']}, | |
`next_step` = 1, | |
`order_attached` = 1, | |
`time_order` = '$to_date', | |
`status` = 1 | |
WHERE | |
`id` = {$_REQUEST['id']}"; | |
$res = mysql_query($sql); | |
$sql = "UPDATE `max_taxi_deamon_log` SET `active` = 0 WHERE `order_id` = {$_REQUEST['id']} AND `status` in (-2, 3, 5, 6, 7)"; | |
$res1 = mysql_query($sql); | |
} | |
//$result['sql'] = $sql; | |
if ($res) { | |
if ($status == null || $status == 2 || $status == 4 || $status == 9 || $status == 1) { | |
$sql = "SELECT | |
d.id, d.driver_phone, c.Mobile | |
FROM | |
`max_taxi_incoming_orders` io | |
LEFT OUTER JOIN max_drivers d ON d.id = io.driver_id | |
LEFT OUTER JOIN max_taxi_server_clients c ON c.ClientID = io.client_id | |
WHERE | |
io.id = {$_REQUEST['id']}"; | |
$res = mysql_query($sql); | |
$driver_id = mysql_result($res, 0, 'id'); | |
$driver_phone = mysql_result($res, 0, 'driver_phone'); | |
$client_phone = mysql_result($res, 0, 'Mobile'); | |
if ($client_phone != '998000000000') { | |
$sql = "INSERT INTO `max_taxi_calls_reg` | |
(`order_id`, `driver_id`, `status`, `date_insert`, `driver_phone`, `client_phone`, `order_status`) | |
VALUES | |
({$_REQUEST['id']}, $driver_id, 0, '".date("Y-m-d H:i:s")."', '$driver_phone', '$client_phone', {$_REQUEST['travel_time']})"; | |
$res1 = mysql_query($sql); | |
} | |
} | |
$result['success'] = true; | |
} | |
} break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NULL-Новый(A); | |
0-В ожидании(later), | |
1-Принят; | |
2-plan B; | |
3-В процессе обр, | |
4-taxist cancal; | |
5-arrived; | |
6-clientOnBoard; | |
7-finished; | |
8-ClientCancel; | |
9-ServerCancel, | |
10-Manzilga yetip keldi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment