Commit d72c355d authored by Osvaldo Valdivia Salas's avatar Osvaldo Valdivia Salas
Browse files

Upload New File

parent 3b7c527d
<title>Clinique Vétérinaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
$vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
} catch(PDOException $e){
echo "Erreur de connexion '$e'";
$idAnimal = $_POST['animal'];
$idVeterinaire = $_POST['veterinaire'];
$medicament = $_POST['medicament'];
$date = $_POST['ddebut'];
$duree = $_POST['duree'];
$qte = $_POST['qteJour'];
if($idAnimal != ""){
if($idVeterinaire != ""){
if($medicament != ""){
if($date != ""){
if($duree != ""){
$vSql ="INSERT INTO TRAITEMENT (idAnimal,idVeterinaire) VALUES ('$idAnimal','$idVeterinaire');";
$vSt = $vConn->prepare($vSql);
$vSql ="INSERT INTO POSOLOGIE (idTraitement,nomMolec,debut,duree,nbJourna) VALUES ((SELECT idTraitement WHERE idAnimal='$idAnimal' AND idVeterinaire='$idVeterinaire'),'$medicament','$date','$duree','$qte');";
$vSt = $vConn->prepare($vSql);
header('Location: http://tuxa.sme.utc/~bdd0p042/application/animaux.php');
echo "Il faut donner une durée";
echo "Il faut donner une date";
echo "Il faut donner un médicament";
echo "Il faut donner un vétérinaire";
echo "Il faut donner un animal";
echo "Il faut donner la quantité"
} catch(PDOException $e){
echo "Erreur d'insertion '$e'";
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