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['webroot'] [-/php-]/library/js/jquery-1.2.2.min.js"></script>
9 <!-- js for the popup window -->
10 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dialog.js"></script>
12 <!-- main navigation -->
13 [-*Load the Language Definitions*-]
14 [-config_load
file=
"lang.$USER_LANG"-]
16 <!-- search parameters -->
17 <h2>Searching for appointments
</h2>
18 <div id=
"calsearch_params">
19 <form name=
"theform" id=
"theform" action=
"[-$FORM_ACTION-]" method=
"POST"> <!-- onsubmit="return top.restoreSession()"> -->
20 [-#_PC_SEARCH_KEYWORDS#-]:
<input type=
"text" name=
"pc_keywords" id=
"pc_keywords" value=
"[-php-]echo $_POST['pc_keywords'];[-/php-]" />
21 <select name=
"pc_keywords_andor">
22 <option value=
"AND">[-#_PC_SEARCH_AND#-]
</option>
23 <option value=
"OR">[-#_PC_SEARCH_OR#-]
</option>
26 <select name=
"pc_category">
27 <option value=
"">[-#_PC_SEARCH_ANY_CATEGORY#-]
</option>
31 <select name=
"pc_topic">
32 <option value=
"">[-#_PC_SEARCH_ANY_TOPIC#-]
</option>
38 <input type=
"text" name=
"start" id=
"start" value=
"[-$DATE_START-]" size=
"10"/>
39 <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-]'
>
41 <input type=
"text" name=
"end" id=
"end" value=
"[-$DATE_END-]" size=
"10"/>
42 <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-]'
>
45 <select name=
"provider_id" id=
"provider_id">
49 <select name=
"pc_facility" id=
"pc_facility">
52 <input type=
"submit" name=
"submit" id=
"submit" value=
"[-#_PC_SUBMIT#-]" />
53 <div id=
"calsearch_status"><img src='[-php-] echo $GLOBALS['webroot'] [-/php-]/interface/pic/ajax-loader.gif'
> Searching...
</div>
56 <!-- end of search parameters -->
58 [-if $SEARCH_PERFORMED-]
59 <div id=
"calsearch_results">
61 <div id=
"calsearch_results_header">
64 <th class=
"calsearch_datetime">Date-Time
</th>
65 <th class=
"calsearch_provider">Provider
</th>
66 <th class=
"calsearch_category">Category
</th>
67 <th class=
"calsearch_patient">Patient
</th>
72 <div id=
"calsearch_results_data">
75 /* I've given up on playing nice with the Smarty tag crap, it's pointlessly used
76 * in the original search. I mean, there's no clean separation between the code
77 * and HTML so we may as well just go full-bore PHP here -- JRM March
2008
81 foreach ($A_EVENTS as $eDate =
> $date_events) {
82 $eventdate = substr($eDate,
0,
4) . substr($eDate,
5,
2) . substr($eDate,
8,
2);
84 foreach ($date_events as $event) {
85 // pick up some demographic info about the provider
86 $provquery =
"SELECT * FROM users WHERE id='".$event['aid'].
"'";
87 $res = sqlStatement($provquery);
88 $provinfo = sqlFetchArray($res);
90 $eData = $event['eid'].
"~".$eventdate;
91 $trTitle =
"Click to edit this event";
92 echo
"<tr class='calsearch_event' id='".$eData.
"' title='".$trTitle.
"'>";
95 $eDatetime = strtotime($eDate.
" ".$event['startTime']);
96 echo
"<td class='calsearch_datetime'>";
97 echo date(
"Y-m-d h:i a", $eDatetime);
101 echo
"<td class='calsearch_provider'>".$event['provider_name'];
102 $imgtitle = $provinfo['fname'].
"'s contact info:\n";
103 $imgtitle .= $provinfo['phonew1'].
"\n".$provinfo['street'].
"\n".$provinfo['city'].
" ".$provinfo['state'];
104 echo
" <img class'provinfo' src='".$GLOBALS['webroot'].
"/images/info.png' title=\"".$imgtitle."\
" />";
108 echo
"<td class='calsearch_category'>";
109 echo $event['catname'];
113 echo
"<td class='calsearch_patient'>";
114 echo $event['patient_name'];
128 /* the A_EVENTS array holds an array of dates, which in turn hold the array of events
129 * so it will always be non-zero, so we need to count the events as they are
130 * displayed and if the count is zero, then we have no search results
132 if ($eventCount ==
0) {
133 echo
"<tr><td colspan='4' style='text-align: center'>No Results</td></tr>";
138 </div> <!-- end results-data DIV -->
140 </div> <!-- end outer results DIV -->
142 [-/if-] [-*end of SEARCH_PERFORMED*-]
144 <!-- stuff for the popup calendar -->
145 <style type=
"text/css">@import url
([-php-
] echo $GLOBALS
['webroot'] [-/php-
]/library
/dynarch_calendar
.css
);</style>
146 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar.js"></script>
147 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar_en.js"></script>
148 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar_setup.js"></script>
149 <script language=
"Javascript">
150 Calendar
.setup({inputField
:"start", ifFormat
:"%m/%d/%Y", button
:"img_from_date"});
151 Calendar
.setup({inputField
:"end", ifFormat
:"%m/%d/%Y", button
:"img_to_date"});
154 <script language=
"javascript">
155 // jQuery stuff to make the page a little easier to use
157 $(document
).ready(function(){
158 $("#pc_keywords").focus();
159 $("#theform").submit(function() { SubmitForm(this); });
160 $(".calsearch_event").mouseover(function() { $(this).toggleClass("highlight"); });
161 $(".calsearch_event").mouseout(function() { $(this).toggleClass("highlight"); });
162 $(".calsearch_event").click(function() { EditEvent(this); });
165 // open a pop up to edit the event
166 // parts[] ==> 0=eventID
167 var EditEvent = function (eObj
) {
169 var parts
= objID
.split("~");
170 dlgopen('add_edit_event.php?date='+ parts
[1] +'&eid=' + parts
[0], '_blank', 550, 270);
173 // show the 'searching...' status and submit the form
174 var SubmitForm = function(eObj
) {
175 $("submit").css("disabled", "true");
176 $("#calsearch_status").css("visibility", "visible");
177 return top
.restoreSession();
180 function goPid(pid
) {
181 top
.restoreSession();
183 if ($GLOBALS
['concurrent_layout'])
185 // larry :: dbc insert
186 if( $GLOBALS
['dutchpc'] )
188 echo
"top.RTop.location = '../../patient_file/summary/demographics_dutch.php' " .
189 "+ '?set_pid=' + pid;\n";
192 echo
"top.RTop.location = '../../patient_file/summary/demographics.php' " .
193 "+ '?set_pid=' + pid;\n";
195 // larry :: end of dbc insert
197 echo
"top.location = '../../patient_file/patient_file.php' " .
198 "+ '?set_pid=' + pid + '&pid=' + pid;\n";
204 [-*include
file=
"$TPL_NAME/views/footer.html"*-]