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); } }
function loadPrint($inp) { $inp = (int) $inp; $ticket = new ticket_class($inp); $id = $ticket->getId(); if ($ticket->typ == 0) { $out = "<div class='msg detail_div' onclick=\"wopen('eticket.php?print=1&shomare=" . $ticket->shomare . "&id={$inp}&','',750,550)\" > " . $ticket->shomare . " <br> چاپ </div>"; } else { $out = "<span style='cursor:pointer;color:blue;' > " . $ticket->shomare . "</span>"; } return $out; }
public function deleteTicket($ticket_id) { $conf = new conf(); $ticket = new ticket_class((int) $ticket_id); $sanad_record_id = $ticket->sanad_record_id; $parvaz = new parvaz_det_class($ticket->parvaz_det_id); $today = date("Y-m-d H:i:s"); $out = FALSE; if ($today < $parvaz->tarikh . " " . $parvaz->saat) { $mysql = new mysql_class(); $mablagh = $ticket->mablagh * (1 - $ticket->poorsant / 100); $arg["toz"] = "حذف کامل بلیت شماره " . $ticket->shomare; $arg["toz"] .= 'از پرواز شماره ' . $parvaz->shomare . ' تاریخ ' . audit_class::hamed_pdate($parvaz->tarikh); $arg["user_id"] = $_SESSION[$conf->app . "_user_id"]; $arg["host"] = $_SERVER["REMOTE_ADDR"]; $arg["page_address"] = $_SERVER["SCRIPT_NAME"]; $arg["typ"] = 8; log_class::add($arg); $mysql->ex_sql("select `id`,`mablagh` from `customer_daryaft` where `sanad_record_id` = {$sanad_record_id}", $q); if (isset($q[0])) { if ((int) $q[0]["mablagh"] == $mablagh) { $mysql->ex_sqlx("delete from `customer_daryaft` where `id` = " . (int) $q[0]["id"]); } } $mysql->ex_sqlx("update `customer_daryaft` set `mablagh`=`mablagh`-{$mablagh} where `sanad_record_id` = {$sanad_record_id}"); $mysql->ex_sqlx("delete from `ticket` where `id` = " . $ticket->getId()); if ($ticket->adult < 2) { $parvaz->resetZarfiat(1); } $out = TRUE; } return $out; }