browse.html.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  2. <div id="mainMenu" class="clearfix">
  3. <div class="btn-toolbar pull-left">
  4. <?php
  5. foreach($lang->demandpool->labelList as $label => $labelName)
  6. {
  7. $active = $browseType == $label ? 'btn-active-text' : '';
  8. echo html::a($this->createLink('demandpool', 'browse', "browseType=$label&param=0&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"), '<span class="text">' . $labelName . '</span>' . ($browseType == $label ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : ''), '', "class='btn btn-link $active'");
  9. }
  10. ?>
  11. <a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->searchAB;?></a>
  12. </div>
  13. <div class="btn-toolbar pull-right">
  14. <?php if(common::hasPriv('demandpool', 'create')) echo html::a($this->createLink('demandpool', 'create'), "<i class='icon-plus'></i> {$lang->demandpool->create}", '', "class='btn btn-primary'");?>
  15. </div>
  16. </div>
  17. <div id="mainContent" class="main-row fade">
  18. <div class="main-col">
  19. <div class="cell<?php if($browseType == 'bysearch') echo ' show';?>" id="queryBox" data-module='demandpool' data-url="<?php echo $this->createLink('search', 'buildOldForm', 'module=demandpool');?>"></div>
  20. <?php if(empty($demandpools)):?>
  21. <div class="table-empty-tip">
  22. <p>
  23. <span class="text-muted"><?php echo $lang->demandpool->noData;?></span>
  24. <?php if(common::hasPriv('demandpool', 'create')):?>
  25. <?php echo html::a($this->createLink('demandpool', 'create'), "<i class='icon icon-plus'></i> " . $lang->demandpool->create, '', "class='btn btn-info'");?>
  26. <?php endif;?>
  27. </p>
  28. </div>
  29. <?php else:?>
  30. <form class='main-table' method='post' id='demandpoolForm'>
  31. <?php $vars = "browseType=$browseType&param=0&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID"; ?>
  32. <table class='table has-sort-head' id='demandpoolList'>
  33. <thead>
  34. <tr>
  35. <th class='c-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->demandpool->idAB);?></th>
  36. <th><?php common::printOrderLink('name', $orderBy, $vars, $lang->demandpool->name);?></th>
  37. <th class='w-160px'><?php common::printOrderLink('owner', $orderBy, $vars, $lang->demandpool->owner);?></th>
  38. <?php foreach($lang->demandpool->colList as $key => $label):?>
  39. <th class='c-estimate text-center c-<?php echo $key;?>'><?php echo $label;?></th>
  40. <?php endforeach;?>
  41. <th class='c-actions-3 text-center'><?php echo $lang->actions;?></th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <?php foreach($demandpools as $demandpool):?>
  46. <tr>
  47. <td><?php echo sprintf('%03d', $demandpool->id);?></td>
  48. <td title="<?php echo $demandpool->name;?>" class='c-name'>
  49. <?php echo html::a($this->createLink('demand', 'browse', "demandpoolID=$demandpool->id"), $demandpool->name);?>
  50. </td>
  51. <?php
  52. $owner = '';
  53. if(!empty($demandpool->owner))
  54. {
  55. foreach(explode(',', str_replace(' ', '', $demandpool->owner)) as $account) $owner .= ' ' . zget($users, $account);
  56. }
  57. ?>
  58. <td class='c-name' title="<?php echo trim($owner);?>"><?php echo trim($owner);?></td>
  59. <?php foreach($lang->demandpool->colList as $key => $label):?>
  60. <td class='text-center'><?php echo isset($demandpool->summary[$key]) ? $demandpool->summary[$key]->count : 0;?></td>
  61. <?php endforeach;?>
  62. <td class='c-actions'>
  63. <?php
  64. common::printIcon('demandpool', 'edit', "demandpoolID=$demandpool->id", $demandpool, 'list');
  65. if($demandpool->status == 'normal') common::printIcon('demandpool', 'close', "demandpoolID=$demandpool->id", $demandpool, 'list', 'off', '', 'iframe', true);
  66. if($demandpool->status == 'closed') common::printIcon('demandpool', 'activate', "demandpoolID=$demandpool->id", $demandpool, 'list', '', '', 'iframe', true);
  67. common::printIcon('demandpool', 'delete', "demandpoolID=$demandpool->id", $demandpool, 'list', 'trash', 'hiddenwin');
  68. ?>
  69. </td>
  70. </tr>
  71. <?php endforeach;?>
  72. </tbody>
  73. </table>
  74. <div class="table-footer">
  75. <?php $pager->show('right', 'pagerjs');?>
  76. </div>
  77. </form>
  78. <?php endif;?>
  79. </div>
  80. </div>
  81. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>