public function __construct($ticket_id = -1) { $conf = new conf(); if ((int) $ticket_id > 0) { $ticket = new ticket_class($ticket_id); $this->ticket_ok = $ticket->getId() > 0; $ticket_back = null; $ticket_back_id = $ticket->loadBargasht(); if ($ticket_back_id > 0) { $ticket_back = new ticket_class($ticket_back_id); } $this->regTime = $ticket->regtime; $this->customer_id = $ticket->customer_id; $this->parvaz_det_id = array($ticket->parvaz_det_id); if ($ticket_back != null && $ticket_back->getId() > 0 && $ticket_back->parvaz_det_id > 0) { $this->parvaz_det_id[] = $ticket_back->parvaz_det_id; $this->allow[1] = '20'; $this->flight_class[1] = 'Y'; } $this->ticket_fname = $ticket->fname; $this->ticket_lname = $ticket->lname; $this->serial = $ticket->shomare; $this->refrence = ticket_class::rahgiriToCode($ticket->sanad_record_id, $conf->rahgiri); } }
include_once "../kernel.php"; if (isset($_REQUEST['shomare']) && isset($_REQUEST['id'])) { mysql_class::ex_sql('select `id` from `ticket` where `shomare`=' . (int) $_REQUEST["shomare"], $qs); if (mysql_num_rows($qs) == 1) { $r = mysql_fetch_array($qs); $ticket = new ticket_class((int) $r['id']); $customer = new customer_class($ticket->customer_id); $parvaz = new parvaz_det_class($ticket->parvaz_det_id); $parvaz2 = null; } if (mysql_num_rows($qs) > 1) { $id = (int) $_REQUEST['id']; $ticket = new ticket_class($id); //echo (int)ticket_class::loadBargasht(23); $ticket2 = new ticket_class((int) ticket_class::loadBargasht($id)); $customer = new customer_class($ticket->customer_id); $parvaz = new parvaz_det_class($ticket->parvaz_det_id); $parvaz2 = new parvaz_det_class($ticket2->parvaz_det_id); } } function loadAdl($inp) { $inp = (int) $inp; $out = 'ADL'; if ($inp == 1) { $out = 'CHD'; } if ($inp == 2) { $out = 'INF'; }