added link back to the calendar
[openemr.git] / interface / main / calendar / modules / PostCalendar / pntemplates / default / user / ajax_search.html
blob7a5efaaca9febfd070490dbf7a6c256366b366f8
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 &nbsp;
19 [-php-]
20 if ($GLOBALS['concurrent_layout'])
21 echo "<a href='".$GLOBALS['webroot']."/interface/main/main_info.php' class='menu' onclick='top.restoreSession()'>";
22 else
23 echo "<a href='".$GLOBALS['webroot']."/interface/main/main.php' target='Main' class='menu' onclick='top.restoreSession()'>";
24 [-/php-]
25 Return to calendar</a>
26 <div id="calsearch_params">
27 <form name="theform" id="theform" action="[-$FORM_ACTION-]" method="POST"> <!-- onsubmit="return top.restoreSession()"> -->
28 [-#_PC_SEARCH_KEYWORDS#-]: <input type="text" name="pc_keywords" id="pc_keywords" value="[-php-]echo $_POST['pc_keywords'];[-/php-]" />
29 <select name="pc_keywords_andor">
30 <option value="AND">[-#_PC_SEARCH_AND#-]</option>
31 <option value="OR">[-#_PC_SEARCH_OR#-]</option>
32 </select>
33 [-#_PC_SEARCH_IN#-]:
34 <select name="pc_category">
35 <option value="">[-#_PC_SEARCH_ANY_CATEGORY#-]</option>
36 [-$CATEGORY_OPTIONS-]
37 </select>
38 [-if $USE_TOPICS-]
39 <select name="pc_topic">
40 <option value="">[-#_PC_SEARCH_ANY_TOPIC#-]</option>
41 [-$TOPIC_OPTIONS-]
42 </select>
43 [-/if-]
44 <br>
45 between
46 <input type="text" name="start" id="start" value="[-$DATE_START-]" size="10"/>
47 <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-]'>
48 and
49 <input type="text" name="end" id="end" value="[-$DATE_END-]" size="10"/>
50 <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-]'>
51 <br>
52 for
53 <select name="provider_id" id="provider_id">
54 [-$PROVIDER_OPTIONS-]
55 </select>
57 <select name="pc_facility" id="pc_facility">
58 [-$FACILITY_OPTIONS-]
59 </select>
60 <input type="submit" name="submit" id="submit" value="[-#_PC_SUBMIT#-]" />
61 <div id="calsearch_status"><img src='[-php-] echo $GLOBALS['webroot'] [-/php-]/interface/pic/ajax-loader.gif'> Searching...</div>
62 </form>
63 </div>
64 <!-- end of search parameters -->
66 [-if $SEARCH_PERFORMED-]
67 <div id="calsearch_results">
69 <div id="calsearch_results_header">
70 <table>
71 <tr>
72 <th class="calsearch_datetime">Date-Time</th>
73 <th class="calsearch_provider">Provider</th>
74 <th class="calsearch_category">Category</th>
75 <th class="calsearch_patient">Patient</th>
76 </tr>
77 </table>
78 </div>
80 <div id="calsearch_results_data">
81 <table>
82 [-php-]
83 /* I've given up on playing nice with the Smarty tag crap, it's pointlessly used
84 * in the original search. I mean, there's no clean separation between the code
85 * and HTML so we may as well just go full-bore PHP here -- JRM March 2008
88 $eventCount = 0;
89 foreach ($A_EVENTS as $eDate => $date_events) {
90 $eventdate = substr($eDate, 0, 4) . substr($eDate, 5, 2) . substr($eDate, 8, 2);
92 foreach ($date_events as $event) {
93 // pick up some demographic info about the provider
94 $provquery = "SELECT * FROM users WHERE id='".$event['aid']."'";
95 $res = sqlStatement($provquery);
96 $provinfo = sqlFetchArray($res);
98 $eData = $event['eid']."~".$eventdate;
99 $trTitle = "Click to edit this event";
100 echo "<tr class='calsearch_event' id='".$eData."' title='".$trTitle."'>";
102 // date and time
103 $eDatetime = strtotime($eDate." ".$event['startTime']);
104 echo "<td class='calsearch_datetime'>";
105 echo date("Y-m-d h:i a", $eDatetime);
106 echo "</td>";
108 // provider
109 echo "<td class='calsearch_provider'>".$event['provider_name'];
110 $imgtitle = $provinfo['fname']."'s contact info:\n";
111 $imgtitle .= $provinfo['phonew1']."\n".$provinfo['street']."\n".$provinfo['city']." ".$provinfo['state'];
112 echo " <img class'provinfo' src='".$GLOBALS['webroot']."/images/info.png' title=\"".$imgtitle."\" />";
113 echo "</td>";
115 // category
116 echo "<td class='calsearch_category'>";
117 echo $event['catname'];
118 echo " </td>";
120 // patient
121 echo "<td class='calsearch_patient'>";
122 echo $event['patient_name'];
123 echo "</td>";
125 echo "<td>";
126 print_r($event);
127 echo "</td>";
129 echo "</tr>\n";
131 $eventCount++;
136 /* the A_EVENTS array holds an array of dates, which in turn hold the array of events
137 * so it will always be non-zero, so we need to count the events as they are
138 * displayed and if the count is zero, then we have no search results
140 if ($eventCount == 0) {
141 echo "<tr><td colspan='4' style='text-align: center'>No Results</td></tr>";
144 [-/php-]
145 </table>
146 </div> <!-- end results-data DIV -->
148 </div> <!-- end outer results DIV -->
150 [-/if-] [-*end of SEARCH_PERFORMED*-]
152 <!-- stuff for the popup calendar -->
153 <style type="text/css">@import url([-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar.css);</style>
154 <script type="text/javascript" src="[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar.js"></script>
155 <script type="text/javascript" src="[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar_en.js"></script>
156 <script type="text/javascript" src="[-php-] echo $GLOBALS['webroot'] [-/php-]/library/dynarch_calendar_setup.js"></script>
157 <script language="Javascript">
158 Calendar.setup({inputField:"start", ifFormat:"%m/%d/%Y", button:"img_from_date"});
159 Calendar.setup({inputField:"end", ifFormat:"%m/%d/%Y", button:"img_to_date"});
160 </script>
162 <script language="javascript">
163 // jQuery stuff to make the page a little easier to use
165 $(document).ready(function(){
166 $("#pc_keywords").focus();
167 $("#theform").submit(function() { SubmitForm(this); });
168 $(".calsearch_event").mouseover(function() { $(this).toggleClass("highlight"); });
169 $(".calsearch_event").mouseout(function() { $(this).toggleClass("highlight"); });
170 $(".calsearch_event").click(function() { EditEvent(this); });
173 // open a pop up to edit the event
174 // parts[] ==> 0=eventID
175 var EditEvent = function (eObj) {
176 objID = eObj.id;
177 var parts = objID.split("~");
178 dlgopen('add_edit_event.php?date='+ parts[1] +'&eid=' + parts[0], '_blank', 550, 270);
181 // show the 'searching...' status and submit the form
182 var SubmitForm = function(eObj) {
183 $("submit").css("disabled", "true");
184 $("#calsearch_status").css("visibility", "visible");
185 return top.restoreSession();
188 function goPid(pid) {
189 top.restoreSession();
190 [-php-]
191 if ($GLOBALS['concurrent_layout'])
193 // larry :: dbc insert
194 if( $GLOBALS['dutchpc'] )
196 echo "top.RTop.location = '../../patient_file/summary/demographics_dutch.php' " .
197 "+ '?set_pid=' + pid;\n";
198 } else
200 echo "top.RTop.location = '../../patient_file/summary/demographics.php' " .
201 "+ '?set_pid=' + pid;\n";
203 // larry :: end of dbc insert
204 } else {
205 echo "top.location = '../../patient_file/patient_file.php' " .
206 "+ '?set_pid=' + pid + '&pid=' + pid;\n";
208 [-/php-]
210 </script>
212 [-*include file="$TPL_NAME/views/footer.html"*-]