define( array( index0 => "templates/index0.inc.html", index1empl => "templates/index1.inc.html", index1 => "templates/index1.inc.html", index1promo => "templates/index1promo.inc.html", index2empl => "templates/index2empl.inc.html", index2 => "templates/index2.inc.html", index2promo => "templates/index2.inc.html", index3empl => "templates/index3empl.inc.html", index3 => "templates/index3.inc.html", index4empl => "templates/index4.inc.html", index4 => "templates/index4.inc.html", option => "templates/option.inc.html", select => "templates/select.inc.html", radio => "templates/radio.inc.html", table => "templates/table.inc.html", table_row => "templates/table_row.inc.html", optionempl => "templates/optionempl.inc.html", optionloca => "templates/optionloca.inc.html" ) ); } ////////////////////////// function debug($ch) { global $debugphp; $iphost="82.232.77.76"; $ip=getenv(REMOTE_ADDR); if ($iphost==$ip) echo "$ch
"; } ////////////////////////////////////////////////////////// function nl22br($string) { // cut the value up by \n's $string=str_replace("\r\n","
",$string); $string=str_replace("\r","
",$string); $string=str_replace("\n","
",$string); return $string; } ////////////////////////////////////////////////////////// function nl($string) { // cut the value up by \n's $string=str_replace("\r\n","\n",$string); $string=str_replace("\r","\n",$string); $string=str_replace("\n","\n",$string); return $string; } ////////////////////////////////////////////////////////// function br22nl($string) { // cut the value up by \n's //echo "$string::"; $string=str_replace("
","\r\n",$string); $string=str_replace("
","\r",$string); //$string=htmlentities(str_replace("\n","
",$string)); //echo "string:$string
"; return $string; } //////////////////////////// function AfficheListeCamping($num,$nom,$nomtemplate) { global $tpl,$CAMPING; $tpl->assign(NOMSELECT,$nom); $tpl->assign(ONCHANGESELECT,"document.formulaire.etape.value='camping'");//;if (document.formulaire.".$nom.".value!=-1) document.forms[0].submit()"); if ($num=-1) $tpl->assign(OPTIONSELECTED, "SELECTED"); else $tpl->assign(OPTIONSELECTED, ""); /*$tpl->assign(OPTIONID, "-1"); $tpl->assign(OPTIONNOM, "Liste des campings"); $tpl->parse(OPTIONS, "option");*/ reset($CAMPING); //echo"AfficheListeCamping;$num
"; while ( list($key, $nomcamping) = each($CAMPING) ) { //if ($key==$num) $tpl->assign(OPTIONSELECTED, "SELECTED"); //else // $tpl->assign(OPTIONSELECTED, ""); $tpl->assign(OPTIONID, $key); $tpl->assign(OPTIONNOM, $nomcamping); $tpl->parse(OPTIONS, "option"); } $tpl->parse($nomtemplate, "select"); } //////////////////////////// function AfficheCamping($num,$nomliste,$nomtemplateliste,$nomcampingchoisi,$valeurcampingchoisi) { global $tpl,$CAMPING; $i=0; //echo"AfficheCamping;$num
"; reset($CAMPING); //while ( list($key, $nomcamping) = each($CAMPING) ) { // if ($i==$num) { $tpl->assign($nomtemplateliste, $CAMPING[$num]); //remplace la liste par le nom du camping choisi $tpl->assign($nomcampingchoisi, $nomliste); //le nom du champ cache est le nom de la liste $tpl->assign($valeurcampingchoisi,$num); //la valeur du champ cache est le nom du camping choisi $tpl->assign($nomliste,$CAMPING[$num]); // } // $i++; //} } ///////////////////////////////////////////////////////// function AfficheTypeSejour($typesejour,$langue) { global $tpl,$LANGUE; reset($LANGUE); //echo"AfficheTypeSejour:$typesejour
"; $tpl->assign(NOMRADIO,"typesejour"); if ($typesejour=="emplacement") $tpl->assign(RADIOCHECKED,"CHECKED"); else $tpl->assign(RADIOCHECKED,""); $tpl->assign(VALEURRADIO,"emplacement"); $tpl->assign(TEXTERADIO,$LANGUE[$langue][emplacement]); $tpl->assign(ONCLICKRADIO,"");//;document.forms[0].submit()\""); $tpl->parse(TYPESEJOUR1,radio); $tpl->assign(NOMRADIO,"typesejour"); if ($typesejour=="location") $tpl->assign(RADIOCHECKED,"CHECKED"); else $tpl->assign(RADIOCHECKED,""); $tpl->assign(VALEURRADIO,"location"); $tpl->assign(TEXTERADIO,$LANGUE[$langue][location]); $tpl->assign(ONCLICKRADIO,"");//;document.forms[0].submit()\""); $tpl->parse(TYPESEJOUR2,radio); /* $tpl->assign(NOMRADIO,"typesejour"); if ($typesejour=="locationhorssaison") $tpl->assign(RADIOCHECKED,"CHECKED"); else $tpl->assign(RADIOCHECKED,""); $tpl->assign(VALEURRADIO,"locationhorssaison"); $tpl->assign(TEXTERADIO,$LANGUE[$langue][locationhorssaison]); $tpl->assign(ONCLICKRADIO,"OnClick=\"document.formulaire.etape.value='camping'\"");//;document.forms[0].submit()\""); $tpl->parse(TYPESEJOUR3,radio);*/ /* $tpl->assign(NOMRADIO,"typesejour"); if ($typesejour=="promotion") $tpl->assign(RADIOCHECKED,"CHECKED"); else $tpl->assign(RADIOCHECKED,""); $tpl->assign(VALEURRADIO,"promotion"); $tpl->assign(TEXTERADIO,"Promotion"); $tpl->assign(ONCLICKRADIO,"OnClick=\"document.formulaire.etape.value='camping'\"");//;document.forms[0].submit()\""); $tpl->parse(TYPESEJOUR4,radio);*/ } //////////////////////////// function AfficheSejour($num,$nomsejour,$nomtemplatesejour1,$nomtemplatesejour2,$nomtemplatesejour3,$nomsejourchoisi,$valeursejourchoisi,$langue) { global $tpl,$LANGUE; reset($LANGUE); $i=1; //echo"AfficheSejour:$num
"; switch ($num) { case "emplacement": $nom=$LANGUE[$langue][emplacement]; break; case "location": $nom=$LANGUE[$langue][location]; break; case "locationhorssaison": $nom=$LANGUE[$langue][locationhorssaison]; break; case "promotion": $nom="Promotion"; break; } $tpl->assign($nomtemplatesejour2,""); $tpl->assign($nomtemplatesejour1, $nom); //remplace la liste par le nom du sejour choisi $tpl->assign($nomsejourchoisi, $nomsejour); //le nom du champ cache est le nom de la liste $tpl->assign($valeursejourchoisi,$num); //la valeur du champ cache est le nom du camping choisi $tpl->assign($nomsejour,$nom); } //////////////////////////// function AfficheJour($num,$nom,$nomtemplate) { global $tpl; $tpl->assign(NOMSELECT,$nom); $tpl->assign(ONCHANGESELECT,"VerifiePeriodeLocative(document.formulaire)"); $tpl->assign(OPTIONSELECTED, ""); $tpl->assign(OPTIONID, "-1"); $tpl->assign(OPTIONNOM, "Jour"); $tpl->parse(OPTIONS, "option"); $i=1; while($i<32) { if ($i==$num) $tpl->assign(OPTIONSELECTED, "SELECTED"); else $tpl->assign(OPTIONSELECTED, ""); if ($i<10) $ch="0".$i; else $ch=$i; $tpl->assign(OPTIONID, $ch); $tpl->assign(OPTIONNOM, $ch); $tpl->parse(OPTIONS, ".option"); $i++; } $tpl->parse($nomtemplate, "select"); } //////////////////////////// function AfficheMois($num,$nom,$nomtemplate) { global $tpl; $tpl->assign(NOMSELECT,$nom); $tpl->assign(ONCHANGESELECT,"VerifiePeriodeLocative(document.formulaire)"); $tpl->assign(OPTIONSELECTED, ""); $tpl->assign(OPTIONID, "-1"); $tpl->assign(OPTIONNOM, "Mois"); $tpl->parse(OPTIONS, "option"); $i=1; while($i<13) { if ($i==$num) $tpl->assign(OPTIONSELECTED, "SELECTED"); else $tpl->assign(OPTIONSELECTED, ""); if ($i<10) $ch="0".$i; else $ch=$i; $tpl->assign(OPTIONID, $ch); $mois=ucfirst(strftime("%B",mktime(0,0,0,$i,1,2000))); $tpl->assign(OPTIONNOM, $mois); $tpl->parse(OPTIONS, ".option"); $i++; } $tpl->parse($nomtemplate, "select"); } //////////////////////////// function AfficheAnnee($num,$nom,$nomtemplate) { global $tpl; $tpl->assign(NOMSELECT,$nom); $tpl->assign(ONCHANGESELECT,"VerifiePeriodeLocative(document.formulaire)"); $tpl->assign(OPTIONSELECTED, ""); $tpl->assign(OPTIONID, "-1"); $tpl->assign(OPTIONNOM, "Année"); $tpl->parse(OPTIONS, "option"); $i=2001; while($i<2010) { if ($i==$num) $tpl->assign(OPTIONSELECTED, "SELECTED"); else $tpl->assign(OPTIONSELECTED, ""); $tpl->assign(OPTIONID, $i); $tpl->assign(OPTIONNOM, $i); $tpl->parse(OPTIONS, ".option"); $i++; } $tpl->parse($nomtemplate, "select"); } //////////////////////////// function AfficheLoca($numcamping,$numloca,$langue) { global $tpl,$CAMPINGLOCA,$CAMPINGLOCA_UK,$LANGUE,$PLACELOCATIFMAX; reset($LANGUE); if ($langue=="uk") $campingloc=$CAMPINGLOCA_UK; else $campingloc=$CAMPINGLOCA; //echo ("
numcamping:".$numcamping); //echo"AfficheLoca;$numcamping
"; reset($campingloc); $j=0; while ( list($key, $val) = each($campingloc[$numcamping]) ) { $tpl->assign(DESCRIPTIF,$val); $tpl->assign(NOMRADIO,"locatif"); if ($j==$numloca) $tpl->assign(RADIOCHECKED,"CHECKED"); else $tpl->assign(RADIOCHECKED,""); $tpl->assign(VALEURRADIO,$key); $tpl->assign(TEXTERADIO,""); $tpl->assign(ONCLICKRADIO,"OnClick='document.forms[0].etape.value=2'"); $tpl->parse(RADIO,radio); $tpl->assign(PROMO,""); $tpl->assign(HIDDENPLACE,""); $tpl->parse(TABLE_ROWS, ".table_row"); $j++; } $tpl->assign(TEXTELOCATIFS,$LANGUE[$langue][locatifcorresp]); $tpl->parse(TABLELOCATIFS,"table"); } //////////////////////////// function AfficheLocaHorsSaison($numcamping,$langue) { global $tpl,$CAMPINGHORSSAISON,$LANGUE; //echo ("
numcamping:".$numcamping); //echo"AfficheLoca;$numcamping
"; reset($CAMPINGHORSSAISON); $i=0; //while ( list($nomcamping, $subarray) = each($CAMPINGHORSSAISON) ) { // if ($i==$numcamping) { $j=0; while ( list($key, $val) = each($CAMPINGHORSSAISON[$numcamping]) ) {//each($subarray) ) { $tpl->assign(DESCRIPTIF,$val); $tpl->assign(NOMRADIO,"locatif"); if ($j==0) $tpl->assign(RADIOCHECKED,"CHECKED"); else $tpl->assign(RADIOCHECKED,""); $tpl->assign(VALEURRADIO,$key); $tpl->assign(TEXTERADIO,""); $tpl->assign(ONCLICKRADIO,"OnClick='document.forms[0].etape.value=2'"); $tpl->parse(RADIO,radio); $tpl->parse(TABLE_ROWS, ".table_row"); $j++; } //} $i++; //} $tpl->assign(TEXTELOCATIFS,$LANGUE[$langue][locatifhorssaisoncorresp]); $tpl->parse(TABLELOCATIFS,"table"); } //////////////////////////// function LocationExiste($numcamping,$numlocatif) { global $CAMPINGLOCA; reset($CAMPINGLOCA[$numcamping]); $ret=false; while (list($key1, $val1) = each($CAMPINGLOCA[$numcamping]) ) { //echo "KEY:$key1, NUMLOCATIF:$numlocatif
"; if ($key1==$numlocatif) $ret=true; } return $ret; } ///////////////////////////////////////////// function AffichePromotion($numcamping,$langue) { global $tpl,$CAMPINGLOCA,$PROMO,$LANGUE; //echo ("
numcamping:".$numcamping); //echo"AfficheLoca;$numcamping
"; reset($PROMO); $j=0; while ( list($key, $valpromo) = each($PROMO) ) { //echo "NUMCAMPING:$numcamping ; NUMLOCATIF:".$valpromo[numloca]."
"; $ok=LocationExiste($numcamping,$valpromo[numloca]); if ($ok==true) { $nomlocatif=$CAMPINGLOCA[$numcamping][$valpromo[numloca]]; $tpl->assign(DESCRIPTIF,$nomlocatif." : Promo du ".$valpromo[datedeb]." au ".$valpromo[datefin]." : ".$valpromo[prix]." €
"); $tpl->assign(NOMRADIO,"locatif"); if ($j==0) $tpl->assign(RADIOCHECKED,"CHECKED"); else $tpl->assign(RADIOCHECKED,""); $tpl->assign(VALEURRADIO,$key); $tpl->assign(TEXTERADIO,""); $tpl->assign(ONCLICKRADIO,"OnClick='document.forms[0].etape.value=2'"); $tpl->parse(RADIO,radio); //$tpl->assign(PROMO,AffichePromo($key)); $tpl->parse(TABLE_ROWS, ".table_row"); $j++; } } $tpl->assign(TEXTELOCATIFS,$LANGUE[$langue][promotioncorresp]); $tpl->parse(TABLELOCATIFS,"table"); } //////////////////////////////////////////// function AfficheEmpl($numcamping,$numloca,$langue) { global $tpl,$CAMPINGEMPLACEMENT,$CAMPINGEMPLACEMENT_UK,$LANGUE; reset($LANGUE); //echo"AfficheEmpl
"; if ($langue=="uk") $campingempl=$CAMPINGEMPLACEMENT_UK; else $campingempl=$CAMPINGEMPLACEMENT; reset($campingempl); $j=0; //debug($campingempl[0][0].",".$campingempl[0][1].",".$campingempl[0][2]); while ( list($key, $val) = each($campingempl[$numcamping]) ) { //debug("DESCRIPTIF:$val"); $tpl->assign(DESCRIPTIF,$val); $tpl->assign(NOMRADIO,"locatif"); if ($j==$numloca) $tpl->assign(RADIOCHECKED,"CHECKED"); else $tpl->assign(RADIOCHECKED,""); $tpl->assign(VALEURRADIO,$key); $tpl->assign(TEXTERADIO,""); $tpl->assign(ONCLICKRADIO,"OnClick='document.forms[0].etape.value=2'"); $tpl->assign(HIDDENPLACE,""); $tpl->parse(RADIO,"radio"); $tpl->parse(TABLE_ROWS, ".table_row"); $j++; } $tpl->assign(TEXTELOCATIFS,$LANGUE[$langue][emplacementcorresp]); $tpl->parse(TABLELOCATIFS,"table"); } //////////////////////////////////////////////// function AfficheLocatifNum($typesejour,$locatif,$langue) { global $tpl, $EMPLACEMENT,$EMPLACEMENT_UK,$LOCATIF,$LOCATIF_UK,$PROMO,$LANGUE; if ($langue=="uk") { $empl=$EMPLACEMENT_UK; $loc=$LOCATIF_UK; } else { $empl=$EMPLACEMENT; $loc=$LOCATIF; } reset($empl); reset($loc); switch($typesejour) { case "emplacement": $tpl->assign(TYPESEJOUR,$LANGUE[$langue][emplacement]); while ( list($key, $val) = each($empl) ) { //echo ">$key==$locatif<
"; if ($key==$locatif) { $tpl->assign(TEXTELOCATIFS,$LANGUE[$langue][emplacementcorresp]); $tpl->assign(RADIO,""); $tpl->assign(DESCRIPTIF,stripslashes($val)); $tpl->assign(SEJOURCHOISI,stripslashes($val)); //$tpl->parse(TABLE_ROWS, ".table_row"); $tpl->assign(TABLELOCATIFS,stripslashes($val)); } } break; case "location": $tpl->assign(TYPESEJOUR,$LANGUE[$langue][location]); while ( list($key, $val) = each($loc) ) { //echo ">$key==$locatif<
"; if ($key==$locatif) { $tpl->assign(TEXTELOCATIFS,$LANGUE[$langue][locatifcorresp]); $tpl->assign(RADIO,""); $tpl->assign(DESCRIPTIF,$val); $tpl->assign(SEJOURCHOISI,$val); //$tpl->parse(TABLE_ROWS, ".table_row"); $tpl->assign(TABLELOCATIFS,$val); } } break; } //$tpl->parse(TABLELOCATIFS,"table"); } //////////////////////////////////////////////// function AfficheDevis($numcamping,$typesejour,$hebergement,$locatif,$nbpersonnes,$listeoccupants,$nbenfants,$listevoitures,$nbbebes,$nbanimaux,$raceanimaux,$nbvoitures,$nbremorques,$microonde,$refrigerateur,$nbelec,$nbtransat,$bordderiviere,$nbdemipension,$nbpetitdej,$climatisation,$nbdrappetit,$nbdrapgrand,$litbebe,$chaisebebe,$nbvelo,$assuranceannulation,$datedeb,$datefin,$langue) { global $tpl, $CAMPING,$PROMO,$PLACELOCATIFMAX,$LANGUE; debug("function AfficheDevis($numcamping,$typesejour,$hebergement,$locatif,$nbpersonnes,$listeoccupants,$nbenfants,$listevoitures,$nbbebes,$nbanimaux,$raceanimaux,$nbvoitures,$nbremorques,$microonde,$refrigerateur,$nbelec,$nbtransat,$bordderiviere,$nbdemipension,$nbpetitdej,$climatisation,$nblocationdrap,$litbebe,$chaisebebe,$nbvelo,$assuranceannulation,$datedeb,$datefin,$langue)"); reset($CAMPING); ////////////////////////////CALCUL MONTANT $nbjour=CalculDuree($datedeb,$datefin); $montant=0; switch($typesejour) { case "emplacement": list($acompte,$montant,$montantfrais)=CalculMontantEmplacement($numcamping,$typesejour,$locatif,$nbpersonnes,$nbenfants,$nbbebes,$nbanimaux,$nbremorques,$nbvoitures,$nbtransat,$refrigerateur,$bordderiviere,$nbelec,$nbeau,$assuranceannulation,$datedeb,$datefin,$langue); break; case "location": reset($PLACELOCATIFMAX); if ($nbpersonnes>$PLACELOCATIFMAX[$locatif]) $nbpersonnes=$PLACELOCATIFMAX[$locatif]; $tpl->assign(NBPERSONNES,$nbpersonnes); $tpl->assign(NBPERSONNESCHOISI,$nbpersonnes); list($acompte,$montant,$montantfrais)=CalculMontantLocation($numcamping,$typesejour,$locatif,$nbpersonnes,$nbenfants,$nbbebes,$nbanimaux,$nbremorques,$nbvoitures,$nbtransat,$microonde,$bordderiviere,$nbdemipension,$nbpetitdej,$climatisation,$nbdrappetit,$nbdrapgrand,$litbebe,$chaisebebe,$nbvelo,$assuranceannulation,$datedeb,$datefin,$langue); break; } $tpl->assign(PRIXFRAISDOSSIER,$montantfrais); $tpl->assign(TOTALSEJOUR,$montant); $tpl->assign(ACOMPTE,$acompte); } ///////////////////////////////////////////////// function CalculDuree($datedeb,$datefin) { $d=explode("/",$datedeb); $jourdeb=$d[0];$moisdeb=$d[1];$anneedeb=$d[2]; $d=explode("/",$datefin); $jourfin=$d[0];$moisfin=$d[1];$anneefin=$d[2]; list($annee,$mois,$jour) = split( '[-]', $row[date] ); $msPerDay = 24 * 60 * 60 ; // Number of seconds per day $d=(mktime(0,0,0,$moisfin,$jourfin,$anneefin)-mktime(0,0,0,$moisdeb,$jourdeb,$anneedeb))/ $msPerDay; $daysLeft = round($d) ; //echo "calculduree:$jourdeb/$moisdeb/$anneedeb,$jourfin/$moisfin/$anneefin=$daysLeft"; return $daysLeft; } ///////////////////////////////////////////////// function TrouvePeriode($listecamping,$typesejour) { global $PERIODESAISONLOCA,$PERIODESAISONEMPL,$PERIODEHORSSAISONLOCA; reset($PERIODESAISONLOCA); reset($PERIODEHORSSAISONLOCA); reset($PERIODESAISONEMPL); switch($typesejour) { case "emplacement": //echo "emplacement"; $res=$PERIODESAISONEMPL; break; case "location": $res=$PERIODESAISONLOCA; break; case "locationhorssaison": $res=$PERIODEHORSSAISONLOCA; break; } return $res; } /////////////////////////////////////// function CalculMontantEmplacement($numcamping,$typesejour,$locatif,$nbpersonnes,$nbenfants,$nbbebes,$nbanimaux,$nbremorques,$nbvoitures,$nbtransat,$refrigerateur,$bordderiviere,$nbelec,$nbeau,$assuranceannulation,$datedeb,$datefin,$langue) { global $tpl,$PERIODEEMPL,$TARIFEMPL,$PLACEEMPLMIN,$ARRHESEMPL,$LANGUE,$PRIXASSURANCEANNULATIONEMPLACEMENT,$NBVOITUREGRATUITE; $montant=0;$montantass=0;$montantfrais=0;$montantbracelet=0; //$p=TrouvePeriodeEmpl($datedeb,$datefin); $dureetotal=0; reset($PERIODEEMPL); $nbperiode=count($PERIODEEMPL); debug("nbperiode:$nbperiode
"); if ($nbvoitures>0) $nbvoitures=$nbvoitures-$NBVOITUREGRATUITE; $montant1=0;$montant2=0;$montant3=0;$montant4=0;$montant5=0;$montant6=0;$montant7=0;$montant8=0;$montant9=0;$montant10=0;$montant11=0;$montant12=0; while ( list($keyperiode, $val) = each($PERIODEEMPL) ) { list($deb, $val1) = each($val) ; list($fin, $val2) = each($val) ; $DateDebutPeriode1=$val1; $DateFinPeriode1=$val2; $numperiode=$keyperiode; $duree=0; debug("numperiode:$numperiode:$DateDebutPeriode1::$DateFinPeriode1"); //Calcul Periode 1 if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateDebutPeriode1,$datefin)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { debug("Periode Util:$DateDebutPeriode1,$datefin
"); $duree=CalculDuree($DateDebutPeriode1,$datefin); } if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { debug("Periode Util:$DateDebutPeriode1,$DateFinPeriode1
"); $duree=CalculDuree($DateDebutPeriode1,$DateFinPeriode1); } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { debug("Periode Util:$datedeb,$datefin
"); $duree=CalculDuree($datedeb,$datefin); } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>=0) && (CalculDuree($datedeb,$DateFinPeriode1)>0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { debug("Periode Util:$datedeb,$DateFinPeriode1
"); $duree=CalculDuree($datedeb,$DateFinPeriode1); } reset($TARIFEMPL); debug("duree:$duree
"); $nbpersmax=$PLACEEMPLMIN[$locatif]; $nbpers=$nbpersonnes+$nbenfants; $nbenf=$nbbebes; debug("nbpersmax:$nbpersmax,$nbpers,$nbenf
"); //$nbenf10=$nbenfants10; //$nbenf5=$nbenfants5; ////pas de frais pour premiere et derniere periode //if (($numperiode!=0)&&($numperiode!=($nbperiode-1))) $dureetotal=$dureetotal+$duree; /* 0:forfait 1 1:forfait 2 2:forfait 3 3:forfait 4 4;forfait 5 5:personne>5 6:personne <5 7:chien 8:vehicule sup 9:electricite 10:remorque/moto 11:borddreviere frais si > 3 nuits */ while ( list($key, $val) = each($TARIFEMPL[$numperiode]) ) { debug("key:".$key); //Montant forfait if ($key==$locatif) $montant1+=$val*$duree; //Montant Pers adulte Supp $nbperssup=$nbpers-$nbpersmax; if ($nbperssup<0) $nbperssup=0; if (($nbperssup>0) && ($key==5)) $montant2+=$val*$duree*($nbperssup); //Montant Pers enfant <5 Supp $nbenfsup=($nbpers-$nbperssup+$nbenf-$nbpersmax); if ($nbenfsup<0) $nbenfsup=0; if (($nbenfsup>0) && ($key==6)) $montant2b+=$val*$duree*($nbenfsup); //Montant Pers enfant <5 ans Supp /* if ($nbbebessup<0) $nbbebessup=0; if (($nbbebessup>0) && ($key==6)) $montant2c+=$val*$duree*($nbbebessup); */ //Montant Pers enfant <5 Supp //$nbenf5sup=($nbpers-$nbperssup+$nbenf17-$nbenf17sup+$nbenf10-$nbenf10sup+$nbenf5-$nbpersmax); //if ($nbenf5sup<0) $nbenf5sup=0; //if (($nbenf5sup>0) && ($key==4)) // $montant2d=$val*$duree*($nbenf5sup); //Montant Bebe //if ($key==31) // $montant3b=$val*$duree*($nbbebes); //Montant Animaux if (($key==7) && ($nbanimaux>0)) $montant6+=$val*$duree*$nbanimaux; //Montant voiture if (($key==8)) $montant7+=$val*$duree*($nbvoitures); //Montant electricité if (($key==9)&& ($nbelec=="oui")) $montant8+=$val*$duree; //Montant remorque if (($key==10)&& ($nbremorques>0)) $montant9+=$val*$duree*($nbremorques); //bord de riviere if (($key==11)&& ($bordderiviere=="oui")) $montant10+=$val*$duree; //refrigerateur if (($refrigerateur=="oui")&&(strcmp($key,"refrigerateur")==0)) { debug("refrigerateur key:$key refrigerateur:$refrigerateur".$val."*".$duree); $montant11+=$val*$duree; } //transat if (($key=="transat")&& ($nbtransat>0) ) $montant12+=round(($val*$duree*$nbtransat)/7,2);//$val= par semaine //Montant electric //if (($key==5)&& ($nbelec>0)) // $montant5=$val*$duree; //Montant eau usee //if ($key==7) // $montant7=$val*$duree*$nbeau; // if (($key=="bracelet")&&($nbbracelets>0)) // $montantbracelet=$TARIFEMPL[$numperiode]["bracelet"]*$nbbracelets; //$montantfrais=0; //pas de frais pour la premiere et derniere periode // if ( ($numperiode>0) && ($numperiode<($nbperiode-1)) && ($key=="frais") && ($duree>0) ) { $montantfrais=$TARIFEMPL[$numperiode]["frais"]; // debug("montantfrais($numperiode,$nbperiode,$key,$duree)=$montantfrais"); // $montantbracelet=$TARIFEMPL[$numperiode]["bracelet"]*$nbbracelets; // debug("montantbracelet($numperiode,$nbperiode,$key,$duree)=$montantbracelet"); // } } debug("Montantforfait=$montant1=".$TARIFEMPL[$numperiode][$locatif]."*$duree"); debug("MontantPersSupp($nbpers::$nbperssup)=$montant2"); debug( "MontantenfantSupp($nbenfants::$nbenfsup)=$montant2b"); debug( "MontantbebeSupp($nbbebes::$nbbebessup)=$montant2c"); //debug( "Montantenfant10Supp($nbenfants10::$nbenf10sup)=$montant2c"); //debug( "Montantenfant5Supp($nbenfants5::$nbenf5sup)=$montant2d"); //debug( "MontantenfantSupp($nbbebes)=0"); debug( "MontantVoiture($nbvoitures)=$montant7"); debug( "MontantRemorqSupp($nbremorques)=$montant9"); debug( "MontantElec($nbelec)=$montant8"); debug( "MontantAnimaux($nbanimaux)=$montant6"); debug( "Montant Bord de riviere($bordderiviere)=$montant10"); debug( "Montant frigo($refrigerateur)=$montant11"); debug( "Montant transat($nbtransat)=$montant12"); } $montantsejour=$montant1+$montant2+$montant2b+$montant2c+$montant2d+$montant3+$montant4+$montant5+$montant6+$montant7; $montantoptions=$montant8+$montant9+$montant10+$montant11+$montant12; if ($montantsejour>0) { //calcul frais $nbsem=round($dureetotal/7); debug("nbsem:$nbsem"); if ($assuranceannulation=="oui") $montantass=$PRIXASSURANCEANNULATIONEMPLACEMENT*($nbpersonnes+$nbenfants+$nbbebes); debug( "Montantass($assuranceannulation):$montantass"); $montanttotal=$montantsejour+$montantoptions+$montantfrais+$montantass;//echo "montantfrais=$montantfrais
"; $arrhes=(($ARRHESEMPL/100)*$montantsejour)+$montantoptions+$montantfrais+$montantass; ///creation de la chaine de car du montant et detail } else $montanttotal=$LANGUE[$langue][mauvaiseperiode]; return array($arrhes,$montanttotal,$montantfrais); } /////////////////////////////////////////// function TrouvePeriodeEmpl($datedeb,$datefin) { global $PERIODEEMPL; reset($PERIODEEMPL); $num=-1; //echo "TrouvePeriodeEmpl($datedeb,$datefin)"; while ( list($periode, $subarray) = each($PERIODEEMPL) ) { list($deb, $DateDebutPeriode1) = each($subarray) ; list($fin, $DateFinPeriode1) = each($subarray) ; if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateDebutPeriode1,$datefin)>0) && (CalculDuree($datefin,$DateFinPeriode1)>0) ) { //echo "Periode Util:$DateDebutPeriode1,$datefin
";//$duree=CalculDuree($DateDebutPeriode1,$datefin); $num=$periode; } if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { //echo "Periode Util:$DateDebutPeriode1,$DateFinPeriode1
";//$duree=CalculDuree($DateDebutPeriode1,$DateFinPeriode1); $num=$periode; } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { //echo "Periode Util:$datedeb,$datefin
";//$duree=CalculDuree($datedeb,$datefin); $num=$periode; } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>0) && (CalculDuree($datedeb,$DateFinPeriode1)>0) && (CalculDuree($DateFinPeriode1,$datefin)>0) ) { //echo "Periode Util:$datedeb,$DateFinPeriode1
";//$duree=CalculDuree($datedeb,$DateFinPeriode1); $num=$periode; } } return $num; } /////////////////////////////////////////// function TrouvePeriodeLoca($datedeb,$datefin) { global $PERIODELOCA; reset($PERIODELOCA); $num=-1; //echo "TrouvePeriodeLoca($datedeb,$datefin)"; while ( list($periode, $subarray) = each($PERIODELOCA) ) { list($deb, $DateDebutPeriode1) = each($subarray) ; list($fin, $DateFinPeriode1) = each($subarray) ; if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateDebutPeriode1,$datefin)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { //if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateDebutPeriode1,$datefin)>0) && (CalculDuree($datefin,$DateFinPeriode1)>0) ) { //echo "Periode Util:$DateDebutPeriode1,$datefin
";//$duree=CalculDuree($DateDebutPeriode1,$datefin); $num=$periode; } if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { //echo "Periode Util:$DateDebutPeriode1,$DateFinPeriode1
";//$duree=CalculDuree($DateDebutPeriode1,$DateFinPeriode1); $num=$periode; } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { //echo "Periode Util:$datedeb,$datefin
";//$duree=CalculDuree($datedeb,$datefin); $num=$periode; } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>=0) && (CalculDuree($datedeb,$DateFinPeriode1)>0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { //echo "Periode Util:$datedeb,$DateFinPeriode1
";//$duree=CalculDuree($datedeb,$DateFinPeriode1); $num=$periode; } } return $num; } /////////////////////////////////////// function AjouteDateJour($date,$nbjour) { $d=explode("/",$date); $dd=date("d/m/Y", mktime (0,0,0,$d[1],$d[0]+$nbjour,$d[2])); //echo "DATE=$dd
"; return $dd; } ///////////////////////////////////////$numcamping,$typesejour,$locatif,$nbpersonnes,$nbenfants,$nbanimaux,$datedeb,$datefin,$langue function CalculMontantLocation($numcamping,$typesejour,$locatif,$nbpersonnes,$nbenfants,$nbbebes,$nbanimaux,$nbremorques,$nbvoitures,$nbtransat,$microonde,$bordderiviere,$nbdemipension,$nbptitdej,$climatisation,$nbdrappetit,$nbdrapgrand,$litbebe,$chaisebebe,$nbvelo,$assuranceannulation,$datedeb,$datefin,$langue) { global $tpl,$TARIFLOCA,$ARRHESLOCA,$LANGUE,$PERIODELOCA,$TARIFLOCA2NUIT,$TARIFLOCANUITSUPP,$PLACELOCATIFMIN,$PLACELOCATIFMAX,$PRIXASSURANCEANNULATIONLOCATION,$NBVOITUREGRATUITE; reset($TARIFLOCA); debug("function CalculMontantLocation($numcamping,$typesejour,$locatif,$nbpersonnes,$nbenfants,$nbanimaux,$nbremorques,$nbvoitures,$nbtransat,$microonde,$bordderiviere,$nbdemipension,$nbptitdej,$climatisation,$nbdrappetit,$nbdrapgrand,$litbebe,$chaisebebe,$nbvelo,$assuranceannulation,$datedeb,$datefin,$langue"); $dated=$datedeb; $datef=AjouteDateJour($datedeb,7); $numsem=0;$montantfrais=0;$montant=0;$montantass=0;$montantbracelet=0; $nbsemainetotal=0; $dureetotal=abs(CalculDuree($datedeb,$datefin)); $nbsemainetotal=ceil($dureetotal/7); debug("locatif:$locatif"); $nbpersmax=$PLACELOCATIFMAX[$locatif]; $nbpersmin=$PLACELOCATIFMIN[$locatif]; debug("nbpersmax:$nbpersmax,nbpersmin:$nbpersmin"); $nbperstotal=$nbpersonnes+$nbenfants; debug("nbperstotal:$nbperstotal"); $nbperssup=$nbperstotal-$nbpersmin; if (($nbperssup)>2) $nbperssup=2; if (($nbperssup)<0) $nbperssup=0; //Montant Pers enfant <12 Supp $nbenfsup=($nbperstotal-$nbperssup-$nbpersmax); if ($nbenfsup<0) $nbenfsup=0; if ($nbvoitures>0) $nbvoitures=$nbvoitures-$NBVOITUREGRATUITE; reset($PERIODELOCA); $montantmicroonde=0;$montanttransat=0;$montantbordderiviere=0;$montantsem=0;$montantanimaux=0;$montantvoiture=0;$montantperssup=0;$montantenfsup=0;$montant2nuitperssup=0;$montantnuitperssup=0; while ( list($key, $val) = each($PERIODELOCA) ) { list($deb, $val1) = each($val) ; list($fin, $val2) = each($val) ; $DateDebutPeriode1=$val1; $DateFinPeriode1=$val2; $numperiode=$key; $duree=0; //echo "numperiode:$numperiode:$DateDebutPeriode1::$DateFinPeriode1
"; //Calcul Periode 1 if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateDebutPeriode1,$datefin)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { //echo "Periode Util:$DateDebutPeriode1,$datefin
"; $duree=CalculDuree($DateDebutPeriode1,$datefin); $dated=$DateDebutPeriode1;$datef=$datefin; } if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { //echo "Periode Util:$DateDebutPeriode1,$DateFinPeriode1
"; $duree=CalculDuree($DateDebutPeriode1,$DateFinPeriode1); $dated=$DateDebutPeriode1;$datef=$DateFinPeriode1; } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { //echo "Periode Util:$datedeb,$datefin
"; $duree=CalculDuree($datedeb,$datefin); $dated=$datedeb;$datef=$datefin; } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>=0) && (CalculDuree($datedeb,$DateFinPeriode1)>0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { //echo "Periode Util:$datedeb,$DateFinPeriode1
"; $duree=CalculDuree($datedeb,$DateFinPeriode1); $dated=$datedeb;$datef=$DateFinPeriode1; } debug("Periode init:$DateDebutPeriode1:$DateFinPeriode1: $duree"); if ($duree>0) { ///horsaison 1er periode 2eme periode et derniere periode // if (($numperiode==0)||($numperiode==1)||($numperiode>=(count($PERIODELOCA)-1))) { // } // else { $montantfraiss=$TARIFLOCA[$numperiode]["frais"]; //$datef=AjouteDateJour($dated,7); $datefinfin=$datef; $datef=$dated; debug("debut calcul periode saison"); while(CalculDuree($datefinfin,$datef)<0) { $dureecalcul=CalculDuree($datef,$datefinfin); debug("Periode calcul Saison: $datef -> $datefinfin:".$dureecalcul); if ($dureecalcul>=7) { $nbsemaine=1;//(int)($duree/7); $nbjourrestant=0; $montantsem=$nbsemaine*$TARIFLOCA[$numperiode][$locatif]; $montantlocavelo=$TARIFLOCA[$numperiode][velosem]*$nbvelo*($nbsemaine); } else { $nbjourrestant=$dureecalcul; $nbsemaine=$nbjourrestant/7; /////prorata $montantsem=$nbjourrestant*($TARIFLOCA[$numperiode][nuit][$locatif]); $montantlocavelo=$TARIFLOCA[$numperiode][velojour]*$nbvelo*$nbjourrestant; } debug("nbjourrestant:$nbjourrestant"); $montantperssup=$TARIFLOCA[$numperiode]["personne"]*$nbperssup*($nbsemaine); //$montantenfsup=$TARIFLOCA[$numperiode]["enfant"]*$nbenfsup*($nbsemaine); $montantanimaux=$TARIFLOCA[$numperiode][animal]*$nbanimaux*($nbsemaine); $montantdemipension=$TARIFLOCA[$numperiode][demipension]*$nbdemipension*($nbsemaine)*7; $montantptitdej=$TARIFLOCA[$numperiode][ptitdej]*$nbptitdej*($nbsemaine)*7; if (($chaisebebe=="oui")&&($litbebe=="oui")) { $montantpackbebe=$TARIFLOCA[$numperiode][packbebe]*($nbsemaine); } else { if ($chaisebebe=="oui") $montantchaisebebe=$TARIFLOCA[$numperiode][chaisebebe]*($nbsemaine); if ($litbebe=="oui") $montantlitbebe=$TARIFLOCA[$numperiode][litbebe]*($nbsemaine); } if ($climatisation=="oui") $montantclim=$TARIFLOCA[$numperiode][climatisation]*($nbsemaine); $montantlocadrap=($TARIFLOCA[$numperiode][drappetit]*$nbdrappetit+$TARIFLOCA[$numperiode][drapgrand]*$nbdrapgrand)*($nbsemaine); if ($bordderiviere=="oui") $montantbordderiviere=$TARIFLOCA[$numperiode][bordderiviere]*($nbsemaine); if ($nbtransat>0) $montanttransat=$TARIFLOCA[$numperiode][transat]*($nbsemaine)*$nbtransat; if ($microonde=="oui") $montantmicroonde=$TARIFLOCA[$numperiode][microonde]*($nbsemaine); $montantvoiture=$TARIFLOCA[$numperiode][voiture]*$nbvoitures*($nbsemaine); $dated=$datef; $datef=AjouteDateJour($dated,7); debug("Periode Saison: $datef -> $DateFinPeriode1:".CalculDuree($DateFinPeriode1,$datef)); //debug("montant arrhes loca : $montantarrheslocas / montant frais saison : $montantfraiss"); debug("nbperssup:$nbperssup
Montantsem($nbsemaine)=$montantsem
montantperssupp($montantperssup)"); debug("montantenfsup:$montantenfsup
montant2nuit($nb2jour):$montant2nuit
montant2nuitperssup($montant2nuitperssup):"); debug("montantnuitsupp($duree):$montantnuitsupp
montantnuitperssup($montantnuitperssup)"); debug("montantbordderiviere=$montantbordderiviere"); debug("montantvoiture:$montantvoiture"); debug("montantdemipension $nbdemipension:$montantdemipension"); debug("montantptitdej $nbptitdej:$montantptitdej"); debug("montantpackbebe:$montantpackbebe"); debug("montantlitbebe:$montantlitbebe"); debug("montantchaisebebe:$montantchaisebebe"); debug("montantclim:$montantclim"); debug("montantlocavelo $nbvelo:$montantlocavelo"); debug("montantlocadrap $nbdrap:$montantlocadrap"); debug("montantmicroonde :$montantmicroonde"); debug("montanttransat $nbtransat:$montanttransat"); debug("montantchien:$montantanimaux
numsem:$numsem"); $tmontantsem+=$montantsem; $tmontantperssup+=$montantperssup; $tmontantenfsup+=$montantenfsup; $tmontantanimaux+=$montantanimaux; $tmontantdemipension+=$montantdemipension; $tmontantptitdej+=$montantptitdej; $tmontantpackbebe+=$montantpackbebe; $tmontantchaisebebe+=$montantchaisebebe; $tmontantlitbebe+=$montantlitbebe; $tmontantclim+=$montantclim; $tmontantdemipension+=$montantdemipension; $tmontantlocavelo+=$montantlocavelo; $tmontantlocadrap+=$montantlocadrap; $tmontantbordderiviere+=$montantbordderiviere; $tmontanttransat+=$montanttransat; $tmontantmicroonde+=$montantmicroonde; $tmontantvoiture+=$montantvoiture; } } } $montantsejour=$tmontantsem+$tmontantvoiture+$tmontantperssup+$tmontantanimaux; $montantoptions=$tmontanttransat+$tmontantmicroonde+$tmontantbordderiviere+$tmontantdemipension+$tmontantptitdej+$tmontantlocadrap+$tmontantlocavelo+$tmontantchaisebebe+$tmontantlitebebe+$tmontantpackbebe+$tmontantclim; $montantsejour=round($montantsejour,2); $montantoptions=round($montantoptions,2); if ($montantsejour>0) { if ($assuranceannulation=="oui") $montantass=$PRIXASSURANCEANNULATIONLOCATION*($nbsemainetotal); debug("montantass:$montantass"); $montantfrais=$TARIFLOCA[0]["frais"];//*$nbsemainetotale; debug("montantfrais:$montantfrais"); $montanttotal=$montantsejour+$montantoptions+$montantfrais+$montantass;//echo "montantfrais=$montantfrais
"; $arrhes=(($ARRHESLOCA/100)*$montantsejour)+$montantoptions+$montantfrais+$montantass; $arrhes=round($arrhes,2); } else $montanttotal=$LANGUE[$langue][mauvaiseperiode]; return array($arrhes,$montanttotal,$montantfrais); } ///////////////////////////////////////$numcamping,$typesejour,$locatif,$nbpersonnes,$nbenfants,$nbanimaux,$datedeb,$datefin,$langue function CalculMontantLocationHorsSaison($numcamping,$typesejour,$locatif,$nbpersonnes,$nbenfants,$nbanimaux,$nbremorques,$nbvoitures,$bordderiviere,$assuranceannulation,$datedeb,$datefin,$langue) { global $tpl,$TARIFLOCAHORSSAISON,$ARRHESLOCA,$LANGUE,$PERIODEHORSSAISONLOCA,$PLACELOCATIFMIN,$PLACELOCATIFMAX,$PRIXASSURANCEANNULATIONLOCATION,$NBVOITUREGRATUITE; reset($TARIFLOCAHORSSAISON); $dated=$datedeb; $datef=$datefin;//AjouteDateJour($datedeb,7); $numsem=0;$montantfrais=0;$montant=0;$montantass=0;$montantbracelet=0; $dureetotale=0; reset($PERIODEHORSSAISONLOCA); if ($nbvoitures>0) $nbvoitures=$nbvoitures-$NBVOITUREGRATUITE; while ( list($key, $val) = each($PERIODEHORSSAISONLOCA) ) { list($deb, $val1) = each($val) ; list($fin, $val2) = each($val) ; $DateDebutPeriode1=$val1; $DateFinPeriode1=$val2; $numperiode=$key; $duree=0; //echo "numperiode:$numperiode:$DateDebutPeriode1::$DateFinPeriode1
"; //Calcul Periode 1 if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateDebutPeriode1,$datefin)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { //echo "Periode Util:$DateDebutPeriode1,$datefin
"; $duree=CalculDuree($DateDebutPeriode1,$datefin); } if ( (CalculDuree($datedeb,$DateDebutPeriode1)>=0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { //echo "Periode Util:$DateDebutPeriode1,$DateFinPeriode1
"; $duree=CalculDuree($DateDebutPeriode1,$DateFinPeriode1); } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>0) && (CalculDuree($datefin,$DateFinPeriode1)>=0) ) { //echo "Periode Util:$datedeb,$datefin
"; $duree=CalculDuree($datedeb,$datefin); } if ( (CalculDuree($DateDebutPeriode1,$datedeb)>=0) && (CalculDuree($datedeb,$DateFinPeriode1)>0) && (CalculDuree($DateFinPeriode1,$datefin)>=0) ) { //echo "Periode Util:$datedeb,$DateFinPeriode1
"; $duree=CalculDuree($datedeb,$DateFinPeriode1); } debug("duree:$duree"); debug("locatif:$locatif"); $nbpersmin=$PLACELOCATIFMIN[$locatif]; debug("nbpersmax:$nbpersmax"); $nbperstotal=$nbpersonnes+$nbenfants; debug("nbperstotal:$nbperstotal"); $nbperssup=$nbpersonnes-$nbpersmin; if (($nbperssup)>2) $nbperssup=2; if (($nbperssup)<0) $nbperssup=0; //Montant Pers enfant <12 Supp $nbenfsup=($nbperstotal-$nbperssup-$nbpersmax); if ($nbenfsup<0) $nbenfsup=0; reset($TARIFLOCAHORSSAISON); $montantsem=0;$montantanimaux=0;$montantvoiture=0;$montantperssup=0;$montantenfsup=0;$montant2nuitperssup=0;$montantnuitperssup=0; //$nbsemaine=(int)($duree/7); if ($duree>=1) { $dureetotale+=$duree; //$duree=$duree-($nbsemaine*7); // Promotion $dureepromo=$duree; if ($duree>=28) $dureepromo=21; if ($duree>=21) $dureepromo=14; if ($duree>=14) $dureepromo=10; $montantsem=$TARIFLOCAHORSSAISON[$numperiode][$locatif]*$dureepromo; $montantperssup=$TARIFLOCAHORSSAISON[$numperiode]["personne"]*$nbperssup*($duree); $montantenfsup=$TARIFLOCAHORSSAISON[$numperiode]["enfant"]*$nbenfsup*($duree); $montantanimaux=$TARIFLOCAHORSSAISON[$numperiode][animal]*$nbanimaux*($duree); //$montantbracelet=$TARIFLOCAHORSSAISON[$numperiode][bracelet]*$nbbracelets*($duree); $montantvoiture=$TARIFLOCAHORSSAISON[$numperiode][voiture]*$nbvoitures*($duree); } debug("$numperiode:nbperssup:$nbperssup
Montantsem($nbsemaine)=$montantsem
montantperssupp($montantperssup):
montantenfsup($montantenfsup):
montant2nuit($nb2jour):$montant2nuit
montant2nuitperssup($montant2nuitperssup):
montantnuitsupp($duree):$montantnuitsupp
montantnuitperssup($montantnuitperssup)
montantbracelet=$montantbracelet
montantvoiture=$montantvoiture
montantfrais=$montantfrais
montantass:$montantass
numsem:$numsem
"); $montant=$montant+$montantperssup+$montantenfsup+$montantsem+$montantanimaux+$montantbracelet+$montantvoiture+$montant2nuit+$montant2nuitperssup+$montantnuitsupp+$montantnuitperssup; } if ($montant>0) { if (($assuranceannulation=="Oui")||($assuranceannulation=="Yes")) $montantass=$PRIXASSURANCEANNULATIONLOCATION; debug("montantass:$montantass"); $nbsem=round($dureetotale/7); debug("nbsem:$nbsem"); if ($nbsem==0) $nbsem=1; $montantfrais=$TARIFLOCAHORSSAISON[0]["frais"]; debug("montantfrais:$montantfrais"); //echo "ARRHESLOCA:$ARRHESLOCA
"; //debug(round(($ARRHESLOCA/100)*$montant,2)); //$arrhes=round(($ARRHESLOCA/100)*$montant,2)+$montantfrais+$montantass; $arrhes=$ARRHESLOCA*$nbsem; $montant=$montant+$montantfrais+$montantass;//echo "montantfrais=$montantfrais
"; $montantaregler=$arrhes+$montantfrais+$montantass; $montant="Montant du sejour : ".$montant." Euros
 
".$LANGUE[$langue][montantaregler]." : ".$montantaregler." Euros correspondant à
"; $montant.=$LANGUE[$langue][arrhes]." : $arrhes Euros
"; $montant.=$LANGUE[$langue][fraisresa].": $montantfrais Euros
"; if ($montantass>0) $montant.=$LANGUE[$langue][assuranceannulation]." : $montantass Euros"; } else $montant=$LANGUE[$langue][mauvaiseperiode]; $tpl->assign(PROMO,""); $tpl->assign(PRIXSEJOUR, $montant); return $montant; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function EnvoieEmailClient($mailClient){ global $mailClient,$post; include "simplemail.php"; $adr_envoyeur="info@auvallonrouge.com"; $mailClient=$post['email']; echo $mailClient; $adr_envoi=$mailClient; if (($adr_envoyeur!="")&& ($adr_envoi!="") ) { $msg="Madame, Monsieur,
Nous avons bien pris en compte votre réservation et vous en remercions.
Votre demande sera traité dans les plus brefs délais.

Le Camping Au Vallon Rouge
"; $sujet="Camping Vallon Rouge : Confirmation de votre réservation"; // fonction d'envoi du message $mail= new simplemail; $mail->addrecipient($adr_envoi); $mail->addfrom($adr_envoyeur); $mail->addsubject($sujet); // le message format html $mail->html =$msg; $mail_OK=$mail -> sendmail(); } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function EnvoieEmail($numcamping,$post,$totalsejour,$acompte,$paiement,$numcarte,$cryptocarte,$moisexpiration, $anneeexpiration,$langue) { global $tpl,$CAMPING,$FROM,$TO,$TO2,$SUBJECT,$LANGUE,$LOCATIF,$EMPLACEMENT; switch ($post['typesejour']) { case "emplacement": $typesejour="Emplacement"; $nomlocatif=$EMPLACEMENT[$post['locatif']]; break; case "location": $typesejour="Location"; $nomlocatif=$LOCATIF[$post['locatif']]; break; } reset($CAMPING); $camping=$CAMPING[$numcamping]; $corps="Demande de réservation\n"; $corps=$corps."du ".$post['datearrivee']." au ".$post['datedepart']."\n"; $corps=$corps."Type de séjour : $typesejour\n"; $corps=$corps."$nomlocatif\n"; $listevoitures="";$listeoccupants=""; for($i=1;$i<=2;$i++) { $nom0='marque'.$i; $immatr0='immatr'.$i; $listevoitures.="$i : ".$post['marque'.$i]." (".$post['immatr'.$i].")\n"; } for($i=1;$i<=6;$i++) { $nom0='nom'.$i; $prenom0='prenom'.$i; $age0='age'.$i; $listeoccupants.="$i : ".$post['nom'.$i]." ".$post['prenom'.$i]." (".$post['age'.$i].")\n"; } if ($post['typesejour']=="emplacement") { $corps=$corps."\nHebergement : ".$post['hebergement']."(Largeur : ".$post['largeur'].", Longueur : ".$post['longueur'].")"."\n"; $corps=$corps."Nb de personne >18 : ".$post['nbpersonnes']."\n"; $corps=$corps."Nb d'enfant de 5 à 18 ans : ".$post['nbenfants']."\n"; $corps=$corps."Nb d'enfant - 5 ans : ".$post['nbbebes']."\n"; $corps=$corps."Liste des occupants : \n".$listeoccupants."\n\n"; $corps=$corps."Nb d'animaux : ".$post['nbanimaux']." (Race : ".$post['raceanimaux'].")\n"; $corps=$corps."Electricite : ".$post['nbelec']."\n"; $corps=$corps."Nb de remorques ou moto : ".$post['nbremorques']."\n"; $corps=$corps."Nb de voitures : ".$post['nbvoitures']."\n"; if ($post['nbvoitures']>0) $corps=$corps."Liste des voitures : \n".$listevoitures."\n"; $corps=$corps."\nRéfrigérateur : ".$post['refrigerateur']."\n"; } else { $corps.="\nHebergement:".$LOCATIF[$post['locatif']]."\n"; $corps.="Nb de personne >18 : ".$post['nbpersonnes']."\n"; $corps.="Nb d'enfant de 5 à 18 ans : ".$post['nbenfants']."\n"; $corps.="Nb d'enfant - 5 ans : ".$post['nbbebes']."\n"; $corps.="Liste des occupants : \n".$listeoccupants."\n"; $corps.="Nb d'animaux : ".$post['nbanimaux']." (Race : ".$post['raceanimaux'].")\n"; $corps.="Nb de voitures : ".$post['nbvoitures']."\n"; if ($post['nbvoitures']>0) $corps.="Liste des voitures : \n".$listevoitures."\n"; $corps.="Demi-pension : ".$post['nbdemipension']."\n"; $corps.="Formule Petit Dejeuner : ".$post['nbpetitdej']."\n"; if ($post['locationdrap']=="oui") { $corps.="Location de Drap : \n"; $corps.="Lit Adulte : ".$post['nblocationdraplitadulte']."\n"; $corps.="Lit Enfant : ".$post['nblocationdraplitenfant']."\n"; } else $corps.="\nLocation de Drap : non\n"; if (($post['litbebe']=="oui")&& ($post['chaisebebe']=="oui")) $corps.="Pack bébé jusqu'à 16 kg : oui\n"; else { if ($post['litbebe']=="oui") $corps.="Lit bébé jusqu'à 16 kg : oui\n"; else $corps.="Lit bébé jusqu'à 16 kg : non\n"; if ($post['chaisebebe']=="oui") $corps.="Chaise bébé jusqu'à 16 kg : oui\n"; else $corps.="Chaise bébé jusqu'à 16 kg : non\n"; } if ($post['climatisation']=="oui") $corps.="\nClimatisation : oui\n"; else $corps.="Climatisation : non\n"; if ($post['locationvelo']=="oui") { $corps.="\nLocation de vélo : \n"; $corps.="Homme : ".$post['nblocationvelohomme']."\n"; $corps.="Femme : ".$post['nblocationvelofemme']."\n"; $corps.="Enfant : ".$post['nblocationveloenfant']."\n"; } else $corps.="\nLocation de vélo : non\n"; if ($post['microonde']=="oui") $corps.="\nMicro-onde : oui\n"; else $corps.="\nMicro-onde : ".$post[microonde]."\n"; } $corps.="Nb de Transat : ".$post['nbtransat']."\n"; if ($post['bordderiviere']=="oui") $corps.="En bordure de rivière : oui\n"; else $corps.="En bordure de rivière : non\n"; if ($post['assuranceannulation']=="oui") $corps.="Assurance Annulation : oui\n"; else $corps.="Assurance Annulation : non\n"; $corps=$corps."------------------------------------------------------------------\n"; $corps=$corps."Nom : ".$post['nom']."\n"; $corps=$corps."Prénom : ".$post['prenom']."\n"; $corps=$corps."Adresse : ".$post['adresse']."\n"; $corps=$corps."Code Postal : ".$post['cp']."\n"; $corps=$corps."Ville : ".$post['ville']." - "; $corps=$corps."Pays : ".$post['pays']."\n"; $corps=$corps."Téléphone : ".$post['telephone']."\n"; $corps=$corps."Email : ".$post['email']."\n"; $corps=$corps."Fumeur : ".$post['fumeur']."\n"; $corps=$corps."Comment nous avez vous connu ? : ".$post['$commentnousavezvousconnu']."\n"; $corps=$corps."Commentaires : ".$post['commentaires']."\n"; $corps=$corps."------------------------------------------------------------------\n"; $corps=$corps."MONTANT TOTAL DU SEJOUR : $totalsejour (hors taxe communale)\n"; $corps=$corps."ACOMPTE A LA RESERVATION : $acompte \n"; //$corps=$corps."\n".$LANGUE[$langue][attention]; //$corps=br22nl($corps); switch ($paiement) { case "cb": $corps=$corps."Paiement par Carte\n"; $corps=$corps."Numéro de Carte : $numcarte (Num Controle:$cryptocarte)\n"; //$corps=$corps."Nom du porteur : $nomporteur\n"; $corps=$corps."Date d'expiration : $moisexpiration/$anneeexpiration\n"; break; case "cheque": $corps=$corps."\nPaiement par Chèque\n"; break; case "chequevacance": $corps=$corps."\nPaiement par Chèque-Vacances\n"; break; case "virement": $corps=$corps."\nPaiement par Virement\n"; break; case "espece": $corps=$corps."\nPaiement par Espece\n"; break; } /*$corps.="\nVos commentaires :\n"; $corps.=$commentaire;*/ //echo "$corps
"; /////////////////// // composition du message $mailheaders = "From: <$FROM>\n"; //$mailheaders .= "Reply-To: <$adr_envoyeur>\n\n"; // fonction d'envoi du message $corps = html_entity_decode($corps); $mail_OK=mail($TO, $SUBJECT, $corps, $mailheaders); $mail_OK=mail($TO2, $SUBJECT, $corps, $mailheaders); // renvoie envoi_reussi à 1 si le mail a été envoyé // et 0 dans le cas contraire ! //$cmd2="perl /var/www/html/sites/www.francecom.com/php3/mailform/sendmail3.pl $FROM $TO '$SUBJECT' \"$corps\""; //$ret=system($cmd2,$ret2); if ($mail_OK==1) $tpl->assign(RESULTATMAIL,$LANGUE[$langue][okmail]); else $tpl->assign(RESULTATMAIL,$LANGUE[$langue][nokmail]); } //////////////////////////////////////////////////////////////////: function AfficheTexte($etape,$typesejour,$langue) { global $tpl,$LANGUE,$LIENRETOUR; reset($LANGUE); $tpl->assign(TITRE,$LANGUE[$langue][titre]); $tpl->assign(RETOUR,$LANGUE[$langue][retour]); $tpl->assign(LIENRETOUR,$LIENRETOUR); $tpl->assign(AVERTISSEMENT,$LANGUE[$langue][avertissement]); switch($etape) { case "4": $tpl->assign(ET_TITRE3,$LANGUE[$langue][titre3]); $tpl->assign(ET_DOSSIERINCOMPLE,$LANGUE[$langue][dossierincomple]); $tpl->assign(ET_DEMANDETRAITE,$LANGUE[$langue][demandetraite]); $tpl->assign(ET_BIENRECU,$LANGUE[$langue][demandetraite]); $tpl->assign(ET_CONTACTERONS,$LANGUE[$langue][contacterons]); $tpl->assign(ET_PRECEDENT,$LANGUE[$langue][precedent]); break; case "3": $tpl->assign(ET_TITRE3,$LANGUE[$langue][titre3]); $tpl->assign(ET_NOM,$LANGUE[$langue][nom]); $tpl->assign(ET_PRENOM,$LANGUE[$langue][prenom]); $tpl->assign(ET_ADRESSE,$LANGUE[$langue][adresse]); $tpl->assign(ET_CP,$LANGUE[$langue][cp]); $tpl->assign(ET_VILLE,$LANGUE[$langue][ville]); $tpl->assign(ET_PAYS,$LANGUE[$langue][pays]); $tpl->assign(ET_COMMENTAIRES,$LANGUE[$langue][commentaires]); $tpl->assign(ET_TELEPHONE,$LANGUE[$langue][telephone]); $tpl->assign(ET_EMAIL,$LANGUE[$langue][email]); $tpl->assign(ET_MENTIONVOITURE,$LANGUE[$langue][mentionvoiture]); $tpl->assign(ET_NBVOITURES,$LANGUE[$langue][nbvoitures]); $tpl->assign(ET_MARQUE,$LANGUE[$langue][marque]); $tpl->assign(ET_IMMATR,$LANGUE[$langue][immatr]); $tpl->assign(ET_MENTIONPERSONNE,$LANGUE[$langue][mentionpersonne]); $tpl->assign(ET_NBADULTE,$LANGUE[$langue][nbadulte]); $tpl->assign(ET_NBENFANT,$LANGUE[$langue][nbenfant]); $tpl->assign(ET_NBBEBE,$LANGUE[$langue][nbbebe]); $tpl->assign(ET_NBANIMAUX,$LANGUE[$langue][nbanimaux]); $tpl->assign(ET_RACEANIMAUX,$LANGUE[$langue][raceanimaux]); $tpl->assign(ET_NOM,$LANGUE[$langue][nom]); $tpl->assign(ET_PRENOM,$LANGUE[$langue][prenom]); $tpl->assign(ET_AGE,$LANGUE[$langue][age]); $tpl->assign(ET_FUMEUR,$LANGUE[$langue][fumeur]); $tpl->assign(ET_COMMENTCONNU,$LANGUE[$langue][commentconnu]); $tpl->assign(ET_COMMENTAIRES,$LANGUE[$langue][commentaires]); $tpl->assign(ET_PAIEMENT,$LANGUE[$langue][paiement]); $tpl->assign(ET_PAIEMENTCHEQUEVACANCE,$LANGUE[$langue][paiementchequevacance]); $tpl->assign(ET_PAIEMENTVIREMENT,$LANGUE[$langue][paiementvirement]); $tpl->assign(ET_PAIEMENTESPECE,$LANGUE[$langue][paiementespece]); $tpl->assign(ET_PAIEMENTDEVIS,$LANGUE[$langue][paiementdevis]); $tpl->assign(ET_PAIEMENTCARTE,$LANGUE[$langue][paiementcarte]); $tpl->assign(ET_NUMEROCARTE,$LANGUE[$langue][numerocarte]); $tpl->assign(ET_CRYPTOCARTE,$LANGUE[$langue][numcontrole]); $tpl->assign(ET_DATEEXPIRATION,$LANGUE[$langue][dateexp]); $tpl->assign(ET_MOISEXPIRATION,$LANGUE[$langue][mois]); $tpl->assign(ET_ANNEEEXPIRATION,$LANGUE[$langue][annee]); $tpl->assign(ET_OPTIONSCHOISIES,$LANGUE[$langue][optionschoisies]); $tpl->assign(ET_LESOPTIONS,$LANGUE[$langue][lesoptions]); if ($typesejour=="emplacement") { $tpl->assign(ET_LONGUEUR,$LANGUE[$langue][longueur]); $tpl->assign(ET_LARGEUR,$LANGUE[$langue][largeur]); $tpl->assign(ET_REFRIGERATEUR,$LANGUE[$langue][refrigerateur]); $tpl->assign(ET_NBELEC,$LANGUE[$langue][nbelec]); $tpl->assign(ET_NBREMORQUES,$LANGUE[$langue][nbremorques]); } else { $tpl->assign(ET_DEMIPENSION,$LANGUE[$langue][demipension]); $tpl->assign(ET_FORMULEPETITDEJ,$LANGUE[$langue][formulepetitdej]); $tpl->assign(ET_LOCATIONDRAP,$LANGUE[$langue][locationdrap]); $tpl->assign(ET_LITADULTE,$LANGUE[$langue][litadulte]); $tpl->assign(ET_LITENFANT,$LANGUE[$langue][litenfant]); $tpl->assign(ET_LITBEBE,$LANGUE[$langue][litbebe]); $tpl->assign(ET_CHAISEBEBE,$LANGUE[$langue][chaisebebe]); $tpl->assign(ET_CLIMATISATION,$LANGUE[$langue][climatisation]); $tpl->assign(ET_MICROONDE,$LANGUE[$langue][microonde]); $tpl->assign(ET_LOCATIONVELO,$LANGUE[$langue][locationvelo]); $tpl->assign(ET_HOMME,$LANGUE[$langue][homme]); $tpl->assign(ET_FEMME,$LANGUE[$langue][femme]); $tpl->assign(ET_ENFANT,$LANGUE[$langue][enfant]); } $tpl->assign(ET_TRANSAT,$LANGUE[$langue][transat]); $tpl->assign(ET_BORDDERIVIERE,$LANGUE[$langue][bordderiviere]); $tpl->assign(ET_ASSURANCEANNULATION,$LANGUE[$langue][assuranceannulation]); $tpl->assign(ET_PRIXSEJOUR,$LANGUE[$langue][prixtotalsejour]); $tpl->assign(ET_FRAISDOSSIERR,$LANGUE[$langue][fraisdossier]); $tpl->assign(ET_ACOMPTE,$LANGUE[$langue][arrhes]); $tpl->assign(ET_ACOMPTE2,$LANGUE[$langue][arrhes2]); $tpl->assign(ET_COORDVERIFIEES,$LANGUE[$langue][coordverifiees]); $tpl->assign(ET_MAILCONFIRMATION,$LANGUE[$langue][mailconfirmation]); $tpl->assign(ET_JEREGLE,$LANGUE[$langue][jeregle]); $tpl->assign(ET_CHEQUESOLDE,$LANGUE[$langue][chequesolde]); $tpl->assign(ET_DOSSIERINCOMPLE,$LANGUE[$langue][dossierincomple]); $tpl->assign(ET_DEMANDETRAITE,$LANGUE[$langue][demandetraite]); $tpl->assign(ET_BOUTONVALIDER,$LANGUE[$langue][boutonvalide]); $tpl->assign(ET_DATE,$LANGUE[$langue][date]); $tpl->assign(ET_SIGNATURE,$LANGUE[$langue][signature]); $tpl->assign(DATEDEBUTSEJOUR,$LANGUE[$langue][datedebutsejour]); $tpl->assign(DATEFINSEJOUR,$LANGUE[$langue][datefinsejour]); $tpl->assign(ET_PRECEDENT,$LANGUE[$langue][precedent]); break; case "2": if ($typesejour=="emplacement") { $tpl->assign(ET_EMPLACEMENT,$LANGUE[$langue][emplacement]); $tpl->assign(ET_TENTE,$LANGUE[$langue][tente]); $tpl->assign(ET_CARAVANE,$LANGUE[$langue][caravane]); $tpl->assign(ET_CAMPINGCAR,$LANGUE[$langue][campingcar]); $tpl->assign(ET_LONGUEUR,$LANGUE[$langue][longueur]); $tpl->assign(ET_LARGEUR,$LANGUE[$langue][largeur]); $tpl->assign(ET_ATTENTIONEMPLACEMENT,"");//$LANGUE[$langue][attentionemplacement]); $tpl->assign(ET_LESOPTIONS,$LANGUE[$langue][lesoptions]); $tpl->assign(ET_NBELEC,$LANGUE[$langue][nbelec]); $tpl->assign(ET_REMORQUES,$LANGUE[$langue][nbremorques]); $tpl->assign(ET_REFRIGERATEUR,$LANGUE[$langue][refrigerateur]); } else { $tpl->assign(ET_LOCATION,$LANGUE[$langue][location]); $tpl->assign(ET_DEMIPENSION,$LANGUE[$langue][demipension]); $tpl->assign(ET_FORMULEPETITDEJ,$LANGUE[$langue][formulepetitdej]); $tpl->assign(ET_LOCATIONDRAP,$LANGUE[$langue][locationdrap]); $tpl->assign(ET_LITADULTE,$LANGUE[$langue][litadulte]); $tpl->assign(ET_LITENFANT,$LANGUE[$langue][litenfant]); $tpl->assign(ET_LITBEBE,$LANGUE[$langue][litbebe]); $tpl->assign(ET_CHAISEBEBE,$LANGUE[$langue][chaisebebe]); $tpl->assign(ET_CLIMATISATION,$LANGUE[$langue][climatisation]); $tpl->assign(RESTRICTCLIM,$LANGUE[$langue][restrictclim]); $tpl->assign(RESTRICTBORDDERIVIER,$LANGUE[$langue][restrictbordderiviere]); $tpl->assign(ET_LOCATIONVELO,$LANGUE[$langue][locationvelo]); $tpl->assign(ET_HOMME,$LANGUE[$langue][homme]); $tpl->assign(ET_FEMME,$LANGUE[$langue][femme]); $tpl->assign(ET_ENFANT,$LANGUE[$langue][enfant]); } $tpl->assign(ET_MICROONDE,$LANGUE[$langue][microonde]); $tpl->assign(ET_TRANSAT,$LANGUE[$langue][transat]); $tpl->assign(ET_BORDDERIVIERE,$LANGUE[$langue][bordderiviere]); $tpl->assign(ET_ASSURANCEANNULATION,$LANGUE[$langue][assuranceannulation]); $tpl->assign(ET_PRECEDENT,$LANGUE[$langue][precedent]); $tpl->assign(SUITE,$LANGUE[$langue][suivant]); break; case "1": $tpl->assign(ET_TITRE1,$LANGUE[$langue][titre1]); $tpl->assign(ET_NOM,$LANGUE[$langue][nom]); $tpl->assign(ET_PRENOM,$LANGUE[$langue][prenom]); $tpl->assign(ET_ADRESSE,$LANGUE[$langue][adresse]); $tpl->assign(ET_CP,$LANGUE[$langue][cp]); $tpl->assign(ET_VILLE,$LANGUE[$langue][ville]); $tpl->assign(ET_PAYS,$LANGUE[$langue][pays]); $tpl->assign(ET_COMMENTAIRES,$LANGUE[$langue][commentaires]); $tpl->assign(ET_TELEPHONE,$LANGUE[$langue][telephone]); $tpl->assign(ET_EMAIL,$LANGUE[$langue][email]); $tpl->assign(ET_MENTIONVOITURE,$LANGUE[$langue][mentionvoiture]); $tpl->assign(ET_NBVOITURES,$LANGUE[$langue][nbvoitures]); $tpl->assign(ET_MARQUE,$LANGUE[$langue][marque]); $tpl->assign(ET_IMMATR,$LANGUE[$langue][immatr]); $tpl->assign(ET_MENTIONPERSONNE,$LANGUE[$langue][mentionpersonne]); $tpl->assign(ET_NBADULTE,$LANGUE[$langue][nbadulte]); $tpl->assign(ET_NBENFANT,$LANGUE[$langue][nbenfant]); $tpl->assign(ET_NBBEBE,$LANGUE[$langue][nbbebe]); $tpl->assign(ET_NBANIMAUX,$LANGUE[$langue][nbanimaux]); $tpl->assign(ET_RACEANIMAUX,$LANGUE[$langue][raceanimaux]); $tpl->assign(ET_NOM,$LANGUE[$langue][nom]); $tpl->assign(ET_PRENOM,$LANGUE[$langue][prenom]); $tpl->assign(ET_AGE,$LANGUE[$langue][age]); $tpl->assign(ET_FUMEUR,$LANGUE[$langue][fumeur]); $tpl->assign(ET_OUI,$LANGUE[$langue][oui]); $tpl->assign(ET_NON,$LANGUE[$langue][non]); $tpl->assign(ET_COMMENTCONNU,$LANGUE[$langue][commentconnu]); $tpl->assign(ET_COMMENTAIRES,$LANGUE[$langue][commentaires]); $tpl->assign(ET_ACCEPTECONDITION,$LANGUE[$langue][accepteconditiongenerale]); $tpl->assign(ET_CONDITION,$LANGUE[$langue][conditiongenerale]); $tpl->assign(ET_TXTCONDITION,$LANGUE[$langue][txtconditiongeneral]); $tpl->assign(ET_PRECEDENT,$LANGUE[$langue][precedent]); break; case "0": $tpl->assign(ET_DATEDARRIVEE,$LANGUE[$langue][datedebutsejour]); $tpl->assign(ET_DATEDEDEPART,$LANGUE[$langue][datefinsejour]); $tpl->assign(SUITE,$LANGUE[$langue][suivant]); break; } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function PrintPage($etape,$typesejour,$langue) { global $tpl; AfficheTexte($etape,$typesejour,$langue); //echo "$etape,$typesejour
"; switch($etape) { case "4": if ($typesejour=="emplacement") $tpl->parse(FINAL1, "index4empl"); else $tpl->parse(FINAL1, "index4"); break; case "3": $tpl->parse(FINAL1, "index3"); break; case "2": switch($typesejour) { case "emplacement": $tpl->parse(FINAL1, "index2empl"); break; default: $tpl->parse(FINAL1, "index2"); break; } break; case "1": $tpl->parse(FINAL1, "index1"); break; default: $tpl->parse(FINAL1, "index0"); break; } $tpl->FastPrint(FINAL1); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //debut du Corps /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// InitializeTemplates(); //############################################################################# ////recupere les variables en cours $post = unserialize($_SESSION['post']) ; debug(print_r($post,true)); $etapeprecedente=$post[etape]; //print_r($_POST); //print("

"); $post = array_merge((array)$post, $_POST); //print_r($post); //print("

"); if (is_array($post)) { foreach ($post as $key => $value) { if ($value!="") { eval("\$".$key."=\"".$value."\";"); } } } $tpl->assign(NOMSCRIPT,basename($_SERVER['REQUEST_URI'])); if (!isset($langue)) $langue="fr"; switch($langue) { case "uk": $langue="uk"; $tpl->assign(LANGUECALENDAR,"en"); //$s=setlocale(LC_ALL, "en_US"); break; case "de": $langue="de"; $tpl->assign(LANGUECALENDAR,"de"); break; case "nl": $langue="de"; $tpl->assign(LANGUECALENDAR,"nl"); break; case "it": $langue="it"; $tpl->assign(LANGUECALENDAR,"it"); break; case "ru": $langue="ru"; $tpl->assign(LANGUECALENDAR,"ru"); break; case "fr": default: $langue="fr"; //$s=setlocale(LC_ALL, "fr_FR"); $tpl->assign(LANGUECALENDAR,"fr"); break; } $tpl->assign(LANGUE,$langue); if (isset($etape)) { if ($etape=="") $etape="0"; } else $etape="0"; if (($typesejour!="emplacement")&&($typesejour!="location")) { $typesejour="location"; } //############################################################################# ////verifie les case coche provenant de l 'etape 2 //############################################################################# if (($etapeprecedente==2)&&($etape!=2)) { if ($typesejour=="emplacement") { if ($_POST[nbelec]!="oui") {$post[nbelec]="";$nbelec="";} if ($_POST[refrigerateur]!="oui") {$post[refrigerateur]="";$refrigerateur="";} } else { if ($_POST[locationdrap]!="oui") {$post[locationdrap]="";$locationdrap="";} if ($_POST[litbebe]!="oui") {$post[litbebe]="";$litbebe="";} if ($_POST[chaisebebe]!="oui") {$post[chaisebebe]="";$chaisebebe="";} if ($_POST[microonde]!="oui") {$post[microonde]="";$microonde="";} if ($_POST[climatisation]!="oui") {$post[climatisation]="";$climatisation="";} if ($_POST[locationvelo]!="oui") {$post[locationvelo]="";$locationvelo="";} } if ($_POST[bordderiviere]!="oui") {$post[bordderiviere]="";$bordderiviere="";} if ($_POST[assuranceannulation]!="oui") {$post[assuranceannulation]="";$assuranceannulation="";} } //print_r($post); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ($etape=="0") { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// AfficheTypeSejour($typesejour,$langue); if ($datearrivee=="") { $datearrivee=$PERIODESAISONLOCA[0]; $datedepart=$datearrivee; } $tpl->assign(TITRERESA,$LANGUE[$langue][titreresa]); $tpl->assign(SSTITRERESA,$LANGUE[$langue][sstitreresa]); $tpl->assign(CHOIXHEB,$LANGUE[$langue][choixheb]); $tpl->assign(ALERTEDATE,$LANGUE[$langue][alertedate]); $tabdate=split("/",$datearrivee); $chdatearrivee="new Date(".$tabdate[2].",".($tabdate[1]-1).",".$tabdate[0].")"; $tabdate=split("/",$datedepart); $chdatedepart="new Date(".$tabdate[2].",".($tabdate[1]-1).",".$tabdate[0].")"; $tpl->assign(DATEARRIVEE,$chdatearrivee); $tpl->assign(DATEDEPART,$chdatedepart); $tabdate=split("/",$PERIODESAISONLOCA[0]); $tpl->assign(ANNEEDEBSAISON,$tabdate[2]); $tpl->assign(MOISDEBSAISON,$tabdate[1]-1); $tpl->assign(JOURDEBSAISON,$tabdate[0]); $tabdate=split("/",$PERIODEHORSSAISONLOCA[0][1]); $tpl->assign(ANNEEDEBSAISONSEM,$tabdate[2]); $tpl->assign(MOISDEBSAISONSEM,$tabdate[1]-1); $tpl->assign(JOURDEBSAISONSEM,$tabdate[0]); $tabdate=split("/",$PERIODESAISONLOCA[1]); $tpl->assign(ANNEEFINSAISON,$tabdate[2]); $tpl->assign(MOISFINSAISON,$tabdate[1]-1); $tpl->assign(JOURFINSAISON,$tabdate[0]); $tabdate=split("/",$PERIODEHORSSAISONLOCA[1][0]); $tpl->assign(ANNEEFINSAISONSEM,$tabdate[2]); $tpl->assign(MOISFINSAISONSEM,$tabdate[1]-1); $tpl->assign(JOURFINSAISONSEM,$tabdate[0]); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ($etape=="1"){ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $tpl->assign(NOM,$nom); $tpl->assign(PRENOM,$prenom); $tpl->assign(ADRESSE,$adresse); $tpl->assign(CP,$cp); $tpl->assign(VILLE,$ville); $tpl->assign(PAYS,$pays); $tpl->assign(TELEPHONE,$telephone); $tpl->assign(EMAIL,$email); $tpl->assign(TITRERESA,$LANGUE[$langue][titreresa]); $tpl->assign(SSTITRERESA,$LANGUE[$langue][sstitreresa]); $tpl->assign(CHOIXHEB,$LANGUE[$langue][choixheb]); $tpl->assign(ALERTEDATE,$LANGUE[$langue][alertedate]); $tpl->assign(NBVOITURES,$nbvoitures); $tpl->assign(MARQUE1,$marque1); $tpl->assign(IMMATR1,$immatr1); $tpl->assign(MARQUE2,$marque2); $tpl->assign(IMMATR2,$immatr2); $tpl->assign(NBPERSONNES,$nbpersonnes); $tpl->assign(NBENFANTS,$nbenfants); $tpl->assign(NBBEBES,$nbbebes); $tpl->assign(NBANIMAUX,$nbanimaux); $tpl->assign(RACEANIMAUX,$raceanimaux); for($i=1;$i<=6;$i++) { eval("\$nom0=\$nom".$i.";"); eval("\$prenom0=\$prenom".$i.";"); eval("\$age0=\$age".$i.";"); $tpl->assign("NOM".$i,$nom0); $tpl->assign("PRENOM".$i,$prenom0); $tpl->assign("AGE".$i,$age0); } $tpl->assign(CHECKEDFUMEUROUI,""); $tpl->assign(CHECKEDFUMEURNON,""); if ($fumeur=="oui") $tpl->assign(CHECKEDFUMEUROUI,"checked"); else $tpl->assign(CHECKEDFUMEURNON,"checked"); $tpl->assign(COMMENTCONNU,$commentnousavezvousconnu); $tpl->assign(COMMENTAIRES,$commentaires); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ($etape=="2") { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// switch ($typesejour) { case "emplacement": AfficheEmpl(0,$locatif,$langue); $tpl->assign(TITRERESA,$LANGUE[$langue][titreresa]); $tpl->assign(SSTITRERESA,$LANGUE[$langue][sstitreresa]); $tpl->assign(CHOIXHEB,$LANGUE[$langue][choixheb]); $tpl->assign(ALERTEDATE,$LANGUE[$langue][alertedate]); $tpl->assign(CHECKEDTENTE,""); $tpl->assign(CHECKEDCARAVANE,""); $tpl->assign(CHECKEDCAMPINGCAR,""); switch($hebergement) { case "Tente":$tpl->assign(CHECKEDTENTE,"checked");break; case "Caravane":$tpl->assign(CHECKEDCARAVANE,"checked");break; case "CampingCar":$tpl->assign(CHECKEDCAMPINGCAR,"checked");break; } $tpl->assign(LONGUEUR,$longueur); $tpl->assign(LARGEUR,$largeur); $tpl->assign(NBREMORQUES,$nbremorques); if ($refrigerateur=="oui") $tpl->assign(CHECKEDREFRIGERATEUR,"checked"); else $tpl->assign(CHECKEDREFRIGERATEUR,""); if ($nbelec=="oui") $tpl->assign(CHECKEDNBELEC,"checked"); else $tpl->assign(CHECKEDNBELEC,""); break; case "location": AfficheLoca(0,$locatif,$langue); $tpl->assign(NBDEMIPENSION,$nbdemipension); $tpl->assign(NBPTITDEJ,$nbpetitdej); if ($locationdrap=="oui") $tpl->assign(CHECKEDLOCATIONDRAP,"checked"); else $tpl->assign(CHECKEDLOCATIONDRAP,""); $tpl->assign(NBLOCATIONDRAPLITADULTE,$nblocationdraplitadulte); $tpl->assign(NBLOCATIONDRAPLITENFANT,$nblocationdraplitenfant); $tpl->assign(TITRERESA,$LANGUE[$langue][titreresa]); $tpl->assign(SSTITRERESA,$LANGUE[$langue][sstitreresa]); $tpl->assign(CHOIXHEB,$LANGUE[$langue][choixheb]); $tpl->assign(ALERTEDATE,$LANGUE[$langue][alertedate]); if ($litbebe=="oui") $tpl->assign(CHECKEDLITBEBE,"checked"); else $tpl->assign(CHECKEDLITBEBE,""); if ($chaisebebe=="oui") $tpl->assign(CHECKEDCHAISEBEBE,"checked"); else $tpl->assign(CHECKEDCHAISEBEBE,""); if ($microonde=="oui") $tpl->assign(CHECKEDMICROONDE,"checked"); else $tpl->assign(CHECKEDMICROONDE,""); if ($climatisation=="oui") $tpl->assign(CHECKEDCLIMATISATION,"checked"); else $tpl->assign(CHECKEDCLIMATISATION,""); if ($locationvelo=="oui") $tpl->assign(CHECKEDLOCATIONVELO,"checked"); else $tpl->assign(CHECKEDLOCATIONVELO,""); $tpl->assign(NBLOCATIONVELOHOMME,$nblocationvelohomme); $tpl->assign(NBLOCATIONVELOFEMME,$nblocationvelofemme); $tpl->assign(NBLOCATIONVELOENFANT,$nblocationveloenfant); break; } $tpl->assign(NBTRANSAT,$nbtransat); if ($bordderiviere=="oui") $tpl->assign(CHECKEDBORDDERIVIERE,"checked"); else $tpl->assign(CHECKEDBORDDERIVIERE,""); if ($assuranceannulation=="oui") $tpl->assign(CHECKEDASSURANCEANNULATION,"checked"); else $tpl->assign(CHECKEDASSURANCEANNULATION,""); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ($etape=="3") { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $tpl->assign(NOM,$nom); $tpl->assign(PRENOM,$prenom); $tpl->assign(ADRESSE,$adresse); $tpl->assign(CP,$cp); $tpl->assign(VILLE,$ville); $tpl->assign(PAYS,$pays); $tpl->assign(TELEPHONE,$telephone); $tpl->assign(EMAIL,$email); $tpl->assign(TITRERESA,$LANGUE[$langue][titreresa]); $tpl->assign(SSTITRERESA,$LANGUE[$langue][sstitreresa]); $tpl->assign(CHOIXHEB,$LANGUE[$langue][choixheb]); $tpl->assign(ALERTEDATE,$LANGUE[$langue][alertedate]); $tpl->assign(NBVOITURES,$nbvoitures); $tpl->assign(MARQUE1,$marque1); $tpl->assign(IMMATR1,$immatr1); $tpl->assign(MARQUE2,$marque2); $tpl->assign(IMMATR2,$immatr2); $tpl->assign(NBPERSONNES,$nbpersonnes); $tpl->assign(NBENFANTS,$nbenfants); $tpl->assign(NBBEBES,$nbbebes); $tpl->assign(NBANIMAUX,$nbanimaux); $tpl->assign(RACEANIMAUX,$raceanimaux); //$nbperstotal=$nbpersonnes+$nbenfants+$nbbebes; for($i=1;$i<=6;$i++) { eval("\$nom0=\$nom".$i.";"); eval("\$prenom0=\$prenom".$i.";"); eval("\$age0=\$age".$i.";"); $tpl->assign("NOM".$i,$nom0); $tpl->assign("PRENOM".$i,$prenom0); $tpl->assign("AGE".$i,$age0); } $tpl->assign(FUMEUR,$LANGUE[$langue][$fumeur]); $tpl->assign(COMMENTCONNU,$commentnousavezvousconnu); $tpl->assign(COMMENTAIRES,$commentaires); AfficheLocatifNum($typesejour,$locatif,$langue); if ($typesejour=="emplacement") { $tpl->assign(HEBERGEMENT,$hebergement); $tpl->assign(LONGUEUR,$longueur); $tpl->assign(LARGEUR,$largeur); $tpl->assign(NBREMORQUES,$nbremorques); if ($nbelec=="oui") $tpl->assign(NBELEC,$LANGUE[$langue][oui]); else $tpl->assign(NBELEC,$LANGUE[$langue][non]); if ($refrigerateur=="oui") $tpl->assign(REFRIGERATEUR,$LANGUE[$langue][oui]); else $tpl->assign(REFRIGERATEUR,$LANGUE[$langue][non]); } else { $tpl->assign(NBDEMIPENSION,$nbdemipension); $tpl->assign(NBPTITDEJ,$nbpetitdej); if ($locationdrap=="oui") $tpl->assign(LOCATIONDRAP,$LANGUE[$langue][oui]); else $tpl->assign(LOCATIONDRAP,$LANGUE[$langue][non]); $tpl->assign(NBLOCATIONDRAPLITADULTE,$nblocationdraplitadulte); $tpl->assign(NBLOCATIONDRAPLITENFANT,$nblocationdraplitenfant); if ($litbebe=="oui") $tpl->assign(LITBEBE,$LANGUE[$langue][oui]); else $tpl->assign(LITBEBE,$LANGUE[$langue][non]); if ($chaisebebe=="oui") $tpl->assign(CHAISEBEBE,$LANGUE[$langue][oui]); else $tpl->assign(CHAISEBEBE,$LANGUE[$langue][non]); if ($microonde=="oui") $tpl->assign(MICROONDE,$LANGUE[$langue][oui]); else $tpl->assign(MICROONDE,$LANGUE[$langue][non]); if ($climatisation=="oui") $tpl->assign(CLIMATISATION,$LANGUE[$langue][oui]); else $tpl->assign(CLIMATISATION,$LANGUE[$langue][non]); if ($locationvelo=="oui") $tpl->assign(LOCATIONVELO,$LANGUE[$langue][oui]); else $tpl->assign(LOCATIONVELO,$LANGUE[$langue][non]); $tpl->assign(NBLOCATIONVELOHOMME,$nblocationvelohomme); $tpl->assign(NBLOCATIONVELOFEMME,$nblocationvelofemme); $tpl->assign(NBLOCATIONVELOENFANT,$nblocationveloenfant); } $tpl->assign(NBTRANSAT,$nbtransat); if ($bordderiviere=="oui") $tpl->assign(BORDDERIVIERE,$LANGUE[$langue][oui]); else $tpl->assign(BORDDERIVIERE,$LANGUE[$langue][non]); if ($assuranceannulation=="oui") $tpl->assign(ASSURANCEANNULATION,$LANGUE[$langue][oui]); else $tpl->assign(ASSURANCEANNULATION,$LANGUE[$langue][non]); $tpl->assign(DATEARRIVEE,$datearrivee); $tpl->assign(DATEDEPART,$datedepart); if ($locationvelo=="oui") $nbvelo=$nblocationveloenfant+$nblocationvelofemme+$nblocationvelohomme; else $nbvelo=0; if ($locationdrap=="oui") $nblocationdrap=$nblocationdraplitadulte+$nblocationdraplitenfant; else $nblocationdrap=0; AfficheDevis(0,$typesejour,$hebergement,$locatif,$nbpersonnes,$listeoccupants,$nbenfants,$listevoitures,$nbbebes,$nbanimaux,$raceanimaux,$nbvoitures,$nbremorques,$microonde,$refrigerateur,$nbelec,$nbtransat,$bordderiviere,$nbdemipension,$nbpetitdej,$climatisation,$nblocationdraplitenfant,$nblocationdraplitadulte,$litbebe,$chaisebebe,$nbvelo,$assuranceannulation,$datearrivee,$datedepart,$langue); if ($typesejour=="emplacement") $tpl->parse(OPTIONS,"optionempl"); else $tpl->parse(OPTIONS,"optionloca"); $tpl->assign(ETAPE,$etape); //$_SESSION['post2'] = $_SESSION['post']; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ($etape==4) { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $tpl->assign(TITRERESA,$LANGUE[$langue][titreresa]); $tpl->assign(SSTITRERESA,$LANGUE[$langue][sstitreresa]); EnvoieEmail(0,$post,$totalsejour,$acompte,$paiement,$numcarte,$cryptocarte,$moisexpiration, $anneeexpiration,$langue); EnvoieEmailClient($mailClient); } $_SESSION['post'] = serialize($post) ; Printpage($etape,$typesejour,$langue); ?>