Advertisement
Guest User

Untitled

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