2 [-include
file=
"$TPL_NAME/views/header.html"-]
4 [-* we want to include our stylesheet for this view*-]
5 <link rel=
"stylesheet" href=
"[-$TPL_STYLE_PATH-]/ajax_search.css" type=
"text/css">
7 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['assets_static_relative'] [-/php-]/jquery-min-1-2-2/index.js"></script>
9 <!-- js for the popup window -->
10 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dialog.js?v=[-php-] echo $v_js_includes; [-/php-]"></script>
12 <!-- main navigation -->
13 [-*Load the Language Definitions*-]
14 [-config_load
file=
"lang.$USER_LANG"-]
16 <!-- search parameters -->
17 <h2>[-php-] xl('Searching for appointments','e'); [-/php-]
</h2>
20 echo
"<a href='".$GLOBALS['webroot'].
"/interface/main/main_info.php' class='menu' onclick='top.restoreSession()'>";
22 [-php-] xl('Return to calendar','e'); [-/php-]
</a>
23 <div id=
"calsearch_params">
24 <form name=
"theform" id=
"theform" action=
"[-$FORM_ACTION-]" method=
"POST"> <!-- onsubmit="return top.restoreSession()"> -->
25 [-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-]" />
26 <select name=
"pc_keywords_andor">
27 <option value=
"AND">[-php-] xl('AND','e'); [-/php-]
</option>
28 <option value=
"OR">[-php-] xl('OR','e'); [-/php-]
</option>
30 [-php-] xl('IN','e'); [-/php-]:
31 <select name=
"pc_category">
32 <option value=
"">[-php-] xl('Any Category','e'); [-/php-]
</option>
36 <select name=
"pc_topic">
37 <option value=
"">[-#_PC_SEARCH_ANY_TOPIC#-]
</option>
42 [-php-] xl('between','e'); [-/php-]
43 <input type=
"text" name=
"start" id=
"start" value=
"[-$DATE_START-]" size=
"10"/>
44 <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-]'
>
45 [-php-] xl('and','e'); [-/php-]
46 <input type=
"text" name=
"end" id=
"end" value=
"[-$DATE_END-]" size=
"10"/>
47 <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-]'
>
49 [-php-] xl('for','e'); [-/php-]
50 <select name=
"provider_id" id=
"provider_id">
53 [-php-] xl('at','e'); [-/php-]
54 <select name=
"pc_facility" id=
"pc_facility">
57 <input type=
"submit" name=
"submit" id=
"submit" value=
"[-php-] xl('Submit','e'); [-/php-]" />
58 <div id=
"calsearch_status"><img src='[-php-] echo $GLOBALS['webroot'] [-/php-]/interface/pic/ajax-loader.gif'
> [-php-] xl('Searching...','e'); [-/php-]
</div>
61 <!-- end of search parameters -->
63 [-if $SEARCH_PERFORMED-]
64 <div id=
"calsearch_results">
66 <div id=
"calsearch_results_header">
69 <th class=
"calsearch_datetime">[-php-] echo xl('Date') .
"-" . xl('Time'); [-/php-]
</th>
70 <th class=
"calsearch_provider">[-php-] xl('Provider','e'); [-/php-]
</th>
71 <th class=
"calsearch_category">[-php-] xl('Category','e'); [-/php-]
</th>
72 <th class=
"calsearch_patient">[-php-] xl('Patient','e'); [-/php-]
</th>
77 <div id=
"calsearch_results_data">
80 /* I've given up on playing nice with the Smarty tag crap, it's pointlessly used
81 * in the original search. I mean, there's no clean separation between the code
82 * and HTML so we may as well just go full-bore PHP here -- JRM March
2008
86 foreach ($this-
>get_template_vars('A_EVENTS') as $eDate =
> $date_events) {
87 $eventdate = substr($eDate,
0,
4) . substr($eDate,
5,
2) . substr($eDate,
8,
2);
89 foreach ($date_events as $event) {
90 // pick up some demographic info about the provider
91 $provquery =
"SELECT * FROM users WHERE id='".$event['aid'].
"'";
92 $res = sqlStatement($provquery);
93 $provinfo = sqlFetchArray($res);
95 $eData = $event['eid'].
"~".$eventdate;
96 $trTitle = xl('Click to edit this event');
97 echo
"<tr class='calsearch_event' id='".$eData.
"' title='".$trTitle.
"'>";
100 $eDatetime = strtotime($eDate.
" ".$event['startTime']);
101 echo
"<td class='calsearch_datetime'>";
102 echo date(
"Y-m-d h:i a", $eDatetime);
106 echo
"<td class='calsearch_provider'>".$event['provider_name'];
107 $imgtitle = $provinfo['fname'] .
" " . xl('contact info') .
":\n";
108 $imgtitle .= $provinfo['phonew1'].
"\n".$provinfo['street'].
"\n".$provinfo['city'].
" ".$provinfo['state'];
109 echo
" <img class'provinfo' src='".$GLOBALS['webroot'].
"/images/info.png' title=\"".$imgtitle."\
" />";
113 echo
"<td class='calsearch_category'>";
114 echo $event['catname'];
118 echo
"<td class='calsearch_patient'>";
119 echo $event['patient_name'];
133 /* the A_EVENTS array holds an array of dates, which in turn hold the array of events
134 * so it will always be non-zero, so we need to count the events as they are
135 * displayed and if the count is zero, then we have no search results
137 if ($eventCount ==
0) {
138 echo
"<tr><td colspan='4' style='text-align: center'>" . xl('No Results') .
"</td></tr>";
143 </div> <!-- end results-data DIV -->
145 </div> <!-- end outer results DIV -->
147 [-/if-] [-*end of SEARCH_PERFORMED*-]
149 <!-- stuff for the popup calendar -->
150 <style type=
"text/css">@import url
([-php-
] echo $GLOBALS
['webroot'] [-/php-
]/library
/dynarch_calendar
.css
);</style>
151 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar.js"></script>
152 [-php-] include_once(
"{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); [-/php-]
153 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar_setup.js"></script>
154 <script language=
"Javascript">
155 Calendar
.setup({inputField
:"start", ifFormat
:"%m/%d/%Y", button
:"img_from_date"});
156 Calendar
.setup({inputField
:"end", ifFormat
:"%m/%d/%Y", button
:"img_to_date"});
159 <script language=
"javascript">
160 // jQuery stuff to make the page a little easier to use
162 $(document
).ready(function(){
163 $("#pc_keywords").focus();
164 $("#theform").submit(function() { SubmitForm(this); });
165 $(".calsearch_event").mouseover(function() { $(this).toggleClass("highlight"); });
166 $(".calsearch_event").mouseout(function() { $(this).toggleClass("highlight"); });
167 $(".calsearch_event").click(function() { EditEvent(this); });
170 // open a pop up to edit the event
171 // parts[] ==> 0=eventID
172 var EditEvent = function (eObj
) {
174 var parts
= objID
.split("~");
175 dlgopen('add_edit_event.php?date='+ parts
[1] +'&eid=' + parts
[0], '_blank', 775, 500);
178 // show the 'searching...' status and submit the form
179 var SubmitForm = function(eObj
) {
180 $("submit").css("disabled", "true");
181 $("#calsearch_status").css("visibility", "visible");
182 return top
.restoreSession();
185 function goPid(pid
) {
186 top
.restoreSession();
188 echo
"top.RTop.location = '../../patient_file/summary/demographics.php' " .
189 "+ '?set_pid=' + pid;\n";
194 [-*include
file=
"$TPL_NAME/views/footer.html"*-]