diff options
author | Philip Häusler <msquare@notrademark.de> | 2015-07-12 14:45:58 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2015-07-12 14:45:58 +0200 |
commit | 8c518d4c3496ce9c72e4eed400923bd978b4e6a5 (patch) | |
tree | 6d28b53c22f9716d79398f5616a634ed2db3a08b /includes/pages/admin_arrive.php | |
parent | 66c7e67a038b24ef9788d2550da15b2209c08123 (diff) |
add arrival date feature
Diffstat (limited to 'includes/pages/admin_arrive.php')
-rw-r--r-- | includes/pages/admin_arrive.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/pages/admin_arrive.php b/includes/pages/admin_arrive.php index f51ef7ac..399cb335 100644 --- a/includes/pages/admin_arrive.php +++ b/includes/pages/admin_arrive.php @@ -1,4 +1,5 @@ <?php + function admin_arrive_title() { return _("Arrived angels"); } @@ -13,7 +14,7 @@ function admin_arrive() { $id = $_REQUEST['reset']; $user_source = User($id); if ($user_source != null) { - sql_query("UPDATE `User` SET `Gekommen`=0 WHERE `UID`='" . sql_escape($id) . "' LIMIT 1"); + sql_query("UPDATE `User` SET `Gekommen`=0, `arrival_date` = NULL WHERE `UID`='" . sql_escape($id) . "' LIMIT 1"); engelsystem_log("User set to not arrived: " . User_Nick_render($user_source)); $msg = success(_("Reset done. Angel has not arrived."), true); } else @@ -22,7 +23,7 @@ function admin_arrive() { $id = $_REQUEST['arrived']; $user_source = User($id); if ($user_source != null) { - sql_query("UPDATE `User` SET `Gekommen`=1 WHERE `UID`='" . sql_escape($id) . "' LIMIT 1"); + sql_query("UPDATE `User` SET `Gekommen`=1, `arrival_date`='" . time() . "' WHERE `UID`='" . sql_escape($id) . "' LIMIT 1"); engelsystem_log("User set has arrived: " . User_Nick_render($user_source)); $msg = success(_("Angel has been marked as arrived."), true); } else @@ -51,6 +52,8 @@ function admin_arrive() { $table .= '<tr>'; $table .= '<td>' . User_Nick_render($usr) . '</td>'; $usr['nick'] = User_Nick_render($usr); + $usr['planned_arrival_date'] = date('Y-m-d', $usr['planned_arrival_date']); + $usr['arrival_date'] = $usr['arrival_date'] > 0 ? date('Y-m-d', $usr['arrival_date']) : "-"; $usr['arrived'] = $usr['Gekommen'] == 1 ? _("yes") : ""; $usr['actions'] = $usr['Gekommen'] == 1 ? '<a href="' . page_link_to('admin_arrive') . '&reset=' . $usr['UID'] . '&search=' . $search . '">' . _("reset") . '</a>' : '<a href="' . page_link_to('admin_arrive') . '&arrived=' . $usr['UID'] . '&search=' . $search . '">' . _("arrived") . '</a>'; if ($usr['Gekommen'] == 1) @@ -68,7 +71,9 @@ function admin_arrive() { )), table(array( 'nick' => _("Nickname"), + 'planned_arrival_date' => _("Planned date"), 'arrived' => _("Arrived?"), + 'arrival_date' => _("Arrival date"), 'actions' => "" ), $users_matched) )); |