Advertisement
Guest User

Untitled

a guest
Dec 9th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. <%@ include file="/WEB-INF/template/include.jsp" %>
  2. <%@ include file="/WEB-INF/template/header.jsp" %>
  3. <%@ include file="localHeader.jsp" %>
  4. <openmrs:htmlInclude file="/scripts/calendar/calendar.js" />
  5. <openmrs:htmlInclude file="/scripts/jquery/jsTree/jquery.tree.min.js" />
  6. <openmrs:htmlInclude file="/scripts/jquery/jsTree/themes/classic/style.css" />
  7. <openmrs:htmlInclude file="/scripts/jquery/dataTables/css/dataTables.css" />
  8. <openmrs:htmlInclude file="/scripts/jquery/dataTables/js/jquery.dataTables.min.js" />
  9.  
  10. <script type="text/javascript" src='${pageContext.request.contextPath}/dwr/engine.js'></script>
  11. <script type="text/javascript" src='${pageContext.request.contextPath}/dwr/util.js'></script>
  12. <script type="text/javascript" src='${pageContext.request.contextPath}/dwr/interface/DWRAppointmentService.js'></script>
  13. <script type="text/javascript">
  14. function updateAppointmentBlockTable()
  15. {
  16. var selectedDate = document.getElementById('dateFilter').value;
  17. var fromDate = null;
  18. var toDate = null;
  19. var locationId = 2;
  20. if(selectedDate != "")
  21. {
  22. fromDate = new Date(selectedDate);
  23. toDate = new Date(fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate()+1);
  24. }
  25.  
  26. DWRAppointmentService.getAppointmentBlocks(fromDate,toDate,locationId,function(appointmentBlocks){
  27. for(var i=0;i<appointmentBlocks.length;i++)
  28. {
  29. tableContent = "<tr>";
  30. tableContent += '<td align="center">'+'<input type="radio" name="appointmentBlockCheckBox" value=${appointmentBlock.appointmentBlockId }>'+"</td>";
  31. tableContent += '<td align="center">'+appointmentBlocks[i].location+"</td>";
  32. tableContent += '<td align="center">'+appointmentBlocks[i].user+"</td>";
  33. tableContent += '<td align="center">'+appointmentBlocks[i].appointmentTypes+"</td>";
  34. tableContent += '<td align="center">'+appointmentBlocks[i].startTime+"</td>";
  35. tableContent += '<td align="center">'+appointmentBlocks[i].endTime+"</td>";
  36. tableContent += "</tr>";
  37. document.getElementById('appointmentBlocksTable').innerHTML +=tableContent;
  38. }
  39. });
  40. }
  41.  
  42. //Showing the jQuery data table when the page loaded.
  43. $j(document).ready(function() {
  44. updateAppointmentBlockTable();
  45. });
  46.  
  47. </script>
  48. <h2><spring:message code="appointment.AppointmentBlock.manage.title"/></h2>
  49. <br/><br/>
  50.  
  51. <fieldset style="clear: both">
  52. <legend><spring:message code="appointment.AppointmentBlock.legend.properties"/></legend>
  53. <div style="margin: 0.5em 0;">
  54. <table>
  55. <tr>
  56. <td><spring:message code="appointment.AppointmentBlock.pickDate"/>: </td>
  57. <td><input type="text" name="appointmentBlockDateFilter" id="dateFilter" size="11" onfocus="showCalendar(this,60)"></td>
  58. </tr>
  59. <tr>
  60. <td><spring:message code="appointment.AppointmentBlock.column.location"/>: </td>
  61. <td><openmrs:fieldGen type="org.openmrs.Location" formFieldName="locationId" val="${selectedLocation}" /></td>
  62. </tr>
  63. </table>
  64. </div>
  65. </fieldset>
  66.  
  67. <br/>
  68. <b class="boxHeader"><spring:message code="appointment.AppointmentBlock.list.title"/></b>
  69. <form method="post" class="box">
  70. <table id="appointmentBlocksTable">
  71. <tr>
  72. <th align="center"> <spring:message code="appointment.AppointmentBlock.column.select"/></th>
  73. <th align="center"> <spring:message code="appointment.AppointmentBlock.column.location"/> </th>
  74. <th align="center"> <spring:message code="appointment.AppointmentBlock.column.user"/> </th>
  75. <th align="center"> <spring:message code="appointment.AppointmentBlock.column.appointmentTypes"/> </th>
  76. <th align="center"> <spring:message code="appointment.AppointmentBlock.column.startTime"/> </th>
  77. <th align="center"> <spring:message code="appointment.AppointmentBlock.column.endTime"/> </th>
  78. </tr>
  79.  
  80. </table>
  81. </form>
  82. <table align="center">
  83. <tr><td><a href="appointmentBlockForm.form"><spring:message code="appointment.AppointmentBlock.add"/></a></td>
  84. <td><a href="appointmentBlockForm.form"><spring:message code="appointment.AppointmentBlock.edit"/></a></td>
  85. <td><a href="appointmentBlockForm.form"><spring:message code="appointment.AppointmentBlock.delete"/></a></td>
  86. </tr>
  87. </table>
  88.  
  89.  
  90.  
  91. <%@ include file="/WEB-INF/template/footer.jsp" %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement