Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

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

Fix Issue #62 Add SQL del recipe by id function

parent 1b87e3c1
......@@ -1474,6 +1474,27 @@ function set_recipe_new($pdo, $equipment_id, $intervention_id, $file_field_name)
// ---------------------------------------------------------------------
function del_recipe_by_id($pdo, $id) {
$recipe_selected = get_recipe_all_by_id($pdo, $id);
$recipe_basepath = get_recipe_basepath();
$recipe_pathname = $recipe_selected['pathname'];
$recipe_dirname = pathinfo($recipe_pathname, PATHINFO_DIRNAME);
if (is_file($recipe_basepath.'/'.$recipe_pathname))
$iostat = unlink($recipe_basepath.'/'.$recipe_pathname);
if (!empty($recipe_dirname) and is_dir($recipe_basepath.'/'.$recipe_dirname))
$iostat = rmdir($recipe_basepath.'/'.$recipe_dirname);
$sql = 'DELETE LOW_PRIORITY FROM recipe WHERE id = ? LIMIT 1;';
$stmt = $pdo->prepare($sql);
$iostat = $stmt->execute(array($id));
return $iostat;
}
// ---------------------------------------------------------------------
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