Beispiel #1
0
function reserve_tmp($user, $enc_pass, $parvaz_det_ids, $tedad)
{
    $out = "auth_error";
    if (user_class::is_authonticated($enc_pass, $user)) {
        $u = new user_class();
        $u->loadByUser($user);
        $timeout = 5;
        $parvaz_det_ids_array = explode(',', $parvaz_det_ids);
        $out_array = array();
        foreach ($parvaz_det_ids_array as $parvaz_det_id) {
            $out_array[] = ticket_class::addTmp($parvaz_det_id, $tedad, $timeout, $u->customer_id);
            $p = new parvaz_det_class($parvaz_det_id);
            $p->setZarfiat($tedad, $u->customer_id);
        }
        $out = count($out_array) > 0 ? implode('|', $out_array) : 'false';
    }
    return $out;
}
    $msg .= " تعداد شماره تیکت مشتری کافی نیست";
}
$out = "";
$adults = "";
$childs = "";
$infants = "";
$tmp_id = array();
if (!isset($_REQUEST["mod"])) {
    if ($msg == "") {
        $adl_ghimat = 0;
        $chd_ghimat = 0;
        $inf_ghimat = 0;
        $poorsant = 0;
        $radif = '۱';
        foreach ($selectedParvaz as $tmp) {
            $alaki = ticket_class::addTmp($tmp->getId(), $tedad);
            $tmp->setZarfiat($tedad);
            $tmp_id[] = $alaki;
            $adl_ghimat += $tmp->ghimat;
            $chd_ghimat += $tmp->ghimat;
            $inf_ghimat += $tmp->ghimat / 10;
            $poorsant += $tmp->ghimat * ($customer->getPoorsant($tmp->getId()) / 100);
        }
        $adl_ghimat = enToPerNums(monize($adl_ghimat));
        $chd_ghimat = enToPerNums(monize($chd_ghimat));
        $inf_ghimat = enToPerNums(monize($inf_ghimat));
        $poorsant = enToPerNums(monize($poorsant));
        $adults = <<<adul
\t\t\t\t<tr class="showgrid_row_odd">
                                        <th class="showgrid_row_td_reserve_reserve">ردیف</th>
\t\t\t\t\t<th colspan='3'\tclass="showgrid_row_td_reserve_reserve">بزرگسال</th>
Beispiel #3
0
 $hs_adl_ghimat = 0;
 $hs_chd_ghimat = 0;
 $hs_inf_ghimat = 0;
 $poorsant = 0;
 $radif = '۱';
 $k = 0;
 //var_dump($_SESSION);
 foreach ($selectedParvaz as $tmp) {
     $timeout = 5;
     if ($kharid_typ == 'naghdi') {
         $timeout = 15;
     }
     $moghim_res = moghim_class::checkselection((int) $tmp->subflid, (int) $tmp->customer_id, $adl, $chd, $inf);
     //var_dump($moghim_res);
     if ($moghim_res->checkselectionResult) {
         $alaki = ticket_class::addTmp($tmp->getId(), $tedad, $timeout, $moghim_res->netlog, $moghim_res->rwaitlog, $moghim_res->adlprice, $moghim_res->chdprice, $moghim_res->infprice, $adl, $chd, $inf);
         $mysql = new mysql_class();
         $mysql->ex_sql("select upghimat from parvaz_det left join agency on (moghim_code=customer_id) where parvaz_det.id=" . $tmp->getId(), $p);
         $upghimat = count($p) > 0 ? $p[0]['upghimat'] : 100000;
         $tmp->setZarfiat($tedad);
         $tmp_id[] = $alaki;
         $adl_ghimat += $moghim_res->adlprice + $upghimat;
         $chd_ghimat += $moghim_res->chdprice + $upghimat;
         $inf_ghimat += $moghim_res->infprice + $upghimat;
         $hs_adl_ghimat += $moghim_res->adlprice + $upghimat;
         $hs_chd_ghimat += $moghim_res->chdprice + $upghimat;
         $hs_inf_ghimat += $moghim_res->infprice + $upghimat;
         //$poorsant += $tmp->ghimat * ($customer->getPoorsant($tmp->getId())/100);
         $poorsant = 0;
         $k++;
     }
if (!isset($_REQUEST["mod"])) {
    if ($msg == "") {
        $adl_ghimat = 0;
        $chd_ghimat = 0;
        $inf_ghimat = 0;
        $poorsant = 0;
        $radif = '۱';
        $k = 0;
        //var_dump($_SESSION);
        foreach ($selectedParvaz as $tmp) {
            $timeout = 5;
            if ($kharid_typ == 'naghdi') {
                $timeout = 15;
            }
            if (!isset($_SESSION[conf::app . '_addTmp']) || count($_SESSION[conf::app . '_addTmp']) < count($selectedParvaz)) {
                $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);