Commit 27177997 authored by Gaetan Carabetta's avatar Gaetan Carabetta

update filenames

parent 3fd678a6
<html> <html>
<head> <head>
<title>Exercice</title> <title>Clinique Vétérinaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head> </head>
<body> <body>
...@@ -45,9 +45,6 @@ ...@@ -45,9 +45,6 @@
} catch(PDOException $e){ } catch(PDOException $e){
echo "Erreur d'insertion '$e'"; echo "Erreur d'insertion '$e'";
} }
?> ?>
</body> </body>
</html> </html>
...@@ -2,35 +2,26 @@ ...@@ -2,35 +2,26 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Insert Client </title> <title>Clinique Vétérinaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head> </head>
<body> <body>
<table border = "1"> <?php
<tr> include("connexion.php");
<th> nom </th>
<th>prenom</th>
<th> ddn </th>
<th> adresse </th>
<th> numero </th>
</tr>
<?php
include("connexion.php"); $nom = $_POST['nom'];
$prenom = $_POST['prenom'];
$ddn = $_POST['ddn'];
$add = $_POST['add'];
$ntel = $_POST['ntel'];
$nom = $_POST['nom']; try
$prenom = $_POST['prenom']; {
$ddn = $_POST['ddn']; $vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
$add = $_POST['add']; } catch(PDOException $e)
$ntel = $_POST['ntel']; {
try echo "Erreur de la connexion '$e'";
{ }
$vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
}
catch(PDOException $e)
{
echo "Erreur de la connexion '$e'";
}
if($nom != "") if($nom != "")
{ {
...@@ -46,38 +37,14 @@ ...@@ -46,38 +37,14 @@
$vSql ="INSERT INTO Client (nom,prenom,ddn,adresse,numero) VALUES ( '$nom','$prenom','$ddn','$add','$ntel');"; $vSql ="INSERT INTO Client (nom,prenom,ddn,adresse,numero) VALUES ( '$nom','$prenom','$ddn','$add','$ntel');";
try try
{ {
$vSt = $vConn->prepare($vSql); $vSt = $vConn->prepare($vSql);
$vSt->execute(); $vSt->execute();
} }
catch(PDOException $e) catch(PDOException $e)
{ {
echo "Erreur en l'insertion '$e'"; echo "Erreur en l'insertion '$e'";
} }
$vSql ='SELECT * FROM client;';
try
{
$vSt = $vConn->prepare($vSql);
$vSt->execute();
}
catch(PDOException $e)
{
echo "Erreur en l'affichage des clients '$e'";
}
while ($vResult = $vSt->fetch(PDO::FETCH_ASSOC))
{
echo '<tr>';
echo "<td>$vResult[nom]</td>";
echo "<td>$vResult[prenom]</td>";
echo "<td>$vResult[ddn]</td>";
echo "<td>$vResult[adresse]</td>";
echo "<td>$vResult[numero]</td>";
echo '</tr>';
}
} }
} }
else else
echo "Il faut de donner le numero de telephone"; echo "Il faut de donner le numero de telephone";
......
<html> <html>
<head> <head>
<title>Exercice</title> <title>Clinique Vétérinaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="style.css">
</head> </head>
<body> <body>
<h1>Information des animaux</h1> <h1>Ajout d'un animal</h1>
<?php <?php
// Connexion à la base de données // Connexion à la base de données
include("connexion.php"); include("connexion.php");
......
<html> <html>
<head> <head>
<title> Insert Client </title> <title>Clinique Vétérinaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head> </head>
<body> <body>
<h1>Ajout d'un client</h1>
<form method = "post" action = "ajouterClient.php"> <form method = "post" action = "addClient.php">
<P> Nom: <input type="text" name="nom"> <BR> </P> <P> Nom: <input type="text" name="nom"> <BR> </P>
<P> Prenom : <input type="text" name="prenom"> <BR> </P> <P> Prenom : <input type="text" name="prenom"> <BR> </P>
<P> Date de Naissance : <input type="date" name="ddn"> <BR> </P> <P> Date de Naissance : <input type="date" name="ddn"> <BR> </P>
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head> </head>
<body> <body>
<button onclick="location.href='ajouterClient.html'">Add </button> <button onclick="location.href='ajouterClient.html'">Add </button>
<button onclick="location.href='ajouterClient.html'">Add </button>
<table border = "1"> <table border = "1">
<tr> <tr>
<th> nom </th> <th> nom </th>
......
Markdown is supported
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