stat.html.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php
  2. /**
  3. * The stat view file of attend 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 attend
  9. * @version $Id$
  10. * @link http://www.ranzhi.org
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <style>
  15. #menuActions{float:right !important; margin-top: -60px !important;}
  16. .input-group-required > .required::after, .required-wrapper.required::after {top:12px !important;}
  17. .modal-body .table {margin-bottom:0px !important;}
  18. </style>
  19. <div id='featurebar'>
  20. <ul class='nav'>
  21. <?php
  22. $methodName = strtolower($this->app->getMethodName());
  23. foreach($lang->attend->featurebar as $key => $menu)
  24. {
  25. if(is_string($menu)) $link = $menu;
  26. if(is_array($menu)) $link = $menu['link'];
  27. list($name, $currentModule, $currentMethod, $params) = explode('|', $link);
  28. $class = strtolower($key) == $methodName ? "class='active'" : '';
  29. if(isset($menu['alias'])) $class = strpos(strtolower($menu['alias']), strtolower($key)) !== false ? "class='active'" : $class;
  30. if(common::hasPriv($currentModule, $currentMethod)) echo "<li id='$key' $class>" . html::a($this->createLink($currentModule, $currentMethod, $params), $name) . '</li>';
  31. }
  32. ?>
  33. </ul>
  34. </div>
  35. <?php js::set('mode', $mode);?>
  36. <div id='menuActions'>
  37. <?php extCommonModel::printLink('attend', 'exportstat', "data=$currentYear$currentMonth", "{$lang->attend->export}", "class='iframe btn btn-primary'")?>
  38. </div>
  39. <div class='with-side'>
  40. <div class='side'>
  41. <div class='panel panel-sm'>
  42. <div class='panel-body'>
  43. <ul class='tree' data-ride='tree' data-collapsed='true'>
  44. <?php foreach($yearList as $year):?>
  45. <li class='<?php echo $year == $currentYear ? 'active' : ''?>'>
  46. <?php extCommonModel::printLink('attend', 'stat', "currentDate=$year", $year);?>
  47. <ul>
  48. <?php foreach($monthList[$year] as $m):?>
  49. <li class='<?php echo ($year == $currentYear and $m == $currentMonth) ? 'active' : ''?>'>
  50. <?php extCommonModel::printLink('attend', 'stat', "currentDate=$year$m", $year . $m);?>
  51. </li>
  52. <?php endforeach;?>
  53. </ul>
  54. </li>
  55. <?php endforeach;?>
  56. </ul>
  57. </div>
  58. </div>
  59. </div>
  60. <div class='main'>
  61. <?php if($waitReviews):?>
  62. <table class='table table-borderless'>
  63. <?php foreach($waitReviews as $module):?>
  64. <?php $reviewedBy = $module == 'attend' ? zget($config->attend, 'reviewedBy', '') : $this->loadModel($module, '')->getReviewedBy();?>
  65. <tr>
  66. <td>
  67. <?php printf($lang->attend->waitReviews, $lang->$module->common);?>
  68. <?php if(($this->app->user->admin == 'super') or ($reviewedBy == $this->app->user->account && commonModel::hasPriv($module, 'browseReview'))) echo baseHTML::a(helper::createLink($module, 'browseReview'), $lang->leave->review, "class='btn btn-primary'");?>
  69. </td>
  70. </tr>
  71. <?php endforeach;?>
  72. </table>
  73. <?php else:?>
  74. <div class='panel'>
  75. <div class='panel-heading text-center'>
  76. <?php $title = $currentYear;?>
  77. <?php if($this->app->clientLang != 'en') $title .= $lang->year;?>
  78. <?php if($currentMonth):?>
  79. <?php $title .= $currentMonth;?>
  80. <?php if($this->app->clientLang != 'en') $title .= $lang->month;?>
  81. <?php endif;?>
  82. <strong><?php echo $title . $lang->attend->report;?></strong>
  83. </div>
  84. <form id='ajaxForm' method='post' action='<?php echo $this->createLink('attend', 'saveStat', "month=$month")?>'>
  85. <table class='table table-data table-condensed table-striped table-hover table-bordered text-center' id='attendStat'>
  86. <thead>
  87. <tr class='text-center'>
  88. <th class='text-middle'><?php echo $lang->user->realname;?></th>
  89. <th class='w-70px'><?php echo $lang->attend->statusList['normal']?></th>
  90. <th class='w-60px'><?php echo $lang->attend->statusList['late'];?></th>
  91. <th class='w-60px'><?php echo $lang->attend->statusList['early'];?></th>
  92. <th class='w-60px'><?php echo $lang->attend->statusList['absent'];?></th>
  93. <th class='w-60px'><?php echo $lang->attend->statusList['trip'];?></th>
  94. <th class='w-60px'><?php echo $lang->attend->statusList['egress'];?></th>
  95. <th class='w-60px'><?php echo $lang->leave->paid;?></th>
  96. <th class='w-70px'><?php echo $lang->leave->unpaid;?></th>
  97. <th class='w-80px'><?php echo $lang->overtime->typeList['time'];?></th>
  98. <th class='w-80px'><?php echo $lang->overtime->typeList['rest'];?></th>
  99. <th class='w-80px'><?php echo $lang->overtime->typeList['holiday'];?></th>
  100. <th class='w-70px'><?php echo $lang->attend->statusList['lieu'];?></th>
  101. <th class='w-90px'><?php echo $lang->attend->deserveDays;?></th>
  102. <th class='w-100px'><?php echo $lang->attend->actualDays;?></th>
  103. <?php if($mode == 'view' && $currentMonth):?>
  104. <th><?php echo $lang->actions;?></th>
  105. <?php endif;?>
  106. </tr>
  107. </thead>
  108. <?php foreach($stat as $account => $accountStat):?>
  109. <?php if(!isset($users[$account])) continue;?>
  110. <tr class='view'>
  111. <td class='text-middle'><?php echo $users[$account];?></td>
  112. <td><?php echo $accountStat->normal;?></td>
  113. <td><?php echo $accountStat->late;?></td>
  114. <td><?php echo $accountStat->early;?></td>
  115. <td><?php echo $accountStat->absent;?></td>
  116. <td><?php echo $accountStat->trip;?></td>
  117. <td><?php echo $accountStat->egress;?></td>
  118. <td><?php echo $accountStat->paidLeave;?></td>
  119. <td><?php echo $accountStat->unpaidLeave;?></td>
  120. <td><?php echo $accountStat->timeOvertime;?></td>
  121. <td><?php echo $accountStat->restOvertime;?></td>
  122. <td><?php echo $accountStat->holidayOvertime;?></td>
  123. <td><?php echo $accountStat->lieu;?></td>
  124. <td><?php echo $accountStat->deserve;?></td>
  125. <td><?php echo $accountStat->actual;?></td>
  126. <?php if($currentMonth):?>
  127. <td><?php echo baseHTML::a('javascript:;', $lang->edit, "class='singleEdit'")?></td>
  128. <?php endif;?>
  129. </tr>
  130. <tr class='edit hide'>
  131. <td class='text-middle'><?php echo $users[$account];?></td>
  132. <td><?php echo html::input("normal[$account]", $accountStat->normal, "class='form-control'");?></td>
  133. <td><?php echo html::input("late[$account]", $accountStat->late, "class='form-control'");?></td>
  134. <td><?php echo html::input("early[$account]", $accountStat->early, "class='form-control'");?></td>
  135. <td><?php echo html::input("absent[$account]", $accountStat->absent, "class='form-control'");?></td>
  136. <td><?php echo html::input("trip[$account]", $accountStat->trip, "class='form-control'");?></td>
  137. <td><?php echo html::input("egress[$account]", $accountStat->egress, "class='form-control'");?></td>
  138. <td><?php echo html::input("paidLeave[$account]", $accountStat->paidLeave, "class='form-control'");?></td>
  139. <td><?php echo html::input("unpaidLeave[$account]", $accountStat->unpaidLeave, "class='form-control'");?></td>
  140. <td><?php echo html::input("timeOvertime[$account]", $accountStat->timeOvertime, "class='form-control'");?></td>
  141. <td><?php echo html::input("restOvertime[$account]", $accountStat->restOvertime, "class='form-control'");?></td>
  142. <td><?php echo html::input("holidayOvertime[$account]", $accountStat->holidayOvertime, "class='form-control'");?></td>
  143. <td><?php echo html::input("lieu[$account]", $accountStat->lieu, "class='form-control'");?></td>
  144. <td><?php echo html::input("deserve[$account]", $accountStat->deserve, "class='form-control'");?></td>
  145. <td><?php echo html::input("actual[$account]", $accountStat->actual, "class='form-control'");?></td>
  146. <td class='singleSave hide'><?php echo baseHTML::submitButton();?></td>
  147. </tr>
  148. <?php endforeach;?>
  149. </table>
  150. <?php if($currentMonth):?>
  151. <div class='page-actions'>
  152. <?php echo baseHTML::a($this->createLink('attend', 'stat', "month=$month&mode=edit"), $lang->edit, "class='btn'");?>
  153. <?php if($mode == 'edit') echo baseHTML::submitButton();?>
  154. </div>
  155. <?php endif;?>
  156. </form>
  157. </div>
  158. <?php endif;?>
  159. </div>
  160. </div>
  161. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>