Support Incident Tracker GIT4.x
dashboard_holidays.php
Go to the documentation of this file.
00001 <?php
00002 // dashboard_holidays.php - List of who's away today
00003 //
00004 // SiT (Support Incident Tracker) - Support call tracking system
00005 // Copyright (C) 2010-2011 The Support Incident Tracker Project
00006 // Copyright (C) 2000-2009 Salford Software Ltd. and Contributors
00007 //
00008 // This software may be used and distributed according to the terms
00009 // of the GNU General Public License, incorporated herein by reference.
00010 
00011 $dashboard_holidays_version = 1.01;
00012 
00013 function dashboard_holidays($dashletid)
00014 {
00015     global $sit, $CONFIG, $iconset;
00016     global $dbUsers;
00017     $user = $sit[2];
00018     echo "<div class='windowbox' style='width: 95%;' id='$dashletid'>";
00019     echo "<div class='windowtitle'>".icon('holiday', 16)." {$GLOBALS['strWhosAwayToday']}</div>";
00020     echo "<div class='window'>";
00021     $sql  = "SELECT * FROM `{$dbUsers}` WHERE status != ".USERSTATUS_ACCOUNT_DISABLED;
00022     $sql . " AND status != ".USERSTATUS_IN_OFFICE;
00023     $result = mysql_query($sql);
00024     if (mysql_error()) trigger_error("MySQL Query Error ".mysql_error(), E_USER_WARNING);
00025     if (mysql_num_rows($result) >=1)
00026     {
00027         echo "<table>";
00028         echo "<tr><th>{$GLOBALS['strName']}</th><th>{$GLOBALS['strStatus']}</th></tr>";
00029         $shade = 'shade1';
00030         while ($users = mysql_fetch_object($result))
00031         {
00032             echo "<tr class='{$shade}'>";
00033             echo "<td><strong>{$users->realname}</strong></td>";
00034             echo "<td>";
00035             $title = userstatus_name($users->status);
00036             $title .= " - ";
00037             if ($users->accepting == 'Yes') $title .= "{$GLOBALS['strAcceptingIncidents']}";
00038             else $title .= "{$GLOBALS['strNotAcceptingIncidents']}";
00039             if (!empty($users->message)) $title.= "\n({$users->message})";
00040 
00041             echo "{$title}";
00042             echo "</td>";
00043             echo "</tr>\n";
00044             if ( $shade == 'shade1') $shade = 'shade2';
00045             else $shade = 'shade1';
00046         }
00047         echo "</table>";
00048     }
00049     else echo "<p align='center'>{$GLOBALS['strNobody']}</p>\n";
00050     echo "</div></div></div>\n\n";
00051 }
00052 
00053 function dashboard_holidays_get_version()
00054 {
00055     global $dashboard_holidays_version;
00056     return $dashboard_holidays_version;
00057 }
00058 
00059 
00060 
00061 ?>