include("../includes/confak.php");
//include("../includes/funcs.php");
//echo $_REQUEST["packfrom"];
//while (list ($key, $val) = each ($_REQUEST)) { echo "$key = $val \n";}
include("../includes/funcs15.php");
header('Content-type: text/html; charset=utf-8');
$my_pacs=array();
$koino =0;
if(!isset($_GET["packfrom"]) && !isset($_GET["packto"]) ){ $koino +=1;
$sqlall = mysql_query("SELECT package_id FROM agency_package_tbl WHERE package_status_id=1 AND odikws='on' ORDER BY package_priority, package_depart_1 ASC ");
$foundall=array();
while($rowall=mysql_fetch_array($sqlall)){ $foundall[] .= $rowall["package_id"]; }
$found = $foundall;
$found_koina=$foundall;
}else{
$found_koina=@array_merge(array_unique($found),array());
}
$zaehle = @array_count_values($found);
while(list($key, $val) = @each($zaehle)){
//echo $key . " kommt " . $val . ' mal vor.
';
if($val < $koino ){ $weg = array_search($key,$found_koina); unset($found_koina[$weg]); } //sucht im array u. loescht dat
}
//echo count($found_koina);
while(list($key, $val) = @each($found_koina)) { //damit keine leere Stelle im array bleibt:
$my_pacs[] .= $val;
}
$my_pacs = @array_reverse($my_pacs); // Dies damit die neuere Packete am Anfang stehen
/*
$dump = "SELECT * FROM agency_package_tbl WHERE package_status_id=1 ORDER BY package_to_country ";
$pacs = mysql_query($dump);
$rows2do = mysql_num_rows($pacs)/2;
*/
//$packs_photos = mysql_fetch_assoc(mysql_query("SELECT * FROM city_photos_tbl WHERE city_id='".$city["city_id"]."'"));
if(isset($_GET["packfrom"])){
$pack_from=mysql_fetch_assoc(mysql_query("SELECT city_id,city_name_el FROM city_tbl WHERE city_id='".$_GET["packfrom"]."' "));
if($pack_from["city_name_el"]!=""){ $apo_pou=" από ".$pack_from["city_name_el"]; }else{ $apo_pou=""; }
}
if(isset($_GET["packto"])){
$pack_to=mysql_fetch_assoc(mysql_query("SELECT country_id,country_name FROM country_tbl WHERE country_id='".$_GET["packto"]."' "));
$pros_pou=" για ".$pack_to["country_name"];
}
?>