<?php
session_start();  //donner un nom utilisateur

include_once("../../cgi-php/connect.php");
connect_office()
	or exit ();
	
$sid=session_id();
$jour=date("d-m-Y");
$fichier = fopen ('http://www.1info.com/1computer/info.html', "r");
while ($str = fread ($fichier, 16)) {
        $html .=$str;
}
fclose ($fichier);

if ($_GET['code'] == "")
     $code = "0";
else
	$code=$_GET['code'];
	
$res = mysql_query ("SELECT DISTINCT code_lien, libelle_lien, type_lien, note_lien, image_lien, rem_lien FROM lien  WHERE type_lien LIKE '$code%' ORDER BY group_lien");

if (!$res)
	print("Requete Failed");
else {
$qte=mysql_num_rows($res);
$tabl=array (
        "Go To Link",
        $qte ." Comment Informations Remarques",
        "Level");
//titre($tabl);
$info="<table>\n";
while ($row  =  mysql_fetch_row($res)) {
   $cpt++; //compte le nombre de lignes
   $ligne = ($cpt % 2)
                //? "#EEEEEE"
                //  : "#FFFFFF";
                  ? "ligne1"
                  : "ligne2";
				  
  if($row[3] == ""){
        $info.='<tr class="'.$ligne.'">';
        $info.="<td colspan=\"3\" align=\"center\" valign=\"middle\">\n";
        //open_titre(b8c8ff,150);
        $info.="$row[5]\n";
        //close_titre(b8c8ff);
        $info.="</td></tr>\n";
      //print "<td bgcolor='#ff9900'><font size='+1'><div align='left'>$row[0]</div></font></td>";//titre
      }
  else {
     $info.='<tr class="'.$ligne.'">';
     if($row[4]==""){
        $info.="<td><font size='-1'><a href='http://$row[0]' target='_blank' title='$row[0]'>$row[5]</a></font></td\n>";//lien
     }
     else {
        $info.="<td><font size='-1'><a  href='http://$row[0]' target='_blank' title='$row[0]'><img src='$Base_R/images/logo/$row[4]' width='80' hight='30'> $row[5]</a></div></font></td\n>";//lien
     }
     $info.="<td><font size='-1'>$row[1]</font></td>\n";
     $info.="<td>\n";//libelle
     for ($index=0; $index<$row[3]; $index++)
         $info.="<img border='1' src='../../images/star.gif' width'15' height='15' />";//score
     $info.="</td></tr>\n";
     //print "<p><tr></p>";
    }
  }
$info.="</table>";
$html = ereg_replace ("{INFO}", "$info", $html);
echo $html;
}
mysql_free_result($res);
?>
