Upload New File

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