Commit 2c6efeae authored by Estéban Ristich's avatar Estéban Ristich
Browse files

Add SQL function intervention

parent 945dd09c
......@@ -564,6 +564,23 @@ function get_intervention_listall_by_equipment($pdo, $equipment_id) {
return false;
}
// ---------------------------------------------------------------------
/**
* Créer une nouvelle fiche d'intervention
*
* @return array
*/
function set_new_intervention($pdo, $description, $supplier_id, $equipment_id, $date) {
$sql = 'INSERT INTO intervention (supplier_id, equipment_id, description, date) VALUES (?, ?, ?, ?);';
$stmt = $pdo->prepare($sql);
$iostat = $stmt->execute(array($supplier_id, $equipment_id, $description, $date));
$err_msg = '';
if (!$iostat)
$err_msg = $stmt->errorInfo()[2];
return array($pdo->lastInsertId(), $err_msg);
}
// ---------------------------------------------------------------------
// Loan
// ---------------------------------------------------------------------
......
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