2 include_once("../../globals.php");
3 include_once("$srcdir/onotes.inc");
5 //the number of records to display per screen
8 if (!isset($offset)) { $offset=0; }
10 if (!isset($active)) { $active="all"; }
12 //this code handles changing the state of activity tags when the user updates them through the interface
14 if ($mode == "update") {
15 foreach ($_POST as $var => $val) {
16 if ($val == "true" ||
$val == "false") {
17 $id = str_replace("act","",$var);
18 if ($val == "true") {reappearOnote ($id);}elseif($val=="false"){disappearOnote($id);};
19 //print "$id: $val > $act_state<br>\n";
22 } elseif ($mode == "new") {
23 addOnote($_POST["note"]);
30 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
33 <body
class="body_top">
35 <div id
="officenotes_edit">
37 <form method
="post" name
="new_note" action
="office_comments_full.php">
40 /* BACK should go to the main Office Notes screen */
41 if ($userauthorized) { $backurl="office_comments.php"; }
42 else { $backurl="../main_info.php"; }
45 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
46 <a href
="office_comments.php">
48 <a href
="<?php echo $backurl; ?>" target
="Main">
51 <span
class="title"><?php
xl('Office Notes','e'); ?
></span
>
52 <span
class="back"><?php
echo $tback; ?
></span
></a
>
55 <input type
="hidden" name
="mode" value
="new">
56 <input type
="hidden" name
="offset" value
="<?php echo $offset; ?>">
57 <input type
="hidden" name
="active" value
="<?php echo $active; ?>">
59 <textarea name
="note" rows
="6" cols
="40" wrap
="virtual"></textarea
>
61 <a href
="javascript:document.new_note.submit();" class="link_submit">[<?php
xl ('Add New Note','e'); ?
>]</a
>
66 <form method
="post" name
="update_activity" action
="office_comments_full.php">
68 <?php
//change the view on the current mode, whether all, active, or inactive
69 $all_class="link"; $active_class="link"; $inactive_class="link";
70 if ($active=="all") { $all_class="link_selected"; }
71 elseif ($active==1) { $active_class="link_selected"; }
72 elseif ($active==0) { $inactive_class="link_selected"; }
75 <span
class="text"><?php
xl('View:','e'); ?
> </span
>
76 <a href
="office_comments_full.php?offset=0&active=all" class="<?php echo $all_class;?>">[<?php
xl('All','e'); ?
>]</a
>
77 <a href
="office_comments_full.php?offset=0&active=1" class="<?php echo $active_class;?>">[<?php
xl ('Only Active','e'); ?
>]</a
>
78 <a href
="office_comments_full.php?offset=0&active=0" class="<?php echo $inactive_class;?>">[<?php
xl('Only Inactive','e'); ?
>]</a
>
80 <input type
="hidden" name
="mode" value
="update">
81 <input type
="hidden" name
="offset" value
="<?php echo $offset;?>">
82 <input type
="hidden" name
="active" value
="<?php echo $active;?>">
84 <a href
="javascript:document.update_activity.submit();" class="link_submit">[<?php
xl('Change Activity','e'); ?
>]</a
>
86 <table border
="0" class="existingnotes">
88 //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
91 if ($result = getOnoteByDate("", $active, "id,date,body,user,activity",$N,$offset)) {
93 foreach ($result as $iter) {
96 if (getdate() == strtotime($iter{"date"})) {
97 $date_string = "Today, " . date( "D F dS" ,strtotime($iter{"date"}));
99 $date_string = date( "D F dS" ,strtotime($iter{"date"}));
102 if ($iter{"activity"}) { $checked = "checked"; }
103 else { $checked = ""; }
105 print "<tr><td><input type=hidden value='' name='act".$iter{"id"}."' id='act".$iter{"id"}."'>";
106 print "<input name='box".$iter{"id"}."' id='box".$iter{"id"}."' onClick='javascript:document.update_activity.act".$iter{"id"}.".value=this.checked' type=checkbox $checked></td>";
107 print "<td><label for='box".$iter{"id"}."' class='bold'>".$date_string . "</label>";
108 print " <label for='box".$iter{"id"}."' class='bold'>(". $iter{"user"}.")</label></td>";
109 print "<td><label for='box".$iter{"id"}."' class='text'>" . stripslashes($iter{"body"}) . " </label></td></tr>\n";
116 print "<tr><td></td><td></td><td></td></tr>\n";
122 <a href
="javascript:document.update_activity.submit();" class="link_submit">[<?php
xl ('Change Activity','e'); ?
>]</a
>
126 <table width
="400" border
="0" cellpadding
="0" cellspacing
="0">
129 if ($offset>($N-1)) {
130 echo "<a class='link' href=office_comments_full.php?active=".$active."&offset=".($offset-$N).">[".xl('Previous','e')."]</a>";
133 </td
><td align
=right
>
135 if ($result_count == $N) {
136 echo "<a class='link' href=office_comments_full.php?active=".$active."&offset=".($offset+
$N).">[".xl('Next')."]</a>";