stat.html.php 8.5 KB

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