edit.html.php 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * The settings view file of attend module of ZenTaoPMS.
  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 chujilu <chujilu@cnezsoft.com>
  8. * @package attend
  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 js::set('status', $attend->status);?>
  16. <?php js::set('reason', $attend->reason);?>
  17. <div class='panel-body'>
  18. <form id='ajaxForm' method='post' action='<?php echo $this->createLink('attend', 'edit', "date=$date")?>'>
  19. <table class='table table-form table-condensed'>
  20. <?php if(!empty($attend->reviewStatus)):?>
  21. <tr>
  22. <th><?php echo $lang->attend->reviewStatus?></th>
  23. <td><?php echo zget($lang->attend->reviewStatusList, $attend->reviewStatus) . " " . $attend->reviewedBy . " " . formatTime($attend->reviewedDate, DT_DATETIME2);?></td>
  24. </tr>
  25. <?php endif;?>
  26. <tr>
  27. <th class='w-80px'><?php echo $lang->attend->date?></th>
  28. <td><?php echo $attend->dayName;?></td>
  29. </tr>
  30. </table>
  31. <table class='table table-form table-condensed editMode'>
  32. <?php if(strpos(',late,both,absent,leave,makeup,overtime,lieu,trip,egress,', ",$attend->status,") !== false):?>
  33. <tr id='trIn'>
  34. <th><?php echo $lang->attend->manualIn?></th>
  35. <td><?php echo html::input('manualIn', empty($attend->manualIn) ? $this->config->attend->signInLimit : $attend->manualIn, "class='form-control form-time'")?></td>
  36. </tr>
  37. <?php endif;?>
  38. <?php if(strpos(',early,both,absent,', ",$attend->status,") !== false or (strpos(',leave,makeup,overtime,lieu,trip,egress', ",$attend->status,") !== false && date('Y-m-d') > "$attend->date {$config->attend->signOutLimit}")):?>
  39. <tr id='trOut'>
  40. <th><?php echo $lang->attend->manualOut?></th>
  41. <td><?php echo html::input('manualOut', empty($attend->manualOut) ? $this->config->attend->signOutLimit : $attend->manualOut, "class='form-control form-time'")?></td>
  42. </tr>
  43. <?php endif;?>
  44. <tr>
  45. <th class='w-80px'><?php echo $lang->attend->desc?></th>
  46. <td><?php echo html::textarea('desc', $attend->desc, "class='form-control'")?></td>
  47. </tr>
  48. <tr><th></th><td><?php echo baseHTML::submitButton();?></td></tr>
  49. </table>
  50. <table class='table table-form table-condensed viewMode'>
  51. <?php if(strpos(',late,both,absent', $attend->status) !== false):?>
  52. <tr id='trIn'>
  53. <th><?php echo $lang->attend->manualIn?></th>
  54. <td><?php echo formatTime($attend->manualIn, DT_TIME2);?></td>
  55. </tr>
  56. <?php endif;?>
  57. <?php if(strpos(',early,both,absent', $attend->status) !== false):?>
  58. <tr id='trOut'>
  59. <th><?php echo $lang->attend->manualOut?></th>
  60. <td><?php echo formatTime($attend->manualOut, DT_TIME2);?></td>
  61. </tr>
  62. <?php endif;?>
  63. <tr>
  64. <th class='w-80px'><?php echo $lang->attend->desc?></th>
  65. <td><?php echo $attend->desc;?></td>
  66. </tr>
  67. <?php if($attend->reviewStatus != 'pass' or strpos('late,early,both', $attend->status) !== false):?>
  68. <tr><th></th><td clospan='3'><?php echo baseHTML::commonButton($lang->edit, "btn btn-primary edit");?></td></tr>
  69. <?php endif;?>
  70. </table>
  71. </form>
  72. </div>
  73. <script>
  74. $(document).ready(function()
  75. {
  76. var allStatus = ',leave,makeup,overtime,lieu,trip,egress,';
  77. if(status == 'normal' || (reason && allStatus.indexOf(',' + status + ',') == -1 ))
  78. {
  79. $('.editMode').hide();
  80. $('.viewMode').show();
  81. }
  82. else
  83. {
  84. $('.editMode').show();
  85. $('.viewMode').hide();
  86. }
  87. $('.edit').click(function()
  88. {
  89. $('.editMode').show();
  90. $('.viewMode').hide();
  91. })
  92. })
  93. </script>
  94. <?php include '../../common/view/footer.modal.html.php';?>