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
|
<?php
while($resultats = mysql_fetch_array($query) ) //boucle affichant les résultats
{
$req_select=mysql_query("select * from terme,titre, document where (document.code_doc=terme.code_doc and document.code_doc=titre.code_doc and terme.code_doc=titre.code_doc and terme.terme=titre.terme_titre and terme.code_doc='".$resultats["code_doc"]."' and titre.code_doc='".$resultats["code_doc"]."' and terme.terme='".$resultats["terme"]."' and document.type_offre='$offre') AND ($valeur_requete) ");
$req_select_terme=mysql_query("select * from terme, document where (document.code_doc=terme.code_doc and terme.code_doc='".$resultats["code_doc"]."') and document.type_offre='$offre' AND ($valeur_requete1) ");
$req_select_titre=mysql_query("select * from titre, document where (document.code_doc=titre.code_doc and titre.code_doc='".$resultats["code_doc"]."') and document.type_offre='$offre' AND ($valeur_requete2) ");
$x1=mysql_num_rows($req_select);
$x2=mysql_num_rows($req_select_terme);
$x3=mysql_num_rows($req_select_titre);
if($x1!=0)
{
while($req_select1=mysql_fetch_array($req_select))
{
if(!array_key_exists($req_select1["url"], $somme))
{ $somme[$req_select1["url"]] = 0; }
if(!array_key_exists($req_select1["url"], $somme2))
{ $somme2[$req_select1["url"]] = 0; }
$somme[$req_select1["url"]] += $req_select1["poids_titre"];
$somme2[$req_select1["url"]] += $req_select1["poids_titre"] * $req_select1["poids_titre"];
}
$somme_carre=$somme2[$resultats["url"]];
$racine_sommecarre=sqrt($somme2[$resultats["url"]]);
$somme_mot=sqrt($nombre_mots);
$rsv=$somme[$resultats["url"]]/($somme_mot*$racine_sommecarre);
$affichage="select titre,resume,type_offre FROM document WHERE url='".$resultats['url']."'";
$affichage1=mysql_query($affichage);
$affichage2 = mysql_fetch_array($affichage1);
echo '<p align="left" style="margin-bottom:-60px; font-size=20px;
margin-left:18px;"><a href=' .$resultats["url"]. '>'.$affichage2['titre'].'</a>...<p><br>
<p><hr style="border-bottom:solid 1px #000066;width:870px; margin-left:3px; margin-bottom:-50px;"></hr></p><br>
<p align="left" style="margin-bottom:-50px; margin-left:35px; margin-top:-30px; margin-right:20px;">'.$affichage2['resume'].'...<p><br>
<p align="left" style="margin-bottom:-50px; color:#0F7C91; margin-left:35px;">' .$resultats["url"] . '<p><br><br><br><p>'.$rsv.'</p>
<p>'.$somme[$resultats["url"]].'</p><p> </p>';
} //finif
elseif($x2!=0)
{
while ($req_select2=mysql_fetch_array($req_select_terme))
{
if(!array_key_exists($req_select2["url"], $somme))
{
$somme[$req_select2["url"]] = 0;
}
if(!array_key_exists($req_select2["url"], $somme2))
{
$somme2[$req_select2["url"]] = 0;
}
$somme[$req_select2["url"]] += $req_select2["poids"];
$somme2[$req_select2["url"]] += $req_select2["poids"] * $req_select2["poids"];
}
$somme_carre=$somme2[$resultats["url"]];
$racine_sommecarre=sqrt($somme2[$resultats["url"]]);
$somme_mot=sqrt($nombre_mots);
$rsv=$somme[$resultats["url"]]/($somme_mot*$racine_sommecarre);
$affichage="select titre,resume,type_offre FROM document WHERE url='".$resultats['url']."'";
$affichage1=mysql_query($affichage);
$affichage2 = mysql_fetch_array($affichage1);
echo '<p align="left" style="margin-bottom:-60px; font-size=20px; margin-left:18px;"><a href=' .$resultats["url"]. '>'.$affichage2['titre'].'</a>...<p><br>
<p><hr style="border-bottom:solid 1px #000066;width:870px; margin-left:3px; margin-bottom:-50px;"></hr></p><br>
<p align="left" style="margin-bottom:-50px; margin-left:35px; margin-top:-30px; margin-right:20px;">'.$affichage2['resume'].'...<p><br>
<p align="left" style="margin-bottom:-50px; color:#0F7C91; margin-left:35px;">' .$resultats["url"] . '<p><br><br><br> <p>'.$rsv.'</p>
<p>'.$somme[$resultats["url"]].'</p>
<p> </p>';
}
elseif($x3!=0)
{
while($req_select3=mysql_fetch_array($req_select_titre))
{
if(!array_key_exists($req_select3["url"], $somme))
{
$somme[$req_select3["url"]] = 0;
}
if(!array_key_exists($req_select3["url"], $somme2))
{
$somme2[$req_select3["url"]] = 0;
}
$somme[$req_select3["url"]] += $req_select3["poids_titre"];
$somme2[$req_select3["url"]] += $req_select3["poids_titre"] * $req_select3["poids_titre"];
}
$somme_carre=$somme2[$resultats["url"]];
$racine_sommecarre=sqrt($somme2[$resultats["url"]]);
$somme_mot=sqrt($nombre_mots);
$rsv=$somme[$resultats["url"]]/($somme_mot*$racine_sommecarre);
$affichage="select titre,resume,type_offre FROM document WHERE url='".$resultats['url']."'";
$affichage1=mysql_query($affichage);
$affichage2 = mysql_fetch_array($affichage1);
echo '<p align="left" style="margin-bottom:-60px; font-size=20px; margin-left:18px;"><a href=' .$resultats["url"]. '>'.$affichage2['titre'].'</a>...<p><br>
<p><hr style="border-bottom:solid 1px #000066;width:870px; margin-left:3px; margin-bottom:-50px;"></hr></p><br>
<p align="left" style="margin-bottom:-50px; margin-left:35px; margin-top:-0px; margin-right:20px;">'.$affichage2['resume'].'...<p><br>
<p align="left" style="margin-bottom:-50px; color:#0F7C91; margin-left:35px;">' .$resultats["url"] . '<p><br><br><br>
<p>'.$rsv.'</p><p>'.$somme[$resultats["url"]].'</p><p> </p>';
}
}
?> |
Partager