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
| <?
session_start();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
?>
<HTML>
<HEAD>
<META content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<STYLE media="all" type="text/css">@import "../css/celti.css";</STYLE>
<SCRIPT type="text/javascript" language="javascript" SRC="../js/tools.js"></SCRIPT>
<TITLE>Recherche VIP</TITLE>
<?
require ("lib_fct.php");
require ("lib_constantes.php");
require ("../fpdf153/fpdf.php");
?>
<body>
<div id="header">
<h4>Recherche VIP</h4>
</div>
</br>
<div id="contenu">
<br />
<h4>Renseignez le champ souhaité :</h4>
<br />
<form method="POST" action="saisie.php">
<TABLE BORDER=0>
<TR>
<TD><b>Nom du demandeur</b></TD>
<TD>
<INPUT type=text name="nom">
</TD>
</TR>
</table>
<div id="submit">
<input type="submit" value="Envoyer" NAME="submit"/>
</div>
</form>
<?php
if(isset($_POST['submit']))
{
$bd="VIP";
$user="root";
$password="";
$nom=$_POST['nom'];
if (empty($nom))
{
echo '<center><table id="result">'."\n";
echo '<tr class="tr1">';
echo '<td>Merci de remplir un nom !</td>';
echo '</tr>'."\n";
echo '</table></center>'."\n";
}
else
{
$cnx = odbc_connect( $bd , $user, $password )or die('Ouverture de la base impossible !');
if($cnx)
{
$results = "SELECT nom,prenom,vip FROM VIPS where nom = '$nom'";
$rs= odbc_exec($cnx, $results);
while (odbc_fetch_row($rs))
{
$name=odbc_result($rs, "nom");
$prenom=odbc_result($rs, "prenom");
$vip=odbc_result($rs, "vip");
echo '<center><table id="result">'."\n";
echo '<tr class="tr1">';
echo '<td>Nom</td>';
echo '<td>Prénom</td>';
echo '<td>Statut</td>';
echo '</tr>'."\n";
echo '<tr class="tr2">';
echo "<td>" .$name. "</td>";
echo "<td>" .$prenom. "</td>";
echo "<td>" .$vip. "</td>";
echo '</tr>'."\n";
echo '</table></center>'."\n";
}
}
else
{
echo "Impossible de se connecter à la base de données";
}
odbc_close( $cnx);
}
}
?>
</div>
</body>
</html> |
Partager