Commit 9d0ccc26 authored by Osvaldo Valdivia Salas's avatar Osvaldo Valdivia Salas
Browse files

Upload New File

parent 29e43d09
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
<h1>Information des animaux</h1>
<table border="1">
// Connexion à la base de données
$vHost = 'tuxa.sme.utc';
$vPort = '5432';
$vData = 'dbbdd0p117';
$vUser = 'bdd0p117';
$vPass = 'LpIHl1sZ';
$vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
// Affichage du tableau de données
$vSql ='select * from Animal;';
$vSt = $vConn->prepare($vSql);
while ($vResult = $vSt->fetch(PDO::FETCH_BOTH)) {
echo '<tr>';
echo "<td>$vResult[0]</td>";
echo "<td>$vResult[1]</td>";
echo "<td>$vResult[2]</td>";
echo "<td>$vResult[3]</td>";
echo "<td>$vResult[4]</td>";
echo "<td>$vResult[5]</td>";
echo "<td>$vResult[6]</td>";
echo "<td><form action='remAnimal.php' method='post'> <input type='text' name='idAnimal' value=$vResult[0] hidden/> <input id='btnRemove' type='submit' value='X'> </form></td>";
echo '</tr>';
<form action="addAnimal.php" method="post">
<p>Nom de l'animal: <input type="text" name="nom" required/></p>
<p>Poids: <input type="text" name="poids" required/></p>
<p>Taille: <input type="text" name="taille" required/></p>
<p>Date de naissance: <input type="date" name="ddn" required/></p>
<select name="client" required/>
$vSql ='select idClient from Client;';
$vSt = $vConn->prepare($vSql);
while ($vResult = $vSt->fetch(PDO::FETCH_BOTH)) {
echo "<option>$vResult[0]</option>";
<select name="espece" required/>
$vSql ='select nomEspece from Espece;';
$vSt = $vConn->prepare($vSql);
while ($vResult = $vSt->fetch(PDO::FETCH_BOTH)) {
echo "<option>$vResult[0]</option>";
<p><input type="submit" value="OK"></p>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment