Exemple #1
0
 }
 if ($prev >= 0) {
     $prevlink = "<a href=\"messages.php?show_all=" . attr($showall) . "&sortby=" . attr($sortby) . "&sortorder=" . attr($sortorder) . "&begin=" . attr($prev) . "&{$activity_string_html}\" onclick=\"top.restoreSession()\"><<</a>";
 } else {
     $prevlink = "<<";
 }
 if ($next < $total) {
     $nextlink = "<a href=\"messages.php?show_all=" . attr($showall) . "&sortby=" . attr($sortby) . "&sortorder=" . attr($sortorder) . "&begin=" . attr($next) . "&{$activity_string_html}\" onclick=\"top.restoreSession()\">>></a>";
 } else {
     $nextlink = ">>";
 }
 // Display the Messages table header.
 echo "\n    <table width=100%><tr><td><table border=0 cellpadding=1 cellspacing=0 width=90%  style=\"border-left: 1px #000000 solid; border-right: 1px #000000 solid; border-top: 1px #000000 solid;\">\n    <form name=MessageList action=\"messages.php?showall=" . attr($showall) . "&sortby=" . attr($sortby) . "&sortorder=" . attr($sortorder) . "&begin=" . attr($begin) . "&{$activity_string_html}\" method=post>\n    <input type=hidden name=task value=delete>\n        <tr height=\"24\" style=\"background:lightgrey\">\n            <td align=\"center\" width=\"25\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\"><input type=checkbox id=\"checkAll\" onclick=\"selectAll()\"></td>\n            <td width=\"20%\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\" class=bold>&nbsp;<b>" . htmlspecialchars(xl('From'), ENT_NOQUOTES) . "</b> {$sortlink['0']}</td>\n            <td width=\"20%\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\" class=bold>&nbsp;<b>" . htmlspecialchars(xl('Patient'), ENT_NOQUOTES) . "</b> {$sortlink['1']}</td>\n            <td style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\" class=bold>&nbsp;<b>" . htmlspecialchars(xl('Type'), ENT_NOQUOTES) . "</b> {$sortlink['2']}</td>\n            <td width=\"15%\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\" class=bold>&nbsp;<b>" . htmlspecialchars(xl('Date'), ENT_NOQUOTES) . "</b> {$sortlink['3']}</td>\n            <td width=\"15%\" style=\"border-bottom: 1px #000000 solid; \" class=bold>&nbsp;<b>" . htmlspecialchars(xl('Status'), ENT_NOQUOTES) . "</b> {$sortlink['4']}</td>\n        </tr>";
 // Display the Messages table body.
 $count = 0;
 $result = getPnotesByUser($active, $show_all, $_SESSION['authUser'], false, $sortby, $sortorder, $begin, $listnumber);
 while ($myrow = sqlFetchArray($result)) {
     $name = $myrow['user'];
     $name = $myrow['users_lname'];
     if ($myrow['users_fname']) {
         $name .= ", " . $myrow['users_fname'];
     }
     $patient = $myrow['pid'];
     if ($patient > 0) {
         $patient = $myrow['patient_data_lname'];
         if ($myrow['patient_data_fname']) {
             $patient .= ", " . $myrow['patient_data_fname'];
         }
     } else {
         $patient = "* Patient must be set manually *";
     }
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// --------------------------------------------------------------------------//
// Original Author of this file: Craig Bezuidenhout (Tajemo Enterprises)     //
// Purpose of this file: Returns a count of due messages for current user    //
// --------------------------------------------------------------------------//
//SANITIZE ALL ESCAPES
$sanitize_all_escapes = true;
//
//STOP FAKE REGISTER GLOBALS
$fake_register_globals = false;
require_once "../../interface/globals.php";
require_once "{$srcdir}/htmlspecialchars.inc.php";
require_once "{$srcdir}/dated_reminder_functions.php";
require_once "{$srcdir}/pnotes.inc";
//Collect number of due reminders
$dueReminders = GetDueReminderCount(5, strtotime(date('Y/m/d')));
//Collect number of active messages
$activeMessages = getPnotesByUser("1", "no", $_SESSION['authUser'], true);
$totalNumber = $dueReminders + $activeMessages;
echo $totalNumber > 0 ? '(' . text(intval($totalNumber)) . ')' : '';