browse.html.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. /**
  3. * The browse 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 chujilu <chujilu@cnezsoft.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 $lang->attend->abbrStatusList['rest'] = '';?>
  32. <div id='menuActions'>
  33. <?php extCommonModel::printLink('attend', 'export', "date=$currentYear$currentMonth&company=$company", "{$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', $company ? 'company' : 'department', "date=$year", $year);?>
  43. <ul>
  44. <?php foreach($monthList[$year] as $month):?>
  45. <li class='<?php echo ($year == $currentYear and $month == $currentMonth) ? 'active' : ''?>'>
  46. <?php extCommonModel::printLink('attend', $company ? 'company' : 'department', "date=$year$month", $year . $month);?>
  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. <div class='panel-heading text-center'>
  58. <?php $title = $currentYear;?>
  59. <?php if($this->app->clientLang != 'en') $title .= $lang->year;?>
  60. <?php $title .= $currentMonth;?>
  61. <?php if($this->app->clientLang != 'en') $title .= $lang->month;?>
  62. <strong><?php echo $title . $lang->attend->report;?></strong>
  63. </div>
  64. <table class='table table-data table-bordered text-center table-fixed'>
  65. <thead>
  66. <tr class='text-center'>
  67. <th rowspan='2' class='w-80px text-middle'><?php echo $lang->user->dept;?></th>
  68. <th rowspan='2' class='w-80px text-middle'><?php echo $lang->user->realname;?></th>
  69. <?php for($day = 1; $day <= $dayNum; $day++):?>
  70. <th><?php echo $day?></th>
  71. <?php endfor;?>
  72. </tr>
  73. <tr class='text-center'>
  74. <?php $weekOffset = date('w', strtotime("$currentYear-$currentMonth-01")) - 1;?>
  75. <?php for($day = 1; $day <= $dayNum; $day++):?>
  76. <th><?php echo $lang->datepicker->abbrDayNames[($day + $weekOffset) % 7]?></th>
  77. <?php endfor;?>
  78. </tr>
  79. </thead>
  80. <?php foreach($attends as $dept => $deptAttends):?>
  81. <?php $isFirst = true;?>
  82. <?php foreach($deptAttends as $account => $userAttends):?>
  83. <tr>
  84. <?php if($isFirst):?>
  85. <td rowspan='<?php echo count($deptAttends);?>' class='text-middle'>
  86. <?php echo isset($users[$account]->dept) ? $deptList[$users[$account]->dept] : ''?>
  87. </td>
  88. <?php $isFirst = false;?>
  89. <?php endif;?>
  90. <td class='text-middle'><?php echo isset($users[$account]->realname) ? $users[$account]->realname : '';?></td>
  91. <?php for($day = 1; $day <= $dayNum; $day++):?>
  92. <?php $currentDate = date("Y-m-d", strtotime("{$currentYear}-{$currentMonth}-{$day}"));?>
  93. <?php if(isset($userAttends[$currentDate])):?>
  94. <?php
  95. $attend = $userAttends[$currentDate];
  96. $status = $attend->status;
  97. if($attend->hoursList)
  98. {
  99. $title = '';
  100. $icon = '';
  101. foreach($attend->hoursList as $status => $hours)
  102. {
  103. $title .= $lang->attend->statusList[$status] . $hours . 'h ';
  104. $icon .= $lang->attend->markStatusList[$status];
  105. }
  106. }
  107. else
  108. {
  109. $title = $lang->attend->statusList[$attend->status];
  110. $icon = $lang->attend->markStatusList[$attend->status];
  111. }
  112. ?>
  113. <td class='attend-status attend-<?php echo $status;?>' title='<?php echo $title;?>'>
  114. <span><?php echo $icon;?></span>
  115. </td>
  116. <?php else:?>
  117. <td></td>
  118. <?php endif;?>
  119. <?php endfor;?>
  120. </tr>
  121. <?php endforeach;?>
  122. <?php endforeach;?>
  123. </table>
  124. <div class='legend'>
  125. <?php foreach($lang->attend->markStatusList as $key => $value):?>
  126. <span class='legend-item attend-<?php echo $key?>'>
  127. <i class='legend-i'><?php echo $value?></i>
  128. <?php echo $lang->attend->statusList[$key]?>
  129. </span>
  130. <?php endforeach;?>
  131. </div>
  132. </div>
  133. </div>
  134. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>