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
|
while(!feof($fp))
{
set_time_limit(50);
$chaine=fgets($fp,100);
$tok = strtok($chaine, " ,'()[]<>\n\t\"/*+{}=");
while ($tok)
{
//echo $tok;
set_time_limit(50);
$query="SELECT * FROM inscription WHERE Mail='".$tok."'";
$res=odbc_do($cnx,$query);
echo $res;
while($row=odbc_fetch_row($res))
{
echo "$row[Mail]";
set_time_limit(50);
$from=array("'","&",",","/",".");
$to=array(" ","et"," ","ou","");
$activite=str_replace($from,$to,$row->Activite);
$fonction=str_replace($from,$to,$row->Fonction);
$soc=str_replace($from,$to,$row->Societe);
$remarque=str_replace($from,$to,$row->Remarque);
$adr=str_replace($from,$to,$row->Adresse);
$nom=str_replace($from,$to,$row->Nom);
$pre=str_replace($from,$to,$row->Prenom);
$pays=str_replace($from,$to,$row->Pays);
$ville=str_replace($from,$to,$row->Ville);
$q="INSERT INTO archive VALUES('".date("Y")."-".date("m")."-".date("d")."','".$row->DateInscription."','".$row->Sex."','".$nom."','".$pre."','".$fonction."','".$row->Tel."','".$row->Fax."','".$soc."','".$activite."','".$adr."','".$ville."','".$row->CP."','".$pays."','".$row->Mail."','".$row->WebSite."','".$remarque."','".$row->NumDossier."','".$row->ReceptionOffre."','".$row->TypeInscri."','".$row->Civilite."','".$row->Serveur."')";
$r=odbc_do($cnx,$q);
if(!$r)
{
echo odbc_errormsg($cnx);
}
else
{
$qdel="DELETE FROM inscription WHERE Mail='".$tok."'";
$rdel=odbc_do($cnx,$qdel);
if(!$rdel)
echo odbc_errormsg($cnx);
else
{
$i++;
}
}
}
$tok = strtok(" ,'()[]<>\n\t\"/*+{}=");
}
}
}
fclose($fp); |
Partager