} $path = implode(DIRECTORY_SEPARATOR, $pathTmp); $path .= DIRECTORY_SEPARATOR; include $path . 'class' . DIRECTORY_SEPARATOR . 'conf.php'; include $path . 'class' . DIRECTORY_SEPARATOR . 'mysql_class.php'; include $path . 'class' . DIRECTORY_SEPARATOR . 'audit_class.php'; include $path . 'class' . DIRECTORY_SEPARATOR . 'c_class.php'; include $path . 'class' . DIRECTORY_SEPARATOR . 'shahr_class.php'; include $path . 'class' . DIRECTORY_SEPARATOR . 'parvaz_class.php'; include $path . 'class' . DIRECTORY_SEPARATOR . 'parvaz_det_tmp_class.php'; include $path . 'class' . DIRECTORY_SEPARATOR . 'sites_class.php'; include $path . 'class' . DIRECTORY_SEPARATOR . 'havapeima_class.php'; include $path . 'jdf.php'; //----------------------------------------------------------------------------- $forbidden_colors = array(7 => array('#CCFFCC')); $sites = sites_class::load(); foreach ($sites as $i => $site) { $c = new c_class($site['url']); $c->forbidden_colors = isset($forbidden_colors[(int) $site['id']]) ? $forbidden_colors[(int) $site['id']] : array(); //echo "data from '".$site['url']."'\n"; $inp = $c->findFlights((int) $site['is_old'] > 0 ? 2 : 0); //var_dump($inp); //var_dump($inp); parvaz_det_tmp_class::add($inp, $site['id'], $site['ghimat']); } /* $inp=array(); $inp[] = array('date'=>"2014-5-19","saat"=>"23:59","tedad"=>"9","ghimat"=>1200000,"karmozd"=>"0","parvaz"=>28,"tozihat"=>""); $inp[] = array('date'=>"2014-5-18","saat"=>"15:30","tedad"=>"4","ghimat"=>900000,"karmozd"=>"3","parvaz"=>30,"tozihat"=>"ندارد"); parvaz_det_tmp_class::add($inp,2,0); $inp=array();
$selected_parvaz = $_REQUEST["selected_parvaz"]; $tmp = explode(",", $selected_parvaz); foreach ($tmp as $parvaz_id) { $tmp_parvaz = new parvaz_det_class((int) $parvaz_id); $selectedParvaz[] = $tmp_parvaz; } $customer = new customer_class((int) $_SESSION[$conf->app . "_customer_id"]); $isAdmin = $se->detailAuth('all'); $tedad = $adl + $chd; $jam_ghimat = 0; $tedad_ok = TRUE; $sites_id = -1; foreach ($tmp as $parvaz_id) { $tmp_parvaz = new parvaz_det_class((int) $parvaz_id); if ($sites_id < 0) { $sites_id = sites_class::loadByParvaz_det_id($tmp_parvaz->id); } //if(flightZarfiat($tmp_parvaz) < $tedad) if ($tmp_parvaz->zarfiat < $tedad) { $tedad_ok = FALSE; } /* if($tmp_parvaz->getZarfiat($customer->getId())<$tedad) $tedad_ok = FALSE; */ $jam_ghimat += $tedad * $tmp_parvaz->ghimat; $jam_ghimat += $inf * $tmp_parvaz->ghimat / 10; } $paravaz_tedad = count($tmp) > 0 ? TRUE : FALSE; $domasire_ok = TRUE; if (count($tmp) == 1 && (int) $tmp[0] <= 0) { $paravaz_tedad = FALSE;