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['assets_static_relative'] [-/php-]/jquery-min-1-2-2/index.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 echo
"<a href='".$GLOBALS['webroot'].
"/interface/main/main_info.php' class='menu' onclick='top.restoreSession()'>";
23 [-php-] xl('Return to calendar','e'); [-/php-]
</a>
24 <div id=
"calsearch_params">
25 <form name=
"theform" id=
"theform" action=
"[-$FORM_ACTION-]" method=
"POST"> <!-- onsubmit="return top.restoreSession()"> -->
26 [-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-]" />
27 <select name=
"pc_keywords_andor">
28 <option value=
"AND">[-php-] xl('AND','e'); [-/php-]
</option>
29 <option value=
"OR">[-php-] xl('OR','e'); [-/php-]
</option>
31 [-php-] xl('IN','e'); [-/php-]:
32 <select name=
"pc_category">
33 <option value=
"">[-php-] xl('Any Category','e'); [-/php-]
</option>
37 <select name=
"pc_topic">
38 <option value=
"">[-#_PC_SEARCH_ANY_TOPIC#-]
</option>
43 [-php-] xl('between','e'); [-/php-]
44 <input type=
"text" name=
"start" id=
"start" value=
"[-$DATE_START-]" size=
"10"/>
45 <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-]'
>
46 [-php-] xl('and','e'); [-/php-]
47 <input type=
"text" name=
"end" id=
"end" value=
"[-$DATE_END-]" size=
"10"/>
48 <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-]'
>
50 [-php-] xl('for','e'); [-/php-]
51 <select name=
"provider_id" id=
"provider_id">
54 [-php-] xl('at','e'); [-/php-]
55 <select name=
"pc_facility" id=
"pc_facility">
58 <input type=
"submit" name=
"submit" id=
"submit" value=
"[-php-] xl('Submit','e'); [-/php-]" />
59 <div id=
"calsearch_status"><img src='[-php-] echo $GLOBALS['webroot'] [-/php-]/interface/pic/ajax-loader.gif'
> [-php-] xl('Searching...','e'); [-/php-]
</div>
62 <!-- end of search parameters -->
64 [-if $SEARCH_PERFORMED-]
65 <div id=
"calsearch_results">
67 <div id=
"calsearch_results_header">
70 <th class=
"calsearch_datetime">[-php-] echo xl('Date') .
"-" . xl('Time'); [-/php-]
</th>
71 <th class=
"calsearch_provider">[-php-] xl('Provider','e'); [-/php-]
</th>
72 <th class=
"calsearch_category">[-php-] xl('Category','e'); [-/php-]
</th>
73 <th class=
"calsearch_patient">[-php-] xl('Patient','e'); [-/php-]
</th>
78 <div id=
"calsearch_results_data">
81 /* I've given up on playing nice with the Smarty tag crap, it's pointlessly used
82 * in the original search. I mean, there's no clean separation between the code
83 * and HTML so we may as well just go full-bore PHP here -- JRM March
2008
87 foreach ($this-
>get_template_vars('A_EVENTS') as $eDate =
> $date_events) {
88 $eventdate = substr($eDate,
0,
4) . substr($eDate,
5,
2) . substr($eDate,
8,
2);
90 foreach ($date_events as $event) {
91 // pick up some demographic info about the provider
92 $provquery =
"SELECT * FROM users WHERE id='".$event['aid'].
"'";
93 $res = sqlStatement($provquery);
94 $provinfo = sqlFetchArray($res);
96 $eData = $event['eid'].
"~".$eventdate;
97 $trTitle = xl('Click to edit this event');
98 echo
"<tr class='calsearch_event' id='".$eData.
"' title='".$trTitle.
"'>";
101 $eDatetime = strtotime($eDate.
" ".$event['startTime']);
102 echo
"<td class='calsearch_datetime'>";
103 echo date(
"Y-m-d h:i a", $eDatetime);
107 echo
"<td class='calsearch_provider'>".$event['provider_name'];
108 $imgtitle = $provinfo['fname'] .
" " . xl('contact info') .
":\n";
109 $imgtitle .= $provinfo['phonew1'].
"\n".$provinfo['street'].
"\n".$provinfo['city'].
" ".$provinfo['state'];
110 echo
" <img class'provinfo' src='".$GLOBALS['webroot'].
"/images/info.png' title=\"".$imgtitle."\
" />";
114 echo
"<td class='calsearch_category'>";
115 echo $event['catname'];
119 echo
"<td class='calsearch_patient'>";
120 echo $event['patient_name'];
134 /* the A_EVENTS array holds an array of dates, which in turn hold the array of events
135 * so it will always be non-zero, so we need to count the events as they are
136 * displayed and if the count is zero, then we have no search results
138 if ($eventCount ==
0) {
139 echo
"<tr><td colspan='4' style='text-align: center'>" . xl('No Results') .
"</td></tr>";
144 </div> <!-- end results-data DIV -->
146 </div> <!-- end outer results DIV -->
148 [-/if-] [-*end of SEARCH_PERFORMED*-]
150 <!-- stuff for the popup calendar -->
151 <style type=
"text/css">@import url
([-php-
] echo $GLOBALS
['webroot'] [-/php-
]/library
/dynarch_calendar
.css
);</style>
152 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar.js"></script>
153 [-php-] include_once(
"{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); [-/php-]
154 <script type=
"text/javascript" src=
"[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar_setup.js"></script>
155 <script language=
"Javascript">
156 Calendar
.setup({inputField
:"start", ifFormat
:"%m/%d/%Y", button
:"img_from_date"});
157 Calendar
.setup({inputField
:"end", ifFormat
:"%m/%d/%Y", button
:"img_to_date"});
160 <script language=
"javascript">
161 // jQuery stuff to make the page a little easier to use
163 $(document
).ready(function(){
164 $("#pc_keywords").focus();
165 $("#theform").submit(function() { SubmitForm(this); });
166 $(".calsearch_event").mouseover(function() { $(this).toggleClass("highlight"); });
167 $(".calsearch_event").mouseout(function() { $(this).toggleClass("highlight"); });
168 $(".calsearch_event").click(function() { EditEvent(this); });
171 // open a pop up to edit the event
172 // parts[] ==> 0=eventID
173 var EditEvent = function (eObj
) {
175 var parts
= objID
.split("~");
176 dlgopen('add_edit_event.php?date='+ parts
[1] +'&eid=' + parts
[0], '_blank', 775, 375);
179 // show the 'searching...' status and submit the form
180 var SubmitForm = function(eObj
) {
181 $("submit").css("disabled", "true");
182 $("#calsearch_status").css("visibility", "visible");
183 return top
.restoreSession();
186 function goPid(pid
) {
187 top
.restoreSession();
189 echo
"top.RTop.location = '../../patient_file/summary/demographics.php' " .
190 "+ '?set_pid=' + pid;\n";
195 [-*include
file=
"$TPL_NAME/views/footer.html"*-]