1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| <?php
ini_set ('max_execution_time', 0);
ini_set ('max_input_time',1000000);
ini_set ('memory_limit',-1);
$liendb = mysql_connect("***.1and1.fr", "***", "***" );
mysql_select_db("***" );
$sql= "SELECT * FROM tarifalt";
$resultat = mysql_query ($sql);
while ($ct = mysql_fetch_array($resultat))
{
$r1=$ct['tarif'];
$altcout=$ct['prix'];
$tt=$ct['destination'];
$sql1="SELECT * from tarif";
$resultat1 = mysql_query ($sql1);
while ($ct1 = mysql_fetch_array($resultat1))
{
$t1=$ct1['CODET'];
if($r1==$t1)
{ $altmarg=$altcout*1.2;
$stunt=$ct1['VALO'];
if ($stunt>=$altmarg) {$res=$stunt; $txt="ancien tarif - marge >20%";}
if ($stunt<$altmarg & $stunt>$altcout) {$res=$stunt; $txt="ancien tarif - marge < 20%";}
if ($stunt<$altmarg & $stunt<$altcout) {$res=$altcout; $txt="augmentation";}
echo $tt ."<BR>";
break;
}
}
}
echo "fini";
?> |
Partager