$data = array('object_id' => $object_id); break; case 'get_buyer': $tin = $_REQUEST['tn']; $name = htmlspecialchars($_REQUEST['nm']); $res = GetBuyer($tin, $name); if (!$res) { $error = 'პარტნიორი ვერ მოიძებნა!'; } else { $data = array('tin' => $res['tin'], 'name' => $res['name'], 'address' => $res['legal_address']); } break; case 'get_driver': $tin = $_REQUEST['tn']; $name = htmlspecialchars($_REQUEST['nm'], ENT_QUOTES); $res = GetDriver($tin, $name); if (!$res) { $error = 'მძღოლი ვერ მოიძებნა!'; } else { $data = array('tin' => $res['tin'], 'name' => $res['name']); } break; case 'get_rs_id': $overhead_id = $_REQUEST['id']; $rs_id = GetRSID($overhead_id); $data = array('rs_id' => $rs_id); break; case 'get_parent_id': $overhead_id = $_REQUEST['id']; $local_par_id = GetParentID($overhead_id); $data = array('local_par_id' => $local_par_id);
static function GetDriver($driver_number) { $r = GetDriver($driver_number); if (is_resource($r)) { $c = substr(get_resource_type($r), strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3); if (!class_exists($c)) { return new Driver($r); } return new $c($r); } return $r; }