public function hamed_pdateBack($inp, $saat = TRUE) { $out = FALSE; $tmp = explode("/", $inp); if (count($tmp) == 3) { $out = audit_class::hamed_jalalitomiladi(audit_class::perToEn($inp)); } return $out . ($saat ? " 12:00:00" : ''); }
function loadParvazDets($parvaz_det_id) { $out = null; $no = date("Y-m-d"); $par = new parvaz_det_class((int) $parvaz_det_id); mysql_class::ex_sql("select `parvaz_det`.`id`,`parvaz`.`shomare`,`parvaz_det`.`tarikh`,`parvaz_det`.`saat` from `parvaz_det` left join `parvaz` on (`parvaz_det`.`parvaz_id` = `parvaz`.`id`) where `parvaz_det`.`en`=1 and `parvaz_det`.`id` <> {$parvaz_det_id} and `parvaz_det`.`tarikh`>='{$no}' and `parvaz`.`mabda_id`=" . $par->maghsad_id . " and `parvaz`.`maghsad_id`=" . $par->mabda_id . " order by `tarikh`,`saat`,`parvaz_id`", $q); while ($r = mysql_fetch_array($q)) { $out[$r['shomare'] . '(' . perToEnNums(audit_class::hamed_pdate($r['tarikh'])) . ' ' . $r['saat'] . ')'] = $r['id']; } return $out; }
function hamed_pdateBack1($inp) { $out = FALSE; $tmp = explode("/", $inp); if (count($tmp) == 3) { $y = (int) $tmp[2]; $m = (int) $tmp[1]; $d = (int) $tmp[0]; if ($d > $y) { $tmp = $y; $y = $d; $d = $tmp; } if ($y < 1000) { $y = $y + 1300; } $inp = "{$y}/{$m}/{$d}"; $out = audit_class::hamed_jalalitomiladi(audit_class::perToEn($inp)); } return $out; }
<?php session_start(); include_once "../kernel.php"; if (isset($_SESSION[conf::app . '_user_id']) && isset($_SESSION[conf::app . '_typ'])) { $us = new user_class((int) $_SESSION[conf::app . '_user_id']); if (!audit_class::isAdmin($_SESSION[conf::app . '_typ']) || $us->user != 'mehrdad') { die("<center><h1>شما به این صفحه دسترسی ندارید</h1></center>"); } } else { die("<center><h1>شما به این صفحه دسترسی ندارید</h1></center>"); } function add_item() { $fields = null; foreach ($_REQUEST as $key => $value) { if (substr($key, 0, 4) == "new_") { if ($key != "new_id") { $fields[substr($key, 4)] = $value; } } } $fields['acc_id'] = $_REQUEST['acc_id']; $fi = "("; $valu = "("; foreach ($fields as $field => $value) { $fi .= "`{$field}`,"; $valu .= "'{$value}',"; } $fi = substr($fi, 0, -1); $valu = substr($valu, 0, -1);
public function pay($reserve_id, $amount) { $conf = new conf(); $out = FALSE; $client = new soapclient_nu($conf->mellat_wsdl); //'https://pgws.bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl'); $namespace = $conf->mellat_namespace; //'http://interfaces.core.sw.bps.com/'; $terminalId = $conf->mellat_terminalId; $userName = $conf->mellat_userName; $userPassword = $conf->mellat_userPassword; $orderId = $reserve_id; $amount = audit_class::perToEn($amount); $localDate = date("Ymd"); $localTime = date("His"); $additionalData = ''; $callBackUrl = $conf->mellat_callBackUrl; $payerId = 0; $parameters = array('terminalId' => $terminalId, 'userName' => $userName, 'userPassword' => $userPassword, 'orderId' => $orderId, 'amount' => $amount, 'localDate' => $localDate, 'localTime' => $localTime, 'additionalData' => $additionalData, 'callBackUrl' => $callBackUrl, 'payerId' => $payerId); // Call the SOAP method $result = $client->call('bpPayRequest', $parameters, $namespace); if ($client->fault) { // } else { // Check for errors $resultStr = $result; $err = $client->getError(); if ($err) { // Display the error } else { $out = $result; } } return $out; }
function pateBack($pdat) { $out = audit_class::hamed_pdateBack($pdat); $tmp = explode(' ', $out); return $tmp[0]; }
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; }
public function sanad_shenavar_kharid($parvaz, $tedad, $sanad_record_id, $user_id) { $toz = "بابت خرید {$tedad} بلیت از پرواز " . $parvaz->shomare . " تاریخ " . audit_class::hamed_pdate($parvaz->tarikh) . " ساعت " . $parvaz->saat . ' بصورت شناور'; if ($parvaz->mablagh_kharid != 0) { mysql_class::ex_sqlx('insert into `customer_daryaft` (`customer_id`, `user_id`, `mablagh`, `tozihat`, `sanad_record_id`, `typ`,`sanad_typ`) values(' . $parvaz->customer_id . ',' . $user_id . ',' . $tedad * $parvaz->mablagh_kharid . ',\'' . $toz . '\',' . $sanad_record_id . ',1,2)'); } }
} } } die($my->ex_sqlx($sql)); } } $GLOBALS['agencyArr'] = loadghimatArr(); $aztarikh = date("Y-m-d"); $tatarikh = strtotime(date("Y-m-d H:i:s") . ' + 1 month'); $tatarikh = date("Y-m-d", $tatarikh); $saat = date("H:i:s"); $tshart = ''; $shart = '1=1'; if (isset($_REQUEST['smabda_id'])) { $aztarikh = audit_class::hamed_pdateBack(trim($_REQUEST['saztarikh']), FALSE); $tatarikh = audit_class::hamed_pdateBack(trim($_REQUEST['statarikh']), FALSE); $mabda_id = (int) $_REQUEST['smabda_id']; $maghsad_id = (int) $_REQUEST['smaghsad_id']; $tshart = $mabda_id == -1 ? '' : " and parvaz.mabda_id={$mabda_id}"; $tshart .= $maghsad_id == -1 ? '' : " and parvaz.maghsad_id={$maghsad_id}"; } $shart = "(tarikh>='{$aztarikh}' and tarikh<='{$tatarikh}') {$tshart}"; // $domasire = TRUE; $pageRows = 10; $now = date("Y-m-d H:i:s"); $my = new mysql_class(); $my->ex_sql("select count(`id`) as `co` from `parvaz_det`", $l); if (isset($l[0])) { $pageRows = (int) $l[0]['co']; }
function hamed_pdate($inp) { return audit_class::hamed_pdate($inp); }
<?php session_start(); include_once "../kernel.php"; if (!isset($_SESSION[conf::app . '_user_id'])) { die(lang_fa_class::access_deny); } $se = security_class::auth((int) $_SESSION[conf::app . '_user_id']); if (!$se->can_view) { die(lang_fa_class::access_deny); } $msg = ""; if (isset($_SESSION[conf::app . '_user_id']) && isset($_SESSION[conf::app . '_typ'])) { if (!audit_class::isAdmin($_SESSION[conf::app . '_typ'])) { die("<center><h1>شما به این صفحه دسترسی ندارید</h1></center>"); } } else { die("<center><h1>شما به این صفحه دسترسی ندارید</h1></center>"); } $costumer_id = isset($_REQUEST["id"]) ? (int) $_REQUEST["id"] : -1; $cust = new customer_class($costumer_id); if (isset($_REQUEST["aval"])) { $aval = (int) $_REQUEST["aval"]; $akhar = isset($_REQUEST["akhar"]) ? (int) $_REQUEST["akhar"] : -1; $cust->addTicketNumber($aval, $akhar); $msg = "با موفقیت افزوده شد"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
$alaki = ticket_class::addTmp($tmp->getId(), $tedad, $timeout); $tmp->setZarfiat($tedad); $_SESSION[conf::app . '_addTmp'][] = $alaki; } else { $alaki = $_SESSION[conf::app . '_addTmp'][$k]; } $tmp_id[] = $alaki; $adl_ghimat += $tmp->ghimat; $chd_ghimat += $tmp->ghimat; $inf_ghimat += $tmp->ghimat / 10; $poorsant += $tmp->ghimat * ($customer->getPoorsant($tmp->getId()) / 100); $k++; } $res_tmp = new reserve_tmp_class($alaki); $time_out = strtotime($res_tmp->tarikh . ' + 5 minute ') - strtotime(date("Y-m-d H:i:s")); $time_out = audit_class::secondToMinute($time_out); $adl_ghimat = enToPerNums(monize($adl_ghimat)); $chd_ghimat = enToPerNums(monize($chd_ghimat)); $inf_ghimat = enToPerNums(monize($inf_ghimat)); $poorsant = enToPerNums(monize($poorsant)); if ($ticket_type == 1) { $e_ticket = "<th colspan='1' >شماره تیکت</th>"; } else { $e_ticket = "<th colspan='1'></th>"; } $adults = <<<adul t<tr class="showgrid_row_odd"> <th class="showgrid_row_td_reserve_reserve">ردیف</th> t\t<th colspan='2' class="showgrid_row_td_reserve_reserve">بزرگسال</th> t\t<th colspan='1' class="showgrid_row_td_reserve_reserve">جنسیت</th> t\t{$e_ticket}
public function findFlights($add = 0) { $out = array(); $tmp = explode("id=\"GridView1\"", $this->html); if (count($tmp) == 2) { $lines = explode("\n", $tmp[1]); $flight_color = ''; for ($i = 1; $i < count($lines); $i++) { if (trim($lines[$i]) != '' && strpos($lines[$i], "<tr") !== FALSE) { $line_tmp = trim($lines[$i]); $line_tmp_x = explode('bgcolor="', $line_tmp); if (count($line_tmp_x) == 2) { $line_tmp_xx = explode('"', $line_tmp_x[1]); $flight_color = $line_tmp_xx[0]; } } if (trim($lines[$i]) != '' && strpos($lines[$i], "<td") !== FALSE) { $line = explode("</font>", $lines[$i]); $out_small = array(); foreach ($line as $line_tmp) { $out_small[] = strip_tags($line_tmp); } //$out_small[4+$add]!='FULL' && && trim($out_small[1+$add])!='تور' && trim($out_small[1+$add])!='دومسیر' && trim($out_small[1+$add])!='دومسير' && trim($out_small[1+$add])!='تلفنی' if ((int) $out_small[4 + $add] > 0 && trim($out_small[1 + $add]) == '') { $out_little = array(); $h = new havapeima_class(); $h->loadByName($out_small[12 + $add]); $out_little['havapeima'] = $h->id; $s = new shahr_class(); //$out_little['class'] = $out_small[12]; //$out_little['day'] = $out_small[11]; $d = explode(' ', $out_small[8 + $add]); $d = explode(' ', audit_class::hamed_pdateBack('13' . $d[0])); $out_little['date'] = $d[0]; $out_little['saat'] = $out_small[7 + $add]; $s->loadByName($out_small[6 + $add]); $out_little['mabda'] = $s->id; $s->loadByName($out_small[5 + $add]); $out_little['maghsad'] = $s->id; $out_little['tedad'] = $out_small[4 + $add] != 'FULL' ? $out_small[4 + $add] : 0; $out_little['ghimat'] = str_replace(',', '', $out_small[3 + $add]); $out_little['karmozd'] = trim(str_replace('%', '', $out_small[2 + $add])); $out_little['ghimat'] = (100 - $out_little['karmozd']) / 100 * $out_little['ghimat']; $out_little['ghimat'] = 1000 * ceil((int) $out_little['ghimat'] / 1000); $out_little['color'] = $flight_color; $out_little['noe'] = $out_small[1 + $add]; $p = new parvaz_class(); $p->shomare = $out_small[11 + $add]; $p->name = ''; $p->mabda_id = $out_little['mabda']; $p->maghsad_id = $out_little['maghsad']; $p->havapiema_id = $out_little['havapeima']; $p->ghimat_def = $out_little['ghimat']; $p->zarfiat_def = $out_little['tedad']; $p->saat_def = $out_little['saat']; $p->poor_def = $out_small[2 + $add]; $p->typ_def = 0; $p->mablagh_kharid_def = 0; $p->customer_id_det = -1; $p->rang = ''; $p->is_shenavar = 0; $p->ghimat_ticket = $out_little['ghimat']; $p->color = $flight_color; $p->noe = $out_little['noe']; $p->id = $p->add(); $out_little['parvaz'] = $p->id; //$out_little['masir_mokhalef'] = $out_small[2]; //$out_little['tarikh_mokhalef'] = $out_small[1]; unset($out_little['mabda']); unset($out_little['maghsad']); unset($out_little['havapeima']); $out_little['tozihat'] = $out_small[0]; //echo "proccessing ".$out_small[11+$add]."\n"; //echo "Noe = '".$out_little['noe']."' # '".trim($out_little['noe'])."'\n"; if ($out_little['noe'] != trim($out_little['noe'])) { //echo "Added\n"; $out[] = $out_little; } /* else { //var_dump($out_small); //echo "NotAdded\n"; } */ } } } } return $out; }
public function addTmp($parvaz_det_id, $tedad, $timeout, $netlog, $rwaitlog, $adlprice, $chdprice, $infprice, $adl, $chd, $inf, $customer_id = -1) { $mysql = new mysql_class(); $conf = new conf(); if ($customer_id <= 0) { if (isset($_SESSION[$conf->app . "_customer_id"])) { $customer_id = (int) $_SESSION[$conf->app . "_customer_id"]; } } $cust = new customer_class($customer_id); $parvaz_det = new parvaz_det_class((int) $parvaz_det_id); $free_zarfiat = $parvaz_det->getZarfiat(-1); $zakhire = 0; $zarfiat = 0; if ($free_zarfiat < $tedad) { $zakhire = $tedad - $free_zarfiat; } $zarfiat = $tedad; $arg["toz"] = "ثبت موقت برای پرواز شماره \n\t\t\t" . $parvaz_det->shomare . ' تاریخ ' . audit_class::hamed_pdate($parvaz_det->tarikh) . "\n\t\t\t\t\t\t\t\t به تعداد\n\t\t\t{$tedad}\n\t\t\t\t\t\t\t\t از طریق" . $cust->name; $arg["user_id"] = isset($_SESSION) ? $_SESSION[$conf->app . "_user_id"] : -1; $arg["host"] = $_SERVER["REMOTE_ADDR"]; $arg["page_address"] = $_SERVER["SCRIPT_NAME"]; $arg["typ"] = 4; log_class::add($arg); $tarikh = date("Y-m-d H:i:s"); $con = $mysql->ex_sqlx("insert into `reserve_tmp` (`parvaz_det_id`,`tedad`,`customer_id`,`zakhire`,`zarfiat`,`tarikh`,`timeout`,`netlog`,`rwaitlog`,`adlprice`,`chdprice`,`infprice`,`adltedad`, `chdtedad`, `inftedad`,`parvaz_det_info`) values ('{$parvaz_det_id}','{$tedad}','{$customer_id}','{$zakhire}','{$zarfiat}','{$tarikh}','{$timeout}','{$netlog}','{$rwaitlog}',{$adlprice},{$chdprice},{$infprice},{$adl},{$chd},{$inf},'" . serialize($parvaz_det) . "') ", FALSE); $out = $mysql->insert_id($con); $mysql->close($con); return $out; }