-
Notifications
You must be signed in to change notification settings - Fork 2
/
ajoutVisite.php
36 lines (30 loc) · 981 Bytes
/
ajoutVisite.php
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
<?php
/**
* Created by PhpStorm.
* User: hayfa
* Date: 22/04/2018
* Time: 20:26
*/
try {
$bdd= new PDO('mysql:host=localhost;dbname=hopital', 'root','');
}
catch (PDOException $e)
{
echo "erreur";
die();
}
if (isset($_POST['ok'])) {
$req = $bdd->prepare("insert into visite (`patient`,`type`,`date`,`taille`,`poids`,`diagnostique`,`docteur`,`departement`)
VALUES (:val1,:val2,:val3,:val4,:val5,:val6,:val7,:val8)");
$req->execute(array(
'val1' => $_GET['id'],
'val2' => $_POST['type'],
'val3' => $_POST['date'],
'val4' => $_POST['taille'],
'val5' => $_POST['poids'],
'val6' => $_POST['diag'],
'val7' => $_POST['doc'],
'val8' => $_GET['dep'],
));
}
header('Location: Fiche.php?id='. $_GET['id'] .' ');