function auth_cookie() { $ss = explode("_", $_COOKIE['id']); $req = "SELECT user,pass FROM user WHERE user=\"" . $ss[0] . "\""; $row1 = db_req($req); if ($ss[0] == $row1[0]['user'] && $ss[1] == $row1[0]['pass'] && $row1[0]['user'] !== null && $row1[0]['pass'] !== null && $row1[0]['user'] !== '' && $row1[0]['pass'] !== '') { $req = "UPDATE user SET date_last_login=null WHERE user='******'"; db_req_without_resp($req); return $row1[0][user]; } else { return false; } }
db_req_without_resp($req); include "/var/www/indriver/modules/stop.php"; echo "1"; } if ($_POST[work] == '1') { $req = "UPDATE `status` SET `work`='1' WHERE `status_id`='0';"; include "/var/www/indriver/modules/stop.php"; db_req_without_resp($req); echo "1"; } if ($_POST[work] == '0') { $req = "UPDATE `status` SET `work`='0' WHERE `status_id`='0';"; db_req_without_resp($req); echo "1"; } if ($_POST[ask_work] == '1') { $req = "SELECT * FROM status;"; $ret = db_req($req); echo $ret['work']; } if ($_POST[ask_start] == '1') { $req = "SELECT * FROM status;"; $ret = db_req($req); echo $ret['init']; } if ($_POST[disconnect] == '1') { $req = "UPDATE `status` SET `disk`='1' WHERE `status_id`='0';"; db_req_without_resp($req); include "/var/www/indriver/modules/disconnect.php"; echo "1"; }
///сохраняет имя каналла клиента. $ss = db_req($sql); $sql = "REPLACE INTO `sip_channel_client` (`channel_client`, `taxist_id`) VALUES ('" . $argv[3] . "', '" . $ss['taxist_id'] . "');"; db_req_without_resp($sql); } ///////////////////////////////// /////// обновить имя канала клиента НА вызов обновляется на вызов в call_filter-е ///////////////////////////////// if ($argv[1] == "RING") { ////берет айди таксиста $numb = substr($argv[2], 1, 10); $sql = "SELECT `taxist_id` FROM indriver.taxist WHERE `phone_taxist`='" . $numb . "'"; ///заменеят полсдний канал клиента на текущего клиента $ss = db_req($sql); $sql = "REPLACE INTO `sip_channel_client` (`channel_client`, `taxist_id`) VALUES ('" . $argv[3] . "', '" . $ss['taxist_id'] . "');"; db_req_without_resp($sql); } ////////////////////////////////// //////видимо просто так ////////////////////////////////// if ($argv[1] == "mynum") { echo $argv[2]; } //////////////////////////////// ////запросить телефонный номер последнего клиента таксисита //////////////////////////////// if ($argv[1] == "work") { $numb = substr($argv[2], 1, 10); $sql = "SELECT `phone` FROM current_taxa_android WHERE taxist_id=(SELECT `taxist_id` FROM `taxist` WHERE `phone_taxist`='" . $numb . "') order by `id_taxa` Desc limit 1"; $ss = db_req($sql); echo $ss['phone'] . "@android-out";