X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_holiday.php;h=51bb307ccc5b793778efcbf456b260db9cf64a99;hp=ce20c453c49c03073990d4f32e98b04fbff6f574;hb=49acdb7a7adbcf25a8e8683b5581bfcec72b23bd;hpb=aa63aed07428a99ea09002c8d072990677700080 diff --git a/inc/modules/admin/what-list_holiday.php b/inc/modules/admin/what-list_holiday.php index ce20c453c4..51bb307ccc 100644 --- a/inc/modules/admin/what-list_holiday.php +++ b/inc/modules/admin/what-list_holiday.php @@ -1,7 +1,7 @@ 0) { +if (!ifSqlHasZeroNumRows($result)) { // List all holiday requests - $OUT = ''; $SW = 2; - while ($content = SQL_FETCHARRAY($result)) { - // Add three dashes to comment when it is empty - if (empty($content['comments'])) $content['comments'] = '---'; - + $OUT = ''; + while ($content = sqlFetchArray($result)) { // Prepare data for the row template $content = array( - 'sw' => $SW, - 'id' => $content['id'], - 'uid' => ADMIN_USER_PROFILE_LINK($content['userid']), - 'start' => MAKE_DATETIME($content['holiday_start'], "3"), - 'end' => MAKE_DATETIME($content['holiday_end'], "3"), - 'comments' => wordwrap($content['comments'], 15), - 'status' => TRANSLATE_STATUS($content['status']), - 'last' => MAKE_DATETIME($content['last_online'], "3"), + 'id' => $content['id'], + 'userid' => $content['userid'], + 'start' => generateDateTime($content['holiday_start'], 3), + 'end' => generateDateTime($content['holiday_end'], 3), + 'status' => $content['status'], + 'last_online' => generateDateTime($content['last_online'], 3), ); // Load row template and switch color - $OUT .= LOAD_TEMPLATE("admin_list_holiday_row", true, $content); - $SW = 3 - $SW; - } + $OUT .= loadTemplate('admin_list_holiday_row', TRUE, $content); + } // END - while // Free memory - SQL_FREERESULT($result); - - // @TODO Rewrite this constant - define('__HOLIDAY_ROWS', $OUT); + sqlFreeResult($result); // Load main template - LOAD_TEMPLATE("admin_list_holiday"); + loadTemplate('admin_list_holiday', FALSE, $OUT); } else { // No holiday requests found - LOAD_TEMPLATE('admin_settings_saved', false, getMessage('HOLIDAY_ADMIN_NOTHING_FOUND')); + displayMessage('{--ADMIN_LIST_HOLIDAY_404--}'); } -// +// [EOF] ?>