summaryrefslogtreecommitdiff
path: root/includes/pages
diff options
context:
space:
mode:
Diffstat (limited to 'includes/pages')
-rw-r--r--includes/pages/admin_import.php7
-rw-r--r--includes/pages/user_shifts.php5
2 files changed, 8 insertions, 4 deletions
diff --git a/includes/pages/admin_import.php b/includes/pages/admin_import.php
index f4c2b252..120ab91b 100644
--- a/includes/pages/admin_import.php
+++ b/includes/pages/admin_import.php
@@ -129,8 +129,11 @@ function admin_import() {
engelsystem_error('Unable to update shift.');
}
- foreach ($events_deleted as $event)
- sql_query("DELETE FROM `Shifts` WHERE `PSID`=" . sql_escape($event['PSID']) . " LIMIT 1");
+ foreach ($events_deleted as $event) {
+ $result = Shift_delete_by_psid($event['PSID']);
+ if ($result === false)
+ engelsystem_error('Unable to delete shift.');
+ }
engelsystem_log("Pentabarf import done");
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 2f0bee6e..c1a5cc91 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -178,8 +178,9 @@ function user_shifts() {
// Schicht löschen bestätigt
if (isset($_REQUEST['delete'])) {
- sql_query("DELETE FROM `NeededAngelTypes` WHERE `shift_id`=" . sql_escape($shift_id));
- sql_query("DELETE FROM `Shifts` WHERE `SID`=" . sql_escape($shift_id) . " LIMIT 1");
+ $result = Shift_delete($shift_id);
+ if ($result === false)
+ engelsystem_error('Unable to delete shift.');
engelsystem_log("Deleted shift " . $shift['name'] . " from " . date("y-m-d H:i", $shift['start']) . " to " . date("y-m-d H:i", $shift['end']));
success(_("Shift deleted."));