2 [-include
file=
"$TPL_NAME/views/header.html"-]
3 [-php-]require_once($GLOBALS['srcdir'].
"/formdata.inc.php");[-/php-]
5 [-* we want to include our stylesheet for this view*-]
6 <link rel=
"stylesheet" href=
"[-$TPL_STYLE_PATH-]/ajax_search.css" type=
"text/css">
8 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/js/jquery-1.2.2.min.js"></script>
10 <!-- js for the popup window -->
11 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dialog.js"></script>
13 <!-- main navigation -->
14 [-*Load the Language Definitions*-]
15 [-config_load
file=
"lang.$USER_LANG"-]
17 <!-- search parameters -->
18 <h2>[-php-] xl('Searching for appointments','e'); [-/php-]
</h2>
21 if ($GLOBALS['concurrent_layout'])
22 echo
"<a href='".$GLOBALS['webroot'].
"/interface/main/main_info.php' class='menu' onclick='top.restoreSession()'>";
24 echo
"<a href='".$GLOBALS['webroot'].
"/interface/main/main.php' target='Main' class='menu' onclick='top.restoreSession()'>";
26 [-php-] xl('Return to calendar','e'); [-/php-]
</a>
27 <div id=
"calsearch_params">
28 <form name=
"theform" id=
"theform" action=
"[-$FORM_ACTION-]" method=
"POST"> <!-- onsubmit="return top.restoreSession()"> -->
29 [-php-] xl('Keywords','e'); [-/php-]:
<input type=
"text" name=
"pc_keywords" id=
"pc_keywords" value=
"[-php-]echo htmlspecialchars(strip_escape_custom($_POST['pc_keywords']),ENT_QUOTES);[-/php-]" />
30 <select name=
"pc_keywords_andor">
31 <option value=
"AND">[-php-] xl('AND','e'); [-/php-]
</option>
32 <option value=
"OR">[-php-] xl('OR','e'); [-/php-]
</option>
34 [-php-] xl('IN','e'); [-/php-]:
35 <select name=
"pc_category">
36 <option value=
"">[-php-] xl('Any Category','e'); [-/php-]
</option>
40 <select name=
"pc_topic">
41 <option value=
"">[-#_PC_SEARCH_ANY_TOPIC#-]
</option>
46 [-php-] xl('between','e'); [-/php-]
47 <input type=
"text" name=
"start" id=
"start" value=
"[-$DATE_START-]" size=
"10"/>
48 <img src='[-php-] echo $GLOBALS['webroot'] [-/php-]/interface/pic/show_calendar.gif' align='absbottom' width='
24' height='
22' id='img_from_date' border='
0' alt='[?]' style='cursor:pointer' title='[-php-] xl('Click here to choose a date','e'); [-/php-]'
>
49 [-php-] xl('and','e'); [-/php-]
50 <input type=
"text" name=
"end" id=
"end" value=
"[-$DATE_END-]" size=
"10"/>
51 <img src='[-php-] echo $GLOBALS['webroot'] [-/php-]/interface/pic/show_calendar.gif' align='absbottom' width='
24' height='
22' id='img_to_date' border='
0' alt='[?]' style='cursor:pointer' title='[-php-] xl('Click here to choose a date','e'); [-/php-]'
>
53 [-php-] xl('for','e'); [-/php-]
54 <select name=
"provider_id" id=
"provider_id">
57 [-php-] xl('at','e'); [-/php-]
58 <select name=
"pc_facility" id=
"pc_facility">
61 <input type=
"submit" name=
"submit" id=
"submit" value=
"[-php-] xl('Submit','e'); [-/php-]" />
62 <div id=
"calsearch_status"><img src='[-php-] echo $GLOBALS['webroot'] [-/php-]/interface/pic/ajax-loader.gif'
> [-php-] xl('Searching...','e'); [-/php-]
</div>
65 <!-- end of search parameters -->
67 [-if $SEARCH_PERFORMED-]
68 <div id=
"calsearch_results">
70 <div id=
"calsearch_results_header">
73 <th class=
"calsearch_datetime">[-php-] echo xl('Date') .
"-" . xl('Time'); [-/php-]
</th>
74 <th class=
"calsearch_provider">[-php-] xl('Provider','e'); [-/php-]
</th>
75 <th class=
"calsearch_category">[-php-] xl('Category','e'); [-/php-]
</th>
76 <th class=
"calsearch_patient">[-php-] xl('Patient','e'); [-/php-]
</th>
81 <div id=
"calsearch_results_data">
84 /* I've given up on playing nice with the Smarty tag crap, it's pointlessly used
85 * in the original search. I mean, there's no clean separation between the code
86 * and HTML so we may as well just go full-bore PHP here -- JRM March
2008
90 foreach ($A_EVENTS as $eDate =
> $date_events) {
91 $eventdate = substr($eDate,
0,
4) . substr($eDate,
5,
2) . substr($eDate,
8,
2);
93 foreach ($date_events as $event) {
94 // pick up some demographic info about the provider
95 $provquery =
"SELECT * FROM users WHERE id='".$event['aid'].
"'";
96 $res = sqlStatement($provquery);
97 $provinfo = sqlFetchArray($res);
99 $eData = $event['eid'].
"~".$eventdate;
100 $trTitle = xl('Click to edit this event');
101 echo
"<tr class='calsearch_event' id='".$eData.
"' title='".$trTitle.
"'>";
104 $eDatetime = strtotime($eDate.
" ".$event['startTime']);
105 echo
"<td class='calsearch_datetime'>";
106 echo date(
"Y-m-d h:i a", $eDatetime);
110 echo
"<td class='calsearch_provider'>".$event['provider_name'];
111 $imgtitle = $provinfo['fname'] .
" " . xl('contact info') .
":\n";
112 $imgtitle .= $provinfo['phonew1'].
"\n".$provinfo['street'].
"\n".$provinfo['city'].
" ".$provinfo['state'];
113 echo
" <img class'provinfo' src='".$GLOBALS['webroot'].
"/images/info.png' title=\"".$imgtitle."\
" />";
117 echo
"<td class='calsearch_category'>";
118 echo $event['catname'];
122 echo
"<td class='calsearch_patient'>";
123 echo $event['patient_name'];
137 /* the A_EVENTS array holds an array of dates, which in turn hold the array of events
138 * so it will always be non-zero, so we need to count the events as they are
139 * displayed and if the count is zero, then we have no search results
141 if ($eventCount ==
0) {
142 echo
"<tr><td colspan='4' style='text-align: center'>" . xl('No Results') .
"</td></tr>";
147 </div> <!-- end results-data DIV -->
149 </div> <!-- end outer results DIV -->
151 [-/if-] [-*end of SEARCH_PERFORMED*-]
153 <!-- stuff for the popup calendar -->
154 <style type=
"text/css">@import url
([-php-
] echo $GLOBALS
['webroot'] [-/php-
]/library
/dynarch_calendar
.css
);</style>
155 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar.js"></script>
156 [-php-] include_once(
"{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); [-/php-]
157 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar_setup.js"></script>
158 <script language=
"Javascript">
159 Calendar
.setup({inputField
:"start", ifFormat
:"%m/%d/%Y", button
:"img_from_date"});
160 Calendar
.setup({inputField
:"end", ifFormat
:"%m/%d/%Y", button
:"img_to_date"});
163 <script language=
"javascript">
164 // jQuery stuff to make the page a little easier to use
166 $(document
).ready(function(){
167 $("#pc_keywords").focus();
168 $("#theform").submit(function() { SubmitForm(this); });
169 $(".calsearch_event").mouseover(function() { $(this).toggleClass("highlight"); });
170 $(".calsearch_event").mouseout(function() { $(this).toggleClass("highlight"); });
171 $(".calsearch_event").click(function() { EditEvent(this); });
174 // open a pop up to edit the event
175 // parts[] ==> 0=eventID
176 var EditEvent = function (eObj
) {
178 var parts
= objID
.split("~");
179 dlgopen('add_edit_event.php?date='+ parts
[1] +'&eid=' + parts
[0], '_blank', 550, 310);
182 // show the 'searching...' status and submit the form
183 var SubmitForm = function(eObj
) {
184 $("submit").css("disabled", "true");
185 $("#calsearch_status").css("visibility", "visible");
186 return top
.restoreSession();
189 function goPid(pid
) {
190 top
.restoreSession();
192 if ($GLOBALS
['concurrent_layout'])
195 echo
"top.RTop.location = '../../patient_file/summary/demographics.php' " .
196 "+ '?set_pid=' + pid;\n";
199 echo
"top.location = '../../patient_file/patient_file.php' " .
200 "+ '?set_pid=' + pid + '&pid=' + pid;\n";
206 [-*include
file=
"$TPL_NAME/views/footer.html"*-]