create.html.php 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /**
  3. * The create view file of makeup module of Ranzhi.
  4. *
  5. * @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
  6. * @license ZPL (http://zpl.pub/page/zplv12.html)
  7. * @author Tingting Dai <daitingting@xirangit.com>
  8. * @package makeup
  9. * @version $Id$
  10. * @link http://www.ranzhi.org
  11. */
  12. ?>
  13. <?php include '../../common/view/header.modal.html.php';?>
  14. <?php include $app->getModuleRoot() . 'common/view/datepicker.html.php';?>
  15. <?php include $app->getModuleRoot() . 'common/view/chosen.html.php';?>
  16. <?php js::set('signIn', $config->attend->signInLimit)?>
  17. <?php js::set('signOut', $config->attend->signOutLimit)?>
  18. <?php js::set('workingHours', $config->attend->workingHours)?>
  19. <form id='ajaxForm' method='post' action="<?php echo $this->createLink('makeup', 'create')?>">
  20. <table class='table table-form table-condensed'>
  21. <tr>
  22. <th class='w-70px'><?php echo $lang->makeup->begin?></th>
  23. <td>
  24. <div class='input-group'>
  25. <span class='input-group-addon'><?php echo $lang->makeup->date?></span>
  26. <?php echo html::input('begin', $date, "class='form-control form-date date-picker-down'")?>
  27. <span class='input-group-addon fix-border'><?php echo $lang->makeup->time?></span>
  28. <?php echo html::input('start', $config->attend->signInLimit, "class='form-control form-time date-picker-down'")?>
  29. </div>
  30. </td>
  31. <td></td>
  32. </tr>
  33. <tr>
  34. <th><?php echo $lang->makeup->end?></th>
  35. <td>
  36. <div class='input-group'>
  37. <span class='input-group-addon'><?php echo $lang->makeup->date?></span>
  38. <?php echo html::input('end', $date, "class='form-control form-date date-picker-down'")?>
  39. <span class='input-group-addon fix-border'><?php echo $lang->makeup->time?></span>
  40. <?php echo html::input('finish', $config->attend->signOutLimit, "class='form-control form-time date-picker-down'")?>
  41. </div>
  42. </td>
  43. <td></td>
  44. </tr>
  45. <tr>
  46. <th><?php echo $lang->makeup->hours?></th>
  47. <td>
  48. <div class='input-group'>
  49. <?php echo html::input('hours', '', "class='form-control'")?>
  50. <span class='input-group-addon'><?php echo $lang->makeup->hoursTip?></span>
  51. </div>
  52. </td>
  53. <td></td>
  54. </tr>
  55. <tr>
  56. <th><?php echo $lang->makeup->leave;?></th>
  57. <td><?php echo html::select('leave[]', $leaves, '', "class='form-control chosen' multiple")?></td>
  58. <td></td>
  59. </tr>
  60. <tr>
  61. <th><?php echo $lang->makeup->desc?></th>
  62. <td><?php echo html::textarea('desc', '', "class='form-control'")?></td>
  63. <td></td>
  64. </tr>
  65. <tr>
  66. <th></th>
  67. <td><?php echo baseHTML::submitButton();?></td>
  68. <td></td>
  69. </tr>
  70. </table>
  71. </form>
  72. <script>
  73. $(document).ready(function()
  74. {
  75. $('#begin, #start, #end, #finish').change(function()
  76. {
  77. var begin = $('#begin').val();
  78. var end = $('#end').val();
  79. var start = $('#start').val();
  80. var finish = $('#finish').val();
  81. if(!begin || !end || !start || !finish) return false;
  82. begin = begin.replace(/-/g, '/');
  83. end = end.replace(/-/g, '/');
  84. var beginTime = Date.parse(new Date(begin + ' ' + start));
  85. var endTime = Date.parse(new Date(end + ' ' + finish));
  86. if(beginTime > endTime) return false;
  87. var hours = Math.round((endTime - beginTime)/(3600*1000)*100)/100;
  88. $('#hours').val(hours);
  89. });
  90. $('#begin').change();
  91. })
  92. </script>
  93. <?php include '../../common/view/footer.modal.html.php';?>