browse.html.php 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * The browse view file of marketreport module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Hu Fangzhou <hufangzhou@easycorp.ltd>
  7. * @package marketreport
  8. * @link https://www.zentao.net
  9. */
  10. ?>
  11. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  12. <?php include $app->getModuleRoot() . 'common/view/datatable.fix.html.php';?>
  13. <div id="mainMenu" class="clearfix">
  14. <div class="btn-toolbar pull-left">
  15. <?php foreach($lang->marketreport->featureBar['browse'] as $key => $label):?>
  16. <?php $label = "<span class='text'>$label</span>";?>
  17. <?php
  18. $active = '';
  19. if($browseType == $key)
  20. {
  21. $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
  22. $active = 'btn-active-text';
  23. }
  24. ?>
  25. <?php $marketParam = $this->app->rawMethod == 'all' ? '' : "marketID=$marketID&";?>
  26. <?php echo html::a($this->createLink('marketreport', ($this->app->rawModule == 'marketresearch' && $this->app->rawMethod == 'reports') ? 'browse' : $this->app->rawMethod, $marketParam . "browseType=$key&orderBy=$orderBy"), $label, '', "class='btn btn-link $active' id='{$key}Tab'");?>
  27. <?php endforeach;?>
  28. <?php echo html::checkbox('involvedReport', array('1' => $lang->marketreport->mine), '', $this->cookie->involvedReport ? 'checked=checked' : '');?>
  29. </div>
  30. <div class="btn-toolbar pull-right">
  31. <?php if(common::hasPriv('marketreport', 'create')) echo html::a($this->createLink('marketreport', 'create', "marketID=$marketID"), "<i class='icon-plus'></i> {$lang->marketreport->create}", '', "class='btn btn-primary'");?>
  32. </div>
  33. </div>
  34. <div id="mainContent" class="main-row fade">
  35. <div class="main-col">
  36. <?php if(empty($reports)):?>
  37. <div class="table-empty-tip">
  38. <p>
  39. <span class="text-muted"><?php echo $lang->noData;?></span>
  40. <?php if(common::hasPriv('marketreport', 'create')):?>
  41. <?php echo html::a($this->createLink('marketreport', 'create', "marketID=$marketID"), "<i class='icon icon-plus'></i> " . $lang->marketreport->create, '', "class='btn btn-info'");?>
  42. <?php endif;?>
  43. </p>
  44. </div>
  45. <?php else:?>
  46. <form class='main-table' method='post' id='marketreportForm'>
  47. <div class="table-header fixed-right">
  48. <nav class="btn-toolbar pull-right setting"></nav>
  49. </div>
  50. <?php
  51. $datatableId = $this->moduleName . ucfirst($this->methodName);
  52. $useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
  53. $vars = $marketParam . "browseType=$browseType&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";
  54. if($useDatatable) include $app->getModuleRoot() . 'common/view/datatable.html.php';
  55. $setting = $this->datatable->getOldSetting('marketreport');
  56. $widths = $this->datatable->setFixedFieldWidth($setting);
  57. $columns = 0;
  58. ?>
  59. <?php if(!$useDatatable) echo '<div class="table-responsive">';?>
  60. <table class='table has-sort-head' id='marketreportList'>
  61. <thead>
  62. <tr>
  63. <?php
  64. foreach($setting as $key => $value)
  65. {
  66. if($value->show)
  67. {
  68. $this->datatable->printHead($value, $orderBy, $vars, false);
  69. $columns ++;
  70. }
  71. }
  72. ?>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. <?php foreach($reports as $report):?>
  77. <tr data-id='<?php echo $report->id?>'>
  78. <?php
  79. foreach($setting as $value) $this->marketreport->printCell($value, $report, $users, $markets, $researches, $marketID);
  80. ?>
  81. </tr>
  82. <?php endforeach;?>
  83. </tbody>
  84. </table>
  85. <?php if(!$useDatatable) echo '</div>';?>
  86. <div class="table-footer">
  87. <?php $pager->show('right', 'pagerjs');?>
  88. </div>
  89. </form>
  90. <?php endif;?>
  91. </div>
  92. </div>
  93. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>