browse.html.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /**
  3. * The browse view file of trip 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 trip
  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->trip->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('type', $type)?>
  36. <div id='menuActions'>
  37. <?php extCommonModel::printLink($type, 'create', '', "<i class='icon icon-plus'></i> {$lang->$type->create}", "data-toggle='modal' class='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($type, $mode, "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($type, $mode, "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'>
  62. <table class='table table-data table-hover text-center table-fixed tablesorter'>
  63. <thead>
  64. <tr class='text-center'>
  65. <?php $vars = "date=$date&orderBy=%s";?>
  66. <th class='w-50px'> <?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->$type->id, 'trip', $type);?></th>
  67. <th class='w-100px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->$type->createdBy, 'trip', $type);?></th>
  68. <th class='w-180px'><?php commonModel::printOrderLink('name', $orderBy, $vars, $lang->$type->name, 'trip', $type);?></th>
  69. <th class='w-180px'><?php commonModel::printOrderLink('customer', $orderBy, $vars, $lang->$type->customer, 'trip', $type);?></th>
  70. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->$type->begin, 'trip', $type);?></th>
  71. <th class='w-150px'><?php commonModel::printOrderLink('end', $orderBy, $vars, $lang->$type->end, 'trip', $type);?></th>
  72. <?php if($type == 'trip'):?>
  73. <th class='w-80px'><?php commonModel::printOrderLink('from', $orderBy, $vars, $lang->$type->from, 'trip', $type);?></th>
  74. <?php endif;?>
  75. <th class='w-80px'><?php commonModel::printOrderLink('to', $orderBy, $vars, $lang->$type->to, 'trip', $type);?></th>
  76. <th><?php echo $lang->$type->desc;?></th>
  77. <th class='w-100px'><?php echo $lang->actions;?></th>
  78. </tr>
  79. </thead>
  80. <?php foreach($tripList as $trip):?>
  81. <tr>
  82. <td><?php echo $trip->id;?></td>
  83. <td><?php echo zget($users, $trip->createdBy);?></td>
  84. <td title='<?php echo $trip->name?>'><?php echo $trip->name;?></td>
  85. <?php $tripCustomer = '';?>
  86. <?php foreach(explode(',', $trip->customers) as $customer) $tripCustomer .= zget($customers, $customer, '') . '/';?>
  87. <?php $tripCustomer = trim($tripCustomer, '/');?>
  88. <td title='<?php echo $tripCustomer;?>'><?php echo $tripCustomer;?></td>
  89. <td><?php echo formatTime($trip->begin . ' ' . $trip->start, DT_DATETIME2);?></td>
  90. <td><?php echo formatTime($trip->end . ' ' . $trip->finish, DT_DATETIME2);?></td>
  91. <?php if($type == 'trip'):?>
  92. <td title='<?php echo $trip->from?>'><?php echo $trip->from;?></td>
  93. <?php endif;?>
  94. <td title='<?php echo $trip->to?>'> <?php echo $trip->to;?></td>
  95. <td title='<?php echo $trip->desc?>'><?php echo $trip->desc;?></td>
  96. <td>
  97. <?php if($trip->createdBy == $this->app->user->account):?>
  98. <?php echo baseHTML::a($this->createLink("$type", 'edit', "id=$trip->id"), $lang->edit, "data-toggle='modal'");?>
  99. <?php echo baseHTML::a($this->createLink("$type", 'delete', "id=$trip->id"), $lang->delete, "class='deleter'");?>
  100. <?php endif;?>
  101. </td>
  102. </tr>
  103. <?php endforeach;?>
  104. </table>
  105. <?php if(!$tripList):?>
  106. <?php endif;?>
  107. </div>
  108. </div>
  109. </div>
  110. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>