BARRAUX Arthur
3 years ago
3 changed files with 24 additions and 19 deletions
Binary file not shown.
@ -1,21 +1,25 @@ |
|||
<?php |
|||
$decode = json_decode($_POST['value'], TRUE); |
|||
$bdd = new SQLite3('../../database/ticket_panne.db', SQLITE3_OPEN_READWRITE); |
|||
$request = 'UPDATE pannes SET |
|||
dates = "' .$decode["dates"] .'", |
|||
details = "' .$decode["details"] .'", |
|||
lieu = "' .$decode["lieu"] .'", |
|||
salle = "' .$decode["salle"] .'", |
|||
pos = "' .$decode["pos"] .'", |
|||
materiel = "' .$decode["materiel"] .'", |
|||
marque = "' .$decode["marque"] .'", |
|||
model = "' .$decode["model"] .'", |
|||
nserie = "' .$decode["nserie"] .'", |
|||
demandeur = "' .$decode["demandeur"] .'", |
|||
traitement = "' .$decode["traitement"] .'" |
|||
WHERE ID= "' .$decode['id'] .'"'; |
|||
$update = $bdd->query($request); |
|||
$stmt = $bdd->prepare('UPDATE pannes SET dates=:dates, details=:details, lieu=:lieu, salle=:salle, pos=:pos, materiel=:materiel, marque=:marque, model=:model, nserie=:nserie, demandeur=:demandeur, traitement=:traitement WHERE ID=:id'); |
|||
|
|||
$traitement = $bdd->query("SELECT * FROM pannes WHERE ID=" .$decode['id']); |
|||
print_r(json_encode($traitement->fetchArray())); |
|||
$stmt->bindValue(':id', $decode['id']); |
|||
$stmt->bindValue(':dates', $decode['dates']); |
|||
$stmt->bindValue(':details', $decode['details']); |
|||
$stmt->bindValue(':lieu', $decode['lieu']); |
|||
$stmt->bindValue(':salle', $decode['salle']); |
|||
$stmt->bindValue(':pos', $decode['pos']); |
|||
$stmt->bindValue(':materiel', $decode['materiel']); |
|||
$stmt->bindValue(':marque', $decode['marque']); |
|||
$stmt->bindValue(':model', $decode['model']); |
|||
$stmt->bindValue(':nserie', $decode['nserie']); |
|||
$stmt->bindValue(':demandeur', $decode['demandeur']); |
|||
$stmt->bindValue(':traitement', $decode['traitement']); |
|||
|
|||
$stmt->execute(); |
|||
|
|||
$traitement = $bdd->prepare("SELECT * FROM pannes WHERE ID=:id"); |
|||
$traitement->bindValue(':id', $decode['id']); |
|||
$res = $traitement->execute(); |
|||
print_r(json_encode($res->fetchArray())); |
|||
?> |
|||
|
Loading…
Reference in new issue