17298772206d1e75d06c75e370dc9ec954d68592
[openemr.git] / interface / main / messages / messages.php
blob17298772206d1e75d06c75e370dc9ec954d68592
1 <?php
2 /**
3 * Copyright (C) 2010 OpenEMR Support LLC
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 */
9 //SANITIZE ALL ESCAPES
10 $sanitize_all_escapes=true;
12 //STOP FAKE REGISTER GLOBALS
13 $fake_register_globals=false;
15 require_once('../../globals.php');
16 require_once("$srcdir/pnotes.inc");
17 require_once("$srcdir/patient.inc");
18 require_once("$srcdir/acl.inc");
19 require_once("$srcdir/log.inc");
20 require_once("$srcdir/options.inc.php");
21 require_once("$srcdir/formdata.inc.php");
22 require_once("$srcdir/classes/Document.class.php");
23 require_once("$srcdir/gprelations.inc.php");
24 require_once("$srcdir/formatting.inc.php");
26 <html>
27 <head>
29 <?php html_header_show();?>
30 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
31 <script type="text/javascript" src="../../../library/dialog.js"></script>
32 <script type="text/javascript" src="../../../library/textformat.js"></script>
33 <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/js/jquery.js"></script>
34 </head>
36 <body class="body_top">
38 <span class="title"><?php echo xlt('Message and Reminder Center'); ?></span>
39 <br /><br />
40 <span class="title"><?php echo xlt('Reminders'); ?></span>
42 <?php
44 // TajEmo Work by CB 2012/01/11 02:51:25 PM adding dated reminders
45 // I am asuming that at this point security checks have been performed
46 require_once '../dated_reminders/dated_reminders.php';
48 // Check to see if the user has Admin rights, and if so, allow access to See All.
49 $showall = isset($_GET['show_all']) ? $_GET['show_all'] : "" ;
50 if ($showall == "yes") {
51 $show_all = $showall;
53 else
55 $show_all= "no";
58 // Collect active variable and applicable html code for links
59 $form_active = $_REQUEST['form_active'];
60 $form_inactive = $_REQUEST['form_inactive'];
61 if ($form_active) {
62 $active = '1';
63 $activity_string_html = 'form_active=1';
65 else if ($form_inactive) {
66 $active = '0';
67 $activity_string_html = 'form_inactive=1';
69 else {
70 $active = 'all';
71 $activity_string_html = '';
74 //collect the task setting
75 $task= isset($_REQUEST['task']) ? $_REQUEST['task'] : "";
77 if (acl_check('admin', 'super' )) {
78 if ($show_all=='yes') {
79 $showall = "yes";
80 $lnkvar="'messages.php?show_all=no&$activity_string_html' name='Just Mine' onclick=\"top.restoreSession()\"> (".htmlspecialchars( xl('Just Mine'), ENT_NOQUOTES).")";
82 else {
83 $showall = "no";
84 $lnkvar="'messages.php?show_all=yes&$activity_string_html' name='See All' onclick=\"top.restoreSession()\"> (".htmlspecialchars( xl('See All'), ENT_NOQUOTES).")";
88 <br>
89 <table><tr><td><span class="title"><?php echo htmlspecialchars( xl('Messages'), ENT_NOQUOTES); ?></span> <a class='more' href=<?php echo $lnkvar; ?></a></td></tr></table>
90 <?php
91 //show the activity links
92 if (empty($task) || $task=="add" || $task=="delete") { ?>
93 <?php if ($active == "all") { ?>
94 <span><?php echo xlt('Show All'); ?></span>
95 <?php } else { ?>
96 <a href="messages.php" class="link" onclick="top.restoreSession()"><span><?php echo xlt('Show All'); ?></span></a>
97 <?php } ?>
99 <?php if ($active == '1') { ?>
100 <span><?php echo xlt('Show Active'); ?></span>
101 <?php } else { ?>
102 <a href="messages.php?form_active=1" class="link" onclick="top.restoreSession()"><span><?php echo xlt('Show Active'); ?></span></a>
103 <?php } ?>
105 <?php if ($active == '0') { ?>
106 <span><?php echo xlt('Show Inactive'); ?></span>
107 <?php } else { ?>
108 <a href="messages.php?form_inactive=1" class="link" onclick="top.restoreSession()"><span><?php echo xlt('Show Inactive'); ?></span></a>
109 <?php } ?>
110 <?php } ?>
112 <?php
113 switch($task) {
114 case "add" :
116 // Add a new message for a specific patient; the message is documented in Patient Notes.
117 // Add a new message; it's treated as a new note in Patient Notes.
118 $note = $_POST['note'];
119 $noteid = $_POST['noteid'];
120 $form_note_type = $_POST['form_note_type'];
121 $assigned_to = $_POST['assigned_to'];
122 $form_message_status = $_POST['form_message_status'];
123 $reply_to = $_POST['reply_to'];
124 $assigned_to_list = explode(';',$assigned_to);
125 foreach($assigned_to_list as $assigned_to){
126 if ($noteid && $assigned_to != '-patient-') {
127 updatePnote($noteid, $note, $form_note_type, $assigned_to, $form_message_status);
128 $noteid = '';
130 else {
131 if($noteid && $assigned_to == '-patient-'){
132 $row = getPnoteById($noteid);
133 if (! $row) die("getPnoteById() did not find id '$noteid'");
134 $pres = sqlQuery("SELECT lname, fname " .
135 "FROM patient_data WHERE pid = ?", array($reply_to) );
136 $patientname = $pres['lname'] . ", " . $pres['fname'];
137 $note .= "\n\n$patientname on ".$row['date']." wrote:\n\n";
138 $note .= $row['body'];
140 addPnote($reply_to, $note, $userauthorized, '1', $form_note_type, $assigned_to, '', $form_message_status);
143 } break;
144 case "save" : {
145 // Update alert.
146 $noteid = $_POST['noteid'];
147 $form_message_status = $_POST['form_message_status'];
148 updatePnoteMessageStatus($noteid,$form_message_status);
149 $task = "edit";
150 $note = $_POST['note'];
151 $title = $_POST['form_note_type'];
152 $assigned_to = $_POST['assigned_to'];
153 $reply_to = $_POST['reply_to'];
155 case "edit" : {
156 if ($noteid == "") {
157 $noteid = $_GET['noteid'];
159 // Update the message if it already exists; it's appended to an existing note in Patient Notes.
160 $result = getPnoteById($noteid);
161 if ($result) {
162 if ($title == ""){
163 $title = $result['title'];
165 if ($assigned_to == ""){
166 $assigned_to = $result['assigned_to'];
168 $body = $result['body'];
169 if ($reply_to == ""){
170 $reply_to = $result['pid'];
172 $form_message_status = $result['message_status'];
174 } break;
175 case "delete" : {
176 // Delete selected message(s) from the Messages box (only).
177 $delete_id = $_POST['delete_id'];
178 for($i = 0; $i < count($delete_id); $i++) {
179 deletePnote($delete_id[$i]);
180 newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "pnotes: id ".$delete_id[$i]);
182 } break;
185 if($task == "addnew" or $task == "edit") {
186 // Display the Messages page layout.
187 echo "
188 <form name=new_note id=new_note action=\"messages.php?showall=$showall&sortby=$sortby&sortorder=$sortorder&begin=$begin&$activity_string_html\" method=post>
189 <input type=hidden name=noteid id=noteid value=".htmlspecialchars( $noteid, ENT_QUOTES).">
190 <input type=hidden name=task id=task value=add>";
192 <div id="pnotes"><center>
193 <table border='0' cellspacing='8'>
194 <tr>
195 <td class='text' align='center'>
196 <b><?php echo htmlspecialchars( xl('Type'), ENT_NOQUOTES); ?>:</b>
197 <?php
198 if ($title == "") {
199 $title = "Unassigned";
201 // Added 6/2009 by BM to incorporate the patient notes into the list_options listings.
202 generate_form_field(array('data_type'=>1,'field_id'=>'note_type','list_id'=>'note_type','empty_title'=>'SKIP','order_by'=>'title'), $title);
204 &nbsp; &nbsp;
205 <b><?php echo htmlspecialchars( xl('To'), ENT_QUOTES); ?>:</b>
206 <input type='textbox' name='assigned_to_text' id='assigned_to_text' size='50' readonly='readonly' value='<?php echo htmlspecialchars(xl("Select Users From The Dropdown List"), ENT_QUOTES)?>' >
207 <input type='hidden' name='assigned_to' id='assigned_to' >
208 <select name='users' id='users' onchange='addtolist(this);' >
210 <?php
211 echo "<option value='" . htmlspecialchars( '--', ENT_QUOTES) . "'";
212 echo ">" . htmlspecialchars( xl('Select User'), ENT_NOQUOTES);
213 echo "</option>\n";
214 $ures = sqlStatement("SELECT username, fname, lname FROM users " .
215 "WHERE username != '' AND active = 1 AND " .
216 "( info IS NULL OR info NOT LIKE '%Inactive%' ) " .
217 "ORDER BY lname, fname");
218 while ($urow = sqlFetchArray($ures)) {
219 echo " <option value='" . htmlspecialchars( $urow['username'], ENT_QUOTES) . "'";
220 if ($urow['username'] == $assigned_to) echo " selected";
221 echo ">" . htmlspecialchars( $urow['lname'], ENT_NOQUOTES);
222 if ($urow['fname']) echo ", " . htmlspecialchars( $urow['fname'], ENT_NOQUOTES);
223 echo "</option>\n";
225 echo "<option value='" . htmlspecialchars( '-patient-', ENT_QUOTES) . "'";
226 if ($assigned_to == '-patient-') echo " selected";
227 echo ">" . htmlspecialchars( '-Patient-', ENT_NOQUOTES);
228 echo "</option>\n";
230 </select>
231 </td>
232 </tr>
233 <tr>
234 <td class='text' align='center'>
235 <?php if ($task != "addnew") { ?>
236 <a class="patLink" onclick="goPid('<?php echo attr($result['pid']);?>')"><?php echo htmlspecialchars( xl('Patient'), ENT_NOQUOTES); ?>:</a>
237 <?php } else { ?>
238 <b class='<?php echo ($task=="addnew"?"required":"") ?>'><?php echo htmlspecialchars( xl('Patient'), ENT_NOQUOTES); ?>:</b>
239 <?php
241 if ($reply_to) {
242 $prow = sqlQuery("SELECT lname, fname " .
243 "FROM patient_data WHERE pid = ?", array($reply_to) );
244 $patientname = $prow['lname'] . ", " . $prow['fname'];
246 if ($patientname == '') {
247 $patientname = xl('Click to select');
248 } ?>
249 <input type='text' size='10' name='form_patient' style='width:150px;<?php echo ($task=="addnew"?"cursor:pointer;cursor:hand;":"") ?>' value='<?php echo htmlspecialchars($patientname, ENT_QUOTES); ?>' <?php echo ($task=="addnew"?"onclick='sel_patient()' readonly":"disabled") ?> title='<?php echo ($task=="addnew"?(htmlspecialchars( xl('Click to select patient'), ENT_QUOTES)):"") ?>' />
250 <input type='hidden' name='reply_to' id='reply_to' value='<?php echo htmlspecialchars( $reply_to, ENT_QUOTES) ?>' />
251 &nbsp; &nbsp;
252 <b><?php echo htmlspecialchars( xl('Status'), ENT_NOQUOTES); ?>:</b>
253 <?php
254 if ($form_message_status == "") {
255 $form_message_status = 'New';
257 generate_form_field(array('data_type'=>1,'field_id'=>'message_status','list_id'=>'message_status','empty_title'=>'SKIP','order_by'=>'title'), $form_message_status); ?>
258 </td>
259 </tr>
260 <tr>
261 <td>
263 <?php
265 if ($noteid) {
266 $body = preg_replace('/(:\d{2}\s\()'.$result['pid'].'(\sto\s)/','${1}'.$patientname.'${2}',$body);
267 $body = nl2br(htmlspecialchars( $body, ENT_NOQUOTES));
268 echo "<div class='text' style='background-color:white; color: gray; border:1px solid #999; padding: 5px; width: 640px;'>".$body."</div>";
272 <textarea name='note' id='note' rows='8' style="width: 660px; "><?php echo htmlspecialchars( $note, ENT_NOQUOTES) ?></textarea>
273 </td>
274 </tr>
275 </table>
277 <?php if ($noteid) { ?>
278 <!-- This is for displaying an existing note. -->
279 <input type="button" id="newnote" value="<?php echo htmlspecialchars( xl('Send message'), ENT_QUOTES); ?>">
280 <input type="button" id="printnote" value="<?php echo htmlspecialchars( xl('Print message'), ENT_QUOTES); ?>">
281 <input type="button" id="cancel" value="<?php echo htmlspecialchars( xl('Cancel'), ENT_QUOTES); ?>">
282 <?php } else { ?>
283 <!-- This is for displaying a new note. -->
284 <input type="button" id="newnote" value="<?php echo htmlspecialchars( xl('Send message'), ENT_QUOTES); ?>">
285 <input type="button" id="cancel" value="<?php echo htmlspecialchars( xl('Cancel'), ENT_QUOTES); ?>">
286 <?php }
289 <br>
290 </form></center></div>
291 <script language="javascript">
293 // jQuery stuff to make the page a little easier to use
295 $(document).ready(function(){
296 $("#newnote").click(function() { NewNote(); });
297 $("#printnote").click(function() { PrintNote(); });
298 obj = document.getElementById("form_message_status");
299 obj.onchange = function(){SaveNote();};
300 $("#cancel").click(function() { CancelNote(); });
301 $("#note").focus();
303 var NewNote = function () {
304 top.restoreSession();
305 if (document.forms[0].reply_to.value.length == 0) {
306 alert('<?php echo htmlspecialchars( xl('Please choose a patient'), ENT_QUOTES); ?>');
308 else if (document.forms[0].assigned_to.value.length == 0) {
309 alert('<?php echo addslashes(xl('Recipient List Is Empty')); ?>');
311 else
313 $("#new_note").submit();
317 var PrintNote = function () {
318 top.restoreSession();
319 window.open('../../patient_file/summary/pnotes_print.php?noteid=<?php echo htmlspecialchars( $noteid, ENT_QUOTES); ?>', '_blank', 'resizable=1,scrollbars=1,width=600,height=500');
322 var SaveNote = function () {
323 <?php if ($noteid) { ?>
324 top.restoreSession();
325 $("#task").val("save");
326 $("#new_note").submit();
327 <?php } ?>
330 var CancelNote = function () {
331 top.restoreSession();
332 $("#task").val("");
333 $("#new_note").submit();
336 // This is for callback by the find-patient popup.
337 function setpatient(pid, lname, fname, dob) {
338 var f = document.forms[0];
339 f.form_patient.value = lname + ', ' + fname;
340 f.reply_to.value = pid;
343 // This invokes the find-patient popup.
344 function sel_patient() {
345 dlgopen('../../main/calendar/find_patient_popup.php', '_blank', 500, 400);
348 function addtolist(sel){
349 var itemtext = document.getElementById('assigned_to_text');
350 var item = document.getElementById('assigned_to');
351 if(sel.value != '--'){
352 if(item.value){
353 if(item.value.indexOf(sel.value) == -1){
354 itemtext.value = itemtext.value +' ; '+ sel.options[sel.selectedIndex].text;
355 item.value = item.value +';'+ sel.value;
357 }else{
358 itemtext.value = sel.options[sel.selectedIndex].text;
359 item.value = sel.value;
364 </script><?php
366 else {
368 // This is for sorting the records.
369 $sort = array("users.lname", "patient_data.lname", "pnotes.title", "pnotes.date", "pnotes.message_status");
370 $sortby = (isset($_REQUEST['sortby']) && ($_REQUEST['sortby']!="")) ? $_REQUEST['sortby'] : $sort[0];
371 $sortorder = (isset($_REQUEST['sortorder']) && ($_REQUEST['sortorder']!="")) ? $_REQUEST['sortorder'] : "asc";
372 $begin = isset($_REQUEST['begin']) ? $_REQUEST['begin'] : 0;
374 for($i = 0; $i < count($sort); $i++) {
375 $sortlink[$i] = "<a href=\"messages.php?show_all=$showall&sortby=$sort[$i]&sortorder=asc&$activity_string_html\" onclick=\"top.restoreSession()\"><img src=\"../../../images/sortdown.gif\" border=0 alt=\"".htmlspecialchars( xl('Sort Up'), ENT_QUOTES)."\"></a>";
377 for($i = 0; $i < count($sort); $i++) {
378 if($sortby == $sort[$i]) {
379 switch($sortorder) {
380 case "asc" : $sortlink[$i] = "<a href=\"messages.php?show_all=$showall&sortby=$sortby&sortorder=desc&$activity_string_html\" onclick=\"top.restoreSession()\"><img src=\"../../../images/sortup.gif\" border=0 alt=\"".htmlspecialchars( xl('Sort Up'), ENT_QUOTES)."\"></a>"; break;
381 case "desc" : $sortlink[$i] = "<a href=\"messages.php?show_all=$showall&sortby=$sortby&sortorder=asc&$activity_string_html\" onclick=\"top.restoreSession()\"><img src=\"../../../images/sortdown.gif\" border=0 alt=\"".htmlspecialchars( xl('Sort Down'), ENT_QUOTES)."\"></a>"; break;
382 } break;
385 // Manage page numbering and display beneath the Messages table.
386 $listnumber = 25;
387 $total = getPnotesByUser($active,$show_all,$_SESSION['authUser'],true);
388 if($begin == "" or $begin == 0) {
389 $begin = 0;
391 $prev = $begin - $listnumber;
392 $next = $begin + $listnumber;
393 $start = $begin + 1;
394 $end = $listnumber + $start - 1;
395 if($end >= $total) {
396 $end = $total;
398 if($end < $start) {
399 $start = 0;
401 if($prev >= 0) {
402 $prevlink = "<a href=\"messages.php?show_all=$showall&sortby=$sortby&sortorder=$sortorder&begin=$prev&$activity_string_html\" onclick=\"top.restoreSession()\"><<</a>";
404 else {
405 $prevlink = "<<";
408 if($next < $total) {
409 $nextlink = "<a href=\"messages.php?show_all=$showall&sortby=$sortby&sortorder=$sortorder&begin=$next&$activity_string_html\" onclick=\"top.restoreSession()\">>></a>";
411 else {
412 $nextlink = ">>";
414 // Display the Messages table header.
415 echo "
416 <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;\">
417 <form name=wikiList action=\"messages.php?showall=$showall&sortby=$sortby&sortorder=$sortorder&begin=$begin&$activity_string_html\" method=post>
418 <input type=hidden name=task value=delete>
419 <tr height=\"24\" style=\"background:lightgrey\">
420 <td align=\"center\" width=\"25\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\"><input type=checkbox id=\"checkAll\" onclick=\"selectAll()\"></td>
421 <td width=\"20%\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\" class=bold>&nbsp;<b>" .
422 htmlspecialchars( xl('From'), ENT_NOQUOTES) . "</b> $sortlink[0]</td>
423 <td width=\"20%\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\" class=bold>&nbsp;<b>" .
424 htmlspecialchars( xl('Patient'), ENT_NOQUOTES) . "</b> $sortlink[1]</td>
425 <td style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\" class=bold>&nbsp;<b>" .
426 htmlspecialchars( xl('Type'), ENT_NOQUOTES) . "</b> $sortlink[2]</td>
427 <td width=\"15%\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\" class=bold>&nbsp;<b>" .
428 htmlspecialchars( xl('Date'), ENT_NOQUOTES) . "</b> $sortlink[3]</td>
429 <td width=\"15%\" style=\"border-bottom: 1px #000000 solid; \" class=bold>&nbsp;<b>" .
430 htmlspecialchars( xl('Status'), ENT_NOQUOTES) . "</b> $sortlink[4]</td>
431 </tr>";
432 // Display the Messages table body.
433 $count = 0;
434 $result = getPnotesByUser($active,$show_all,$_SESSION['authUser'],false,$sortby,$sortorder,$begin,$listnumber);
435 while ($myrow = sqlFetchArray($result)) {
436 $name = $myrow['user'];
437 $name = $myrow['users_lname'];
438 if ($myrow['users_fname']) {
439 $name .= ", " . $myrow['users_fname'];
441 $patient = $myrow['pid'];
442 $patient = $myrow['patient_data_lname'];
443 if ($myrow['patient_data_fname']) {
444 $patient .= ", " . $myrow['patient_data_fname'];
446 $count++;
447 echo "
448 <tr id=\"row$count\" style=\"background:white\" height=\"24\">
449 <td align=\"center\" style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\"><input type=checkbox id=\"check$count\" name=\"delete_id[]\" value=\"" .
450 htmlspecialchars( $myrow['id'], ENT_QUOTES) . "\" onclick=\"if(this.checked==true){ selectRow('row$count'); }else{ deselectRow('row$count'); }\"></td>
451 <td style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\"><table cellspacing=0 cellpadding=0 width=100%><tr><td width=5></td><td class=\"text\">" .
452 htmlspecialchars( $name, ENT_NOQUOTES) . "</td><td width=5></td></tr></table></td>
453 <td style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\"><table cellspacing=0 cellpadding=0 width=100%><tr><td width=5></td><td class=\"text\"><a href=\"messages.php?showall=$showall&sortby=$sortby&sortorder=$sortorder&begin=$begin&task=edit&noteid=" .
454 htmlspecialchars( $myrow['id'], ENT_QUOTES) . "&$activity_string_html\" onclick=\"top.restoreSession()\">" .
455 htmlspecialchars( $patient, ENT_NOQUOTES) . "</a></td><td width=5></td></tr></table></td>
456 <td style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\"><table cellspacing=0 cellpadding=0 width=100%><tr><td width=5></td><td class=\"text\">" .
457 htmlspecialchars( $myrow['title'], ENT_NOQUOTES) . "</td><td width=5></td></tr></table></td>
458 <td style=\"border-bottom: 1px #000000 solid; border-right: 1px #000000 solid;\"><table cellspacing=0 cellpadding=0 width=100%><tr><td width=5></td><td class=\"text\">" .
459 htmlspecialchars( oeFormatShortDate(substr($myrow['date'], 0, strpos($myrow['date'], " "))), ENT_NOQUOTES) . "</td><td width=5></td></tr></table></td>
460 <td style=\"border-bottom: 1px #000000 solid;\"><table cellspacing=0 cellpadding=0 width=100%><tr><td width=5></td><td class=\"text\">" .
461 htmlspecialchars( $myrow['message_status'], ENT_NOQUOTES) . "</td><td width=5></td></tr></table></td>
462 </tr>";
464 // Display the Messages table footer.
465 echo "
466 </form></table>
467 <table border=0 cellpadding=5 cellspacing=0 width=90%>
468 <tr>
469 <td class=\"text\"><a href=\"messages.php?showall=$showall&sortby=$sortby&sortorder=$sortorder&begin=$begin&task=addnew&$activity_string_html\" onclick=\"top.restoreSession()\">" .
470 htmlspecialchars( xl('Add New'), ENT_NOQUOTES) . "</a> &nbsp; <a href=\"javascript:confirmDeleteSelected()\" onclick=\"top.restoreSession()\">" .
471 htmlspecialchars( xl('Delete'), ENT_NOQUOTES) . "</a></td>
472 <td align=right class=\"text\">$prevlink &nbsp; $end of $total &nbsp; $nextlink</td>
473 </tr>
474 </table></td></tr></table><br>";
476 <script language="javascript">
477 // This is to confirm delete action.
478 function confirmDeleteSelected() {
479 if(confirm("<?php echo htmlspecialchars( xl('Do you really want to delete the selection?'), ENT_QUOTES); ?>")) {
480 document.wikiList.submit();
483 // This is to allow selection of all items in Messages table for deletion.
484 function selectAll() {
485 if(document.getElementById("checkAll").checked==true) {
486 document.getElementById("checkAll").checked=true;<?php
487 for($i = 1; $i <= $count; $i++) {
488 echo "document.getElementById(\"check$i\").checked=true; document.getElementById(\"row$i\").style.background='#E7E7E7'; ";
489 } ?>
491 else {
492 document.getElementById("checkAll").checked=false;<?php
493 for($i = 1; $i <= $count; $i++) {
494 echo "document.getElementById(\"check$i\").checked=false; document.getElementById(\"row$i\").style.background='#F7F7F7'; ";
495 } ?>
498 // The two functions below are for managing row styles in Messages table.
499 function selectRow(row) {
500 document.getElementById(row).style.background = "#E7E7E7";
502 function deselectRow(row) {
503 document.getElementById(row).style.background = "#F7F7F7";
505 </script><?php
509 </body>
510 </html>