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