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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
<?php
//mise à jour de la collection
if($maj=="ok") {
$temps_debut = microtime(true);
$result = mysql_query("SELECT * FROM collec");
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
if (trim($row[24])=='classique' && trim($row[28])<>'Attente N° Y et T')
{
$chemin='XXX';
if(@getimagesize('../../image/photo-timbre/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/photo-timbre/';
}
if(@getimagesize('../../image/classique/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/classique/';
}
if(@getimagesize('../../image/image-2007/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/image-2007/';
}
if(@getimagesize('../../image/image-2008/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/image-2008/';
}
if(@getimagesize('../../image/image-2009/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/image-2009/';
}
if(@getimagesize('../../image/image-2010/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/image-2010/';
}
if(@getimagesize('../../image/image-2011/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/image-2011/';
}
if(@getimagesize('../../image/image-2012/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/image-2012/';
}
if(@getimagesize('../../image/image-2013/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/image-2013/';
}
if(@getimagesize('../../image/image-2014/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/image-2014/';
}
if(@getimagesize('../../image/bloc/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/bloc/';
}
if(@getimagesize('../../image/Croix rouge/'.trim($row[11]))==true)
{
$photo=stripslashes(htmlentities(trim($row[11])));
$chemin='../../image/Croix rouge/';
}
$desi=trim($row[2]);
$annee=stripslashes(htmlentities(trim($row[5])));
$valneuf=stripslashes(htmlentities(trim($row[13])));
$valneufchar=stripslashes(htmlentities(trim($row[14])));
$valoblit=stripslashes(htmlentities(trim($row[15])));
$info=trim($row[10]);
$num=trim($row[1]);
$num_remplace=trim($row[28]);
$tabe='/é/';$replacement= "é";
$desi=preg_replace($tabe, $replacement, $desi);
$tabe='/è/';$replacement= "è";
$desi=preg_replace($tabe, $replacement, $desi);
$tabe='/amp;/';$replacement= "";
$desi=preg_replace($tabe, $replacement, $desi);
$tabe='/é/';$replacement= "é";
$info=preg_replace($tabe, $replacement, $info);
$tabe='/è/';$replacement= "è";
$info=preg_replace($tabe, $replacement, $info);
$tabe='/amp;/';$replacement= "";
$info=preg_replace($tabe, $replacement, $info);
//............................................................................................
$resultat = mysql_query("SELECT * FROM timbresdefrance_collections.".$collection." Where num=".$num." or num=".$num_remplace."");
while ($data = mysql_fetch_array($resultat, MYSQL_NUM))
{
$sql='REPLACE INTO timbresdefrance_collections.'.$collection.' VALUES ("'.$data[0].' "," '.$num_remplace.' ","'.$data[2].'","'.$valneuf.'","'.$data[4].'","'.$data[5].'","'.$valneufchar.'","'.$data[7].'","'.$data[8].'","'.$valoblit.'","'.$data[10].'","'.$photo.'","'.$info.'","'.$data[13].'","'.$data[14].'","'.$chemin.'","'.$data[16].'","'.$data[17].'","'.$data[18].'","'.$data[19].'","'.$data[20].'","'.$data[21].'","'.$data[22].'","'.$data[23].'","'.$data[24].'","'.$data[25].'","'.$data[26].'","'.$data[27].'","'.$data[28].'","'.$data[29].'","'.$data[30].'","'.$data[31].'")';
mysql_query($sql)or die ('Erreur SQL !'.$sql.'<br>'.mysql_error());
}
//..................................................................................................
} // fin de if (trim($row[24])=='classique' && trim($row[28])<>'Attente N° Y et T')
} // fin de while ($row.....
$_SESSION['tot']=$t;
$temps_fin = microtime(true);
echo 'Temps d\'execution : '.round($temps_fin - $temps_debut, 4);
echo('<br>');
}//fin de script
?>
<?php |
Partager