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
|
<?php
$output='';
mysql_connect('localhost','root','');
mysql_select_db('xxxxxx');
if(isset($_GET['recherche']) && !empty($_GET['recherche']) && strlen($_GET['recherche'])>2)
{
$rec = trim(htmlentities($_GET['recherche']));
}
else
{
$rec = 'search';
}
$type = 1;//type par defaut: expression exacte
$req = 'SELECT id,url, numero_lot FROM certificats WHERE ';
if($type==1)
{//ayant un des mots dans la recherche
$mots = explode(' ',$rec);//En sépare l expression en mots cles
foreach($mots as $mot)
{
$req .= ' numero_lot LIKE "%'.$mot.'%" OR';
}
$req .= ' 1=0';
echo 'Essayez autre chose';
}
//classement numeros de lots
$req .= ' order by id asc';
$requete = mysql_query($req);
?>
<table width="300px" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="76%"><form action="" method="get" >
<fieldset style="background-color: #FFFFFF; border: 1px double #73aad2;">
<legend style="color: #294C74;font-size: 16px;font-family: Arial, Helvetica, sans-serif;padding-left:0px;padding-bottom:0px;padding-top:0px;"><strong>Certificate of analysis search </strong></legend>
<table width="94%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="250"><input type="text" size="50px" name="recherche"
onfocus="if(this.value=='search'){ this.value = ''; this.style.color = '#000000'; }" onBlur="if (this.value == '') {this.value = 'search'; this.style.color = '#999999'; }"
value="<?php echo $rec; ?>" /></td>
<td width="68">
<input type="submit" value="Search" />
<?php $type==1 ; ?> </td>
</tr>
</table>
</fieldset>
</form></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<table width="510" border=0px align="left">
<tr class="Style2">
<td width="393" height="15" align="left" style="font-family:Arial; font-size:12px; color:#155a97;border:2;border-bottom:1px solid #AFD3F3;background-color:#F2F9FD;" valign=top><strong>Lot Number </strong> </td>
<td width="107" height="15" align="left" style="font-family:Arial; font-size:12px; color:#155a97;border:0;border:2;border-bottom:1px solid #AFD3F3;background-color:#F2F9FD;" valign=top><strong>Web links </strong></td>
</tr>
<?php
//On affiche les resultats
while($dnn = mysql_fetch_array($requete))
{
?>
</tr>
<tr>
<td height="20" align="left" valign=top style="font-family:Arial; font-size:13px; color:#155a97;padding: 5px;border:0;border:2;border-bottom:1px solid #AFD3F3;background-color:#EBF4FC;">
<?php echo strtoupper($dnn['numero_lot']); ?></td>
<td align="center" style="font-family:Arial; font-size:12px; color:#155a97;border:0;border:2;border-bottom:1px solid #AFD3F3;background-color:#ffffff;" valign=top>
<?php echo '<a href=
"'.$dnn['url'].'" target="_parent">' . "<img src='xxxxxxx'" . 'align="left" target="_parent" border=0' . " alt='". htmlspecialchars($dnn['url'])."'></a>";?> </td>
</tr>
<?php
}
?>
</table> |
Partager