Commit b9a983eb authored by Gabriel Moreau's avatar Gabriel Moreau
Browse files

Merge branch 'devel' of gricad-gitlab.univ-grenoble-alpes.fr:legi/soft/gestex into devel

parents ab209dc4 37c13417
......@@ -47,8 +47,6 @@ CREATE TABLE IF NOT EXISTS `recipe` (
`pathname` VARCHAR(500) DEFAULT NULL,
`description` VARCHAR(150) NOT NULL,
`intervention_id` INT(11) NOT NULL,
`equipment_id` INT(11) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`intervention_id`) REFERENCES `intervention`(`id`),
FOREIGN KEY (`equipment_id`) REFERENCES `listing`(`id`)
FOREIGN KEY (`intervention_id`) REFERENCES `intervention`(`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 CHARSET=utf8;
\ No newline at end of file
......@@ -1495,6 +1495,18 @@ function del_recipe_by_id($pdo, $id) {
// ---------------------------------------------------------------------
function get_recipe_all_by_id($pdo, $id) {
$sql = 'SELECT * FROM recipe WHERE id = ?;' ;
$stmt = $pdo->prepare($sql);
$stmt->execute(array($id));
$result_fetch = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (count($result_fetch) > 0)
return $result_fetch[0];
return false;
}
// ---------------------------------------------------------------------
function get_recipe_listall_by_equipment($pdo, $equipment_id) {
$sql = 'SELECT * FROM recipe WHERE equipment_id = ?;' ;
$stmt = $pdo->prepare($sql);
......
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