corrected smarty tag
[openemr.git] / interface / main / calendar / modules / PostCalendar / pntemplates / default / user / ajax_search.html
blobd14708dd07e1609c6e7c8339d82e3dfb46a00d8d
1 [-*Smarty*-]
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>
24 </select>
25 [-#_PC_SEARCH_IN#-]:
26 <select name="pc_category">
27 <option value="">[-#_PC_SEARCH_ANY_CATEGORY#-]</option>
28 [-$CATEGORY_OPTIONS-]
29 </select>
30 [-if $USE_TOPICS-]
31 <select name="pc_topic">
32 <option value="">[-#_PC_SEARCH_ANY_TOPIC#-]</option>
33 [-$TOPIC_OPTIONS-]
34 </select>
35 [-/if-]
36 <br>
37 between
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-]'>
40 and
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-]'>
43 <br>
44 for
45 <select name="provider_id" id="provider_id">
46 [-$PROVIDER_OPTIONS-]
47 </select>
49 <select name="pc_facility" id="pc_facility">
50 [-$FACILITY_OPTIONS-]
51 </select>
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>
54 </form>
55 </div>
56 <!-- end of search parameters -->
58 [-if $SEARCH_PERFORMED-]
59 <div id="calsearch_results">
61 <div id="calsearch_results_header">
62 <table>
63 <tr>
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>
68 </tr>
69 </table>
70 </div>
72 <div id="calsearch_results_data">
73 <table>
74 [-php-]
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
80 $eventCount = 0;
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."'>";
94 // date and time
95 $eDatetime = strtotime($eDate." ".$event['startTime']);
96 echo "<td class='calsearch_datetime'>";
97 echo date("Y-m-d h:i a", $eDatetime);
98 echo "</td>";
100 // provider
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."\" />";
105 echo "</td>";
107 // category
108 echo "<td class='calsearch_category'>";
109 echo $event['catname'];
110 echo " </td>";
112 // patient
113 echo "<td class='calsearch_patient'>";
114 echo $event['patient_name'];
115 echo "</td>";
117 echo "<td>";
118 print_r($event);
119 echo "</td>";
121 echo "</tr>\n";
123 $eventCount++;
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>";
136 [-/php-]
137 </table>
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"});
152 </script>
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) {
168 objID = eObj.id;
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();
182 [-php-]
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";
190 } else
192 echo "top.RTop.location = '../../patient_file/summary/demographics.php' " .
193 "+ '?set_pid=' + pid;\n";
195 // larry :: end of dbc insert
196 } else {
197 echo "top.location = '../../patient_file/patient_file.php' " .
198 "+ '?set_pid=' + pid + '&pid=' + pid;\n";
200 [-/php-]
202 </script>
204 [-*include file="$TPL_NAME/views/footer.html"*-]