header("Content-Type: text/xml");
$fpara = fopen("param.ini", "r");
$ip= fgets($fpara);
if(isset($_GET['name']))
$sep_n= $_GET['name'];
else{
$sep_n="";
}
$x=$sep_n;
if(isset($_GET['nom']))
$nom=$_GET['nom'];
else{
$nom="";
}
if(isset($_GET['num']))
$num=$_GET['num'];
else{
$num="";
}
if($num!="" and $nom!=""){
echo("\r\n");
echo("Erreur\r\n");
echo("La recherche est effectuée soit par nom soit par numéro!\r\n");
echo("\r\n");
exit();
}
if (file_exists("codage.tcs"))
$fp = fopen("codage.tcs", "r");
else{
echo("\r\n");
echo("FICHIER INEXISTANT !\r\n");
echo("FICHIER INEXISTANT !\r\n");
echo("\r\n");
exit();
}
$fp = fopen("codage.tcs", "r");
$trouv=false;
//-----------------------------------------------------------------------
$phone="";
$i=0;
while(!feof($fp)and $i<1)
{
//while($trouv==false){
$ligne1=fgets($fp,20);
$ligne2=fgets($fp,255);
$ligne3=fgets($fp,255);
$ligne4=fgets($fp,255);
$ligne5=fgets($fp,255);
$cible = (string)$ligne4;
$sep="";
$phone=$phone.$cible;
if(trim($cible)==trim($sep_n)){
$sep=trim($ligne1);
$phone="cava";
$i=5;
}
//}
}
//-----------------------------------------------------------------------
if (file_exists("resultat\An".$sep.".txt")){
unlink("resultat\An".$sep.".txt");
}
$fp = fopen("Interface_Wintax\#07".$sep.".txt", "a");
fseek($fp,0);
$type="";
if($nom!="" and $num==""){$type=$nom;}
if($nom=="" and $num!=""){$type=$num;}
$varr="#07".$sep.",".$type;
fputs($fp,$varr);
fclose($fp);
$txt=false;
while($txt==false){
if(file_exists("resultat\An".$sep.".txt")){
$txt=true;
}
}
$fp2 = fopen("resultat\An".$sep.".txt",'r');
$het="";
while(!feof($fp2))
{
$het=$het.fgets($fp2);
}
//----------------------------------------------------------------------
echo ("\r\n");
echo ("".$het."\r\n");
echo ("\r\n");
echo ("EXIT\r\n");
echo ("SoftKey:Exit\r\n");
echo ("3\r\n");
echo ("\r\n");
echo ("\r\n");
fclose($fp2);
exit();
//***************************************************
//***************************************************
?>