Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / admin / what-list_holiday.php
index e3899b351cae6fac7429e5800f4c0e4875f7d0c1..51bb307ccc5b793778efcbf456b260db9cf64a99 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -44,28 +44,33 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 // Start listing holiday requests
-$result = SQL_QUERY("SELECT
-       h.id, h.userid, h.holiday_start, h.holiday_end, h.comments, d.status, d.last_online
+$result = sqlQuery("SELECT
+       `h`.`id`,
+       `h`.`userid`,
+       `h`.`holiday_start`,
+       `h`.`holiday_end`,
+       `h`.`comments`,
+       `d`.`status`,
+       `d`.`last_online`
 FROM
-       `{?_MYSQL_PREFIX?}_user_holidays` AS h
+       `{?_MYSQL_PREFIX?}_user_holidays` AS `h`
 LEFT JOIN
-       `{?_MYSQL_PREFIX?}_user_data` AS d
+       `{?_MYSQL_PREFIX?}_user_data` AS `d`
 ON
-       h.userid=d.userid
+       `h`.`userid`=`d`.`userid`
 ORDER BY
-       h.userid ASC", __FILE__, __LINE__);
+       `h`.`userid` ASC", __FILE__, __LINE__);
 
-if (!SQL_HASZERONUMS($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // List all holiday requests
        $OUT = '';
-       while ($content = SQL_FETCHARRAY($result)) {
+       while ($content = sqlFetchArray($result)) {
                // Prepare data for the row template
                $content = array(
                        'id'          => $content['id'],
                        'userid'      => $content['userid'],
                        'start'       => generateDateTime($content['holiday_start'], 3),
                        'end'         => generateDateTime($content['holiday_end'], 3),
-                       'comments'    => wordwrap($content['comments'], 15),
                        'status'      => $content['status'],
                        'last_online' => generateDateTime($content['last_online'], 3),
                );
@@ -75,13 +80,13 @@ if (!SQL_HASZERONUMS($result)) {
        } // END - while
 
        // Free memory
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Load main template
        loadTemplate('admin_list_holiday', FALSE, $OUT);
 } else {
        // No holiday requests found
-       displayMessage('{--ADMIN_HOLIDAY_NOTHING_FOUND--}');
+       displayMessage('{--ADMIN_LIST_HOLIDAY_404--}');
 }
 
 // [EOF]