review.html.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <?php
  2. /**
  3. * The personal view file of attend module of Ranzhi.
  4. *
  5. * @copyright Copyright 2009-2016 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author chujilu <chujilu@cnezsoft.com>
  8. * @package attend
  9. * @version $Id$
  10. * @link http://www.ranzhico.com
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <div id='featurebar'>
  15. <ul class='nav'>
  16. <?php foreach($lang->my->featureBar['review'] as $reviewType => $reviewName):?>
  17. <?php $class = $type == $reviewType? "class='active'" : ''?>
  18. <?php echo "<li $class>" . html::a(inlink('review', "type=$reviewType&orderBy=$orderBy"), $reviewName, '',"data-app={$app->tab}") . '</li>';?>
  19. <?php endforeach;?>
  20. </ul>
  21. </div>
  22. <?php js::set('type', $type)?>
  23. <?php js::set('confirmReview', $lang->attend->confirmReview);?>
  24. <?php $appendClass = $type == 'all' ? 'table-noFixedHeader' : 'table-fixedHeader'?>
  25. <?php if(($type == 'all' && !empty($attends)) || $type == 'attend'):?>
  26. <?php if($type == 'attend' and empty($attends)):?>
  27. <div class="table-empty-tip">
  28. <p>
  29. <span class="text-muted"><?php echo $lang->noData;?></span>
  30. </p>
  31. </div> <?php else:?>
  32. <div class='panel'>
  33. <table class='table table-hover table-striped table-sorter table-data table-fixed text-center <?php echo $appendClass?>'>
  34. <thead>
  35. <tr class='text-center'>
  36. <?php if($type == 'all'): ?>
  37. <th class='w-80px'><?php echo $lang->my->reviewModule;?></th>
  38. <?php else:?>
  39. <th class='w-80px'><?php echo $lang->attend->id;?></th>
  40. <?php endif;?>
  41. <th class='w-100px'><?php echo $lang->attend->account;?></th>
  42. <th class='w-100px'><?php echo $lang->attend->date;?></th>
  43. <th class='w-80px'><?php echo $lang->attend->manualIn;?></th>
  44. <th class='w-80px'><?php echo $lang->attend->manualOut;?></th>
  45. <th class='w-100px'><?php echo $lang->attend->reason;?></th>
  46. <th><?php echo $lang->attend->desc;?></th>
  47. <th class='w-100px'><?php echo $lang->attend->status;?></th>
  48. <th class='w-100px'><?php echo $lang->actions;?></th>
  49. </tr>
  50. </thead>
  51. <?php foreach($attends as $attend):?>
  52. <tr>
  53. <?php if($type == 'all'): ?>
  54. <td><?php echo $lang->attend->common;?></td>
  55. <?php else:?>
  56. <td><?php echo $attend->id;?></td>
  57. <?php endif;?>
  58. <td><?php echo zget($users, $attend->account);?></td>
  59. <td><?php echo $attend->date?></td>
  60. <td><?php echo substr($attend->manualIn, 0, 5)?></td>
  61. <td><?php echo substr($attend->manualOut, 0, 5)?></td>
  62. <td><?php echo zget($lang->attend->reasonList, $attend->reason)?></td>
  63. <td><?php echo $attend->desc?></td>
  64. <td><?php echo zget($lang->attend->statusList, $attend->status)?></td>
  65. <td>
  66. <?php extCommonModel::printLink('attend', 'review', "attendID={$attend->id}&status=pass", $lang->attend->reviewStatusList['pass'], "data-status='pass' data-toggle='ajax'")?>
  67. <?php extCommonModel::printLink('attend', 'review', "attendID={$attend->id}&status=reject", $lang->attend->reviewStatusList['reject'], "data-toggle='modal'")?>
  68. </td>
  69. </tr>
  70. <?php endforeach;?>
  71. </table>
  72. </div>
  73. <?php endif;?>
  74. <?php endif;?>
  75. <?php if($type == 'leave'):?>
  76. <?php if(empty($leaveList)):?>
  77. <div class="table-empty-tip">
  78. <p>
  79. <span class="text-muted"><?php echo $lang->noData;?></span>
  80. </p>
  81. </div>
  82. <?php else:?>
  83. <div class='panel'>
  84. <table class='table table-data table-hover text-center table-fixed tablesorter <?php echo $appendClass?>' id='leaveTable'>
  85. <thead>
  86. <tr class='text-center'>
  87. <?php $vars = "type={$type}&orderBy=%s";?>
  88. <th class='w-80px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->leave->id);?></th>
  89. <th class='w-80px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->leave->createdBy);?></th>
  90. <th class='w-90px'><?php echo $lang->user->dept;?></th>
  91. <th class='w-80px'><?php commonModel::printOrderLink('type', $orderBy, $vars, $lang->leave->type);?></th>
  92. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->leave->begin);?></th>
  93. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->leave->end);?></th>
  94. <th class='w-140px'><?php commonModel::printOrderLink('backDate', $orderBy, $vars, $lang->leave->backDate);?></th>
  95. <th><?php echo $lang->leave->desc;?></th>
  96. <th class='w-80px'><?php commonModel::printOrderLink('status', $orderBy, $vars, $lang->leave->status);?></th>
  97. <th class='w-100px'><?php echo $lang->actions;?></th>
  98. </tr>
  99. </thead>
  100. <?php foreach($leaveList as $leave):?>
  101. <tr>
  102. <td><?php echo $leave->id;?></td>
  103. <td><?php echo zget($users, $leave->createdBy);?></td>
  104. <td><?php echo zget($deptList, $leave->dept);?></td>
  105. <td><?php echo zget($this->lang->leave->typeList, $leave->type);?></td>
  106. <td><?php echo $leave->begin . ' ' . substr($leave->start, 0, 5);?></td>
  107. <td><?php echo $leave->end . ' ' . substr($leave->finish, 0, 5);?></td>
  108. <td><?php echo formatTime($leave->backDate);?></td>
  109. <td title='<?php echo $leave->desc?>'><?php echo $leave->desc;?></td>
  110. <td class='leave-<?php echo $leave->status?>'><?php echo zget($this->lang->leave->statusList, $leave->status);?></td>
  111. <td>
  112. <?php $mode = $leave->status == 'pass' ? 'back' : '';?>
  113. <?php extCommonModel::printLink('leave', 'review', "id={$leave->id}&status=pass&mode=$mode", $lang->leave->statusList['pass'], "data-status='pass' data-toggle='ajax'");?>
  114. <?php extCommonModel::printLink('leave', 'review', "id={$leave->id}&status=reject&mode=$mode", $lang->leave->statusList['reject'], "data-toggle='modal'");?>
  115. </td>
  116. </tr>
  117. <?php endforeach;?>
  118. </table>
  119. </div>
  120. <?php endif;?>
  121. <?php endif;?>
  122. <?php if($type == 'makeup'):?>
  123. <?php if(empty($makeupList)):?>
  124. <div class="table-empty-tip">
  125. <p>
  126. <span class="text-muted"><?php echo $lang->noData;?></span>
  127. </p>
  128. </div>
  129. <?php else:?>
  130. <div class='panel'>
  131. <table class='table table-data table-hover text-center table-fixed tablesorter <?php echo $appendClass?>' id='makeupTable'>
  132. <thead>
  133. <tr class='text-center'>
  134. <?php $vars = "type={$type}&orderBy=%s";?>
  135. <th class='w-80px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->makeup->id);?></th>
  136. <th class='w-80px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->makeup->createdBy);?></th>
  137. <th class='w-90px'><?php echo $lang->user->dept;?></th>
  138. <th class='w-80px'><?php commonModel::printOrderLink('type', $orderBy, $vars, $lang->makeup->type);?></th>
  139. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->makeup->begin);?></th>
  140. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->makeup->end);?></th>
  141. <th><?php echo $lang->makeup->desc;?></th>
  142. <th class='w-100px'><?php echo $lang->actions;?></th>
  143. </tr>
  144. </thead>
  145. <?php foreach($makeupList as $makeup):?>
  146. <tr>
  147. <td><?php echo $makeup->id;?></td>
  148. <td><?php echo zget($users, $makeup->createdBy);?></td>
  149. <td><?php echo zget($deptList, $makeup->dept);?></td>
  150. <td><?php echo zget($this->lang->makeup->typeList, $makeup->type);?></td>
  151. <td><?php echo $makeup->begin . ' ' . substr($makeup->start, 0, 5);?></td>
  152. <td><?php echo $makeup->end . ' ' . substr($makeup->finish, 0, 5);?></td>
  153. <td title='<?php echo $makeup->desc?>'><?php echo $makeup->desc;?></td>
  154. <td>
  155. <?php extCommonModel::printLink('makeup', 'review', "id={$makeup->id}&status=pass", $lang->makeup->statusList['pass'], "data-status='pass' data-toggle='ajax'");?>
  156. <?php extCommonModel::printLink('makeup', 'review', "id={$makeup->id}&status=reject", $lang->makeup->statusList['reject'], "data-toggle='modal'");?>
  157. </td>
  158. </tr>
  159. <?php endforeach;?>
  160. </table>
  161. </div>
  162. <?php endif;?>
  163. <?php endif;?>
  164. <?php if($type == 'overtime'):?>
  165. <?php if(empty($overtimeList)):?>
  166. <div class="table-empty-tip">
  167. <p>
  168. <span class="text-muted"><?php echo $lang->noData;?></span>
  169. </p>
  170. </div>
  171. <?php else:?>
  172. <div class='panel'>
  173. <table class='table table-data table-hover text-center table-fixed tablesorter <?php echo $appendClass?>' id='overtimeTable'>
  174. <thead>
  175. <tr class='text-center'>
  176. <?php $vars = "type={$type}&orderBy=%s";?>
  177. <th class='w-80px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->overtime->id);?></th>
  178. <th class='w-80px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->overtime->createdBy);?></th>
  179. <th class='w-90px'><?php echo $lang->user->dept;?></th>
  180. <th class='w-80px'><?php commonModel::printOrderLink('type', $orderBy, $vars, $lang->overtime->type);?></th>
  181. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->overtime->begin);?></th>
  182. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->overtime->end);?></th>
  183. <th><?php echo $lang->overtime->desc;?></th>
  184. <th class='w-80px'><?php commonModel::printOrderLink('status', $orderBy, $vars, $lang->overtime->status);?></th>
  185. <th class='w-100px'><?php echo $lang->actions;?></th>
  186. </tr>
  187. </thead>
  188. <?php foreach($overtimeList as $overtime):?>
  189. <tr>
  190. <td><?php echo $overtime->id;?></td>
  191. <td><?php echo zget($users, $overtime->createdBy);?></td>
  192. <td><?php echo zget($deptList, $overtime->dept);?></td>
  193. <td><?php echo zget($this->lang->overtime->typeList, $overtime->type);?></td>
  194. <td><?php echo $overtime->begin . ' ' . substr($overtime->start, 0, 5);?></td>
  195. <td><?php echo $overtime->end . ' ' . substr($overtime->finish, 0, 5);?></td>
  196. <td title='<?php echo $overtime->desc?>'><?php echo $overtime->desc;?></td>
  197. <td class='overtime-<?php echo $overtime->status?>'><?php echo zget($this->lang->overtime->statusList, $overtime->status);?></td>
  198. <td>
  199. <?php extCommonModel::printLink('overtime', 'review', "id={$overtime->id}&status=pass", $lang->overtime->statusList['pass'], "data-status='pass' data-toggle='ajax'");?>
  200. <?php extCommonModel::printLink('overtime', 'review', "id={$overtime->id}&status=reject", $lang->overtime->statusList['reject'], "data-toggle='modal'");?>
  201. </td>
  202. </tr>
  203. <?php endforeach;?>
  204. </table>
  205. </div>
  206. <?php endif;?>
  207. <?php endif;?>
  208. <?php if($type == 'lieu'):?>
  209. <?php if(empty($lieuList)):?>
  210. <div class="table-empty-tip">
  211. <p>
  212. <span class="text-muted"><?php echo $lang->noData;?></span>
  213. </p>
  214. </div>
  215. <?php else:?>
  216. <div class='panel'>
  217. <table class='table table-data table-hover text-center table-fixed tablesorter <?php echo $appendClass?>' id='lieuTable'>
  218. <thead>
  219. <tr class='text-center'>
  220. <?php $vars = "type={$type}&orderBy=%s";?>
  221. <th class='w-80px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->lieu->id);?></th>
  222. <th class='w-80px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->lieu->createdBy);?></th>
  223. <th class='w-90px'><?php echo $lang->user->dept;?></th>
  224. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->lieu->begin);?></th>
  225. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->lieu->end);?></th>
  226. <th><?php echo $lang->lieu->desc;?></th>
  227. <th class='w-80px'><?php commonModel::printOrderLink('status', $orderBy, $vars, $lang->lieu->status);?></th>
  228. <th class='w-100px'><?php echo $lang->actions;?></th>
  229. </tr>
  230. </thead>
  231. <?php foreach($lieuList as $lieu):?>
  232. <tr>
  233. <td><?php echo $lieu->id;?></td>
  234. <td><?php echo zget($users, $lieu->createdBy);?></td>
  235. <td><?php echo zget($deptList, $lieu->dept);?></td>
  236. <td><?php echo $lieu->begin . ' ' . substr($lieu->start, 0, 5);?></td>
  237. <td><?php echo $lieu->end . ' ' . substr($lieu->finish, 0, 5);?></td>
  238. <td title='<?php echo $lieu->desc?>'><?php echo $lieu->desc;?></td>
  239. <td class='lieu-<?php echo $lieu->status?>'><?php echo zget($this->lang->lieu->statusList, $lieu->status);?></td>
  240. <td>
  241. <?php extCommonModel::printLink('lieu', 'review', "id={$lieu->id}&status=pass", $lang->lieu->statusList['pass'], "data-status='pass' data-toggle='ajax'");?>
  242. <?php extCommonModel::printLink('lieu', 'review', "id={$lieu->id}&status=reject", $lang->lieu->statusList['reject'], "data-toggle='modal'");?>
  243. </td>
  244. </tr>
  245. <?php endforeach;?>
  246. </table>
  247. </div>
  248. <?php endif;?>
  249. <?php endif;?>
  250. <?php if($type == 'all' and ($leaveList or $makeupList or $overtimeList or $lieuList)):?>
  251. <div class='panel'>
  252. <table class='table table-data table-hover text-center table-fixed tablesorter <?php echo $appendClass?>' id='leaveTable'>
  253. <thead>
  254. <tr class='text-center'>
  255. <th class='w-80px'><?php echo $lang->my->reviewModule;?></th>
  256. <th class='w-80px'><?php echo $lang->leave->createdBy;?></th>
  257. <th class='w-90px'><?php echo $lang->user->dept;?></th>
  258. <th class='w-100px'><?php echo $lang->leave->type;?></th>
  259. <th class='w-120px'><?php echo $lang->leave->begin;?></th>
  260. <th class='w-120px'><?php echo $lang->leave->end;?></th>
  261. <th class='w-60px'><?php echo $lang->leave->hours;?></th>
  262. <th><?php echo $lang->leave->desc;?></th>
  263. <th class='w-100px'><?php echo $lang->leave->status;?></th>
  264. <th class='w-100px'><?php echo $lang->actions;?></th>
  265. </tr>
  266. </thead>
  267. <?php foreach($leaveList as $leave):?>
  268. <tr>
  269. <td><?php echo $lang->leave->common;?></td>
  270. <td><?php echo zget($users, $leave->createdBy);?></td>
  271. <td><?php echo zget($deptList, $leave->dept);?></td>
  272. <td><?php echo zget($this->lang->leave->typeList, $leave->type);?></td>
  273. <td><?php echo $leave->begin . ' ' . substr($leave->start, 0, 5);?></td>
  274. <td><?php echo $leave->end . ' ' . substr($leave->finish, 0, 5);?></td>
  275. <td><?php echo $leave->hours;?></td>
  276. <td title='<?php echo $leave->desc?>'>
  277. <?php echo $leave->desc;?>
  278. </td>
  279. <td class='leave-<?php echo $leave->status?>'><?php echo zget($this->lang->leave->statusList, $leave->status);?></td>
  280. <td>
  281. <?php $mode = $leave->status == 'pass' ? 'back' : '';?>
  282. <?php extCommonModel::printLink('leave', 'review', "id={$leave->id}&status=pass&mode=$mode", $lang->leave->statusList['pass'], "data-status='pass' data-toggle='ajax'");?>
  283. <?php extCommonModel::printLink('leave', 'review', "id={$leave->id}&status=reject&mode=$mode", $lang->leave->statusList['reject'], "data-toggle='modal'");?>
  284. </td>
  285. </tr>
  286. <?php endforeach;?>
  287. <?php foreach($makeupList as $makeup):?>
  288. <tr>
  289. <td><?php echo $lang->makeup->common;?></td>
  290. <td><?php echo zget($users, $makeup->createdBy);?></td>
  291. <td><?php echo zget($deptList, $makeup->dept);?></td>
  292. <td><?php echo zget($this->lang->makeup->typeList, $makeup->type);?></td>
  293. <td><?php echo $makeup->begin . ' ' . substr($makeup->start, 0, 5);?></td>
  294. <td><?php echo $makeup->end . ' ' . substr($makeup->finish, 0, 5);?></td>
  295. <td><?php echo $makeup->hours;?></td>
  296. <td title='<?php echo $makeup->desc?>'><?php echo $makeup->desc;?></td>
  297. <td class='leave-<?php echo $makeup->status?>'><?php echo zget($this->lang->leave->statusList, $makeup->status);?></td>
  298. <td>
  299. <?php extCommonModel::printLink('makeup', 'review', "id={$makeup->id}&status=pass", $lang->makeup->statusList['pass'], "data-status='pass' data-toggle='ajax'");?>
  300. <?php extCommonModel::printLink('makeup', 'review', "id={$makeup->id}&status=reject", $lang->makeup->statusList['reject'], "data-toggle='modal'");?>
  301. </td>
  302. </tr>
  303. <?php endforeach;?>
  304. <?php foreach($overtimeList as $overtime):?>
  305. <tr>
  306. <td><?php echo $lang->overtime->common;?></td>
  307. <td><?php echo zget($users, $overtime->createdBy);?></td>
  308. <td><?php echo zget($deptList, $overtime->dept);?></td>
  309. <td><?php echo zget($this->lang->overtime->typeList, $overtime->type);?></td>
  310. <td><?php echo $overtime->begin . ' ' . substr($overtime->start, 0, 5);?></td>
  311. <td><?php echo $overtime->end . ' ' . substr($overtime->finish, 0, 5);?></td>
  312. <td><?php echo $overtime->hours;?></td>
  313. <td title='<?php echo $overtime->desc?>'><?php echo $overtime->desc;?></td>
  314. <td class='overtime-<?php echo $overtime->status?>'><?php echo zget($this->lang->overtime->statusList, $overtime->status);?></td>
  315. <td>
  316. <?php extCommonModel::printLink('overtime', 'review', "id={$overtime->id}&status=pass", $lang->overtime->statusList['pass'], "data-status='pass' data-toggle='ajax'");?>
  317. <?php extCommonModel::printLink('overtime', 'review', "id={$overtime->id}&status=reject", $lang->overtime->statusList['reject'], "data-toggle='modal'");?>
  318. </td>
  319. </tr>
  320. <?php endforeach;?>
  321. <?php foreach($lieuList as $lieu):?>
  322. <tr>
  323. <td><?php echo $lang->lieu->common;?></td>
  324. <td><?php echo zget($users, $lieu->createdBy);?></td>
  325. <td><?php echo zget($deptList, $lieu->dept);?></td>
  326. <td><?php echo $lang->my->lieu;?></td>
  327. <td><?php echo $lieu->begin . ' ' . substr($lieu->start, 0, 5);?></td>
  328. <td><?php echo $lieu->end . ' ' . substr($lieu->finish, 0, 5);?></td>
  329. <td><?php echo $lieu->hours;?></td>
  330. <td title='<?php echo $lieu->desc?>'><?php echo $lieu->desc;?></td>
  331. <td class='lieu-<?php echo $lieu->status?>'><?php echo zget($this->lang->lieu->statusList, $lieu->status);?></td>
  332. <td>
  333. <?php extCommonModel::printLink('lieu', 'review', "id={$lieu->id}&status=pass", $lang->lieu->statusList['pass'], "data-status='pass' data-toggle='ajax'");?>
  334. <?php extCommonModel::printLink('lieu', 'review', "id={$lieu->id}&status=reject", $lang->lieu->statusList['reject'], "data-toggle='modal'");?>
  335. </td>
  336. </tr>
  337. <?php endforeach;?>
  338. </table>
  339. </div>
  340. <?php elseif($type == 'all' and empty($attends)):?>
  341. <div class="table-empty-tip">
  342. <p>
  343. <span class="text-muted"><?php echo $lang->noData;?></span>
  344. </p>
  345. </div>
  346. <?php endif;?>
  347. <script>
  348. $(function()
  349. {
  350. $('[data-toggle=ajax]').click(function()
  351. {
  352. if($(this).hasClass('disabled')) return false;
  353. var status = $(this).data('status');
  354. if(status == 'undefined' || confirm(confirmReview[status]))
  355. {
  356. $.get($(this).prop('href'), function(response)
  357. {
  358. if(response.message) $.zui.messager.success(response.message);
  359. if(response.result == 'success') location.reload();
  360. return false;
  361. }, 'json');
  362. }
  363. return false;
  364. });
  365. });
  366. </script>
  367. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>