browse.html.php 5.9 KB

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