edit.html.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. /**
  3. * The edit 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', 'edit', "id=$makeup->id")?>">
  20. <table class='table table-form table-condensed'>
  21. <tr>
  22. <th class='w-70px'><?php echo $lang->makeup->status;?></th>
  23. <td class='text-warning'><?php echo $lang->makeup->statusList[$makeup->status];?></td>
  24. <td></td>
  25. </tr>
  26. <tr>
  27. <th><?php echo $lang->makeup->begin?></th>
  28. <td>
  29. <div class='input-group'>
  30. <span class='input-group-addon'><?php echo $lang->makeup->date?></span>
  31. <?php echo html::input('begin', $makeup->begin, "class='form-control form-date date-picker-down'")?>
  32. <span class='input-group-addon fix-border'><?php echo $lang->makeup->time?></span>
  33. <?php echo html::input('start', $makeup->start, "class='form-control form-time date-picker-down'")?>
  34. </div>
  35. </td>
  36. <td></td>
  37. </tr>
  38. <tr>
  39. <th><?php echo $lang->makeup->end?></th>
  40. <td>
  41. <div class='input-group'>
  42. <span class='input-group-addon'><?php echo $lang->makeup->date?></span>
  43. <?php echo html::input('end', $makeup->end, "class='form-control form-date date-picker-down'")?>
  44. <span class='input-group-addon fix-border'><?php echo $lang->makeup->time?></span>
  45. <?php echo html::input('finish', $makeup->finish, "class='form-control form-time date-picker-down'")?>
  46. </div>
  47. </td>
  48. <td></td>
  49. </tr>
  50. <tr>
  51. <th><?php echo $lang->makeup->hours?></th>
  52. <td>
  53. <div class='input-group'>
  54. <?php echo html::input('hours', $makeup->hours, "class='form-control'")?>
  55. <span class='input-group-addon'><?php echo $lang->makeup->hoursTip?></span>
  56. </div>
  57. </td>
  58. <td></td>
  59. </tr>
  60. <tr>
  61. <th><?php echo $lang->makeup->leave;?></th>
  62. <td><?php echo html::select('leave[]', $leaves, $makeup->leave, "class='form-control chosen' multiple")?></td>
  63. <td></td>
  64. </tr>
  65. <tr>
  66. <th><?php echo $lang->makeup->desc?></th>
  67. <td><?php echo html::textarea('desc', $makeup->desc, "class='form-control'")?></td>
  68. <td></td>
  69. </tr>
  70. <tr>
  71. <th></th>
  72. <td><?php echo baseHTML::submitButton();?></td>
  73. <td></td>
  74. </tr>
  75. </table>
  76. </form>
  77. <script>
  78. $(document).ready(function()
  79. {
  80. $('#begin, #start, #end, #finish').change(function()
  81. {
  82. var begin = $('#begin').val();
  83. var end = $('#end').val();
  84. var start = $('#start').val();
  85. var finish = $('#finish').val();
  86. if(!begin || !end || !start || !finish) return false;
  87. begin = begin.replace(/-/g, '/');
  88. end = end.replace(/-/g, '/');
  89. var beginTime = Date.parse(new Date(begin + ' ' + start));
  90. var endTime = Date.parse(new Date(end + ' ' + finish));
  91. if(beginTime > endTime) return false;
  92. var hours = Math.round((endTime - beginTime)/(3600*1000)*100)/100;
  93. $('#hours').val(hours);
  94. });
  95. })
  96. </script>
  97. <?php include '../../common/view/footer.modal.html.php';?>