view.html.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * The view file of dataset module's view method of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL (http://zpl.pub/page/zplv12.html)
  7. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package dataset
  9. * @version $Id: view.html.php 4386 2013-02-19 07:37:45Z chencongzhi520@gmail.com $
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <div id='mainMenu' class='clearfix'>
  15. <div class='btn-toolbar pull-left'>
  16. <?php $browseLink = $this->session->datasetList ? $this->session->datasetList : $this->createLink('dataset', 'browse');?>
  17. <?php common::printBack($browseLink, 'btn btn-secondary');?>
  18. <div class='divider'></div>
  19. <div class='page-title'>
  20. <span class='text' title='<?php echo $table->name;?>'><?php echo $table->name;?></span>
  21. </div>
  22. </div>
  23. <div class="btn-toolbar pull-right">
  24. <?php common::printLink('chart', 'create', "dataset=$table->key", '<i class="icon icon-plus"></i> ' . $lang->chart->create, '', 'class="btn btn-primary"');?>
  25. </div>
  26. </div>
  27. <div id='mainContent' class='main-content'>
  28. <div class='tabs' id='tabsNav'>
  29. <ul class='nav nav-tabs'>
  30. <li <?php if($type == 'data') echo "class='active'"?>><a href='#data' data-toggle='tab'><?php echo '<i class="icon-list"></i> ' . $lang->dataset->data;?></a></li>
  31. <li <?php if($type == 'schema') echo "class='active'"?>><a href='#schema' data-toggle='tab'><?php echo '<i class="icon-layout"></i> ' . $lang->dataset->schema;?></a></li>
  32. </ul>
  33. <div class='tab-content main-table'>
  34. <div class='tab-pane <?php if($type == 'data') echo 'active'?>' id='data'>
  35. <table class='table' id='tableData' style="min-width: <?php echo count($table->schema->fields)*100;?>px">
  36. <thead>
  37. <tr class='text-left'>
  38. <?php foreach($table->schema->fields as $field):?>
  39. <th><?php echo $field['name'];?></th>
  40. <?php endforeach;?>
  41. </tr>
  42. </thead>
  43. <tbody class='text-left'>
  44. <?php foreach($rows as $row):?>
  45. <tr>
  46. <?php foreach($table->schema->fields as $field => $info):?>
  47. <td><?php $this->dataset->printCell($row, $field, $info);?></td>
  48. <?php endforeach;?>
  49. </tr>
  50. <?php endforeach;?>
  51. </tbody>
  52. </table>
  53. </div>
  54. <div class='tab-pane <?php if($type == 'schema') echo 'active'?>' id='schema'>
  55. <table class='table' id='fieldList'>
  56. <thead>
  57. <tr>
  58. <th class='fieldName text-left'><?php echo $lang->dataset->fieldName;?></th>
  59. <th class='text-left'><?php echo $lang->dataset->fieldType;?></th>
  60. </tr>
  61. </thead>
  62. <tbody>
  63. <?php foreach($table->schema->fields as $field):?>
  64. <tr>
  65. <td class='text-left'><?php echo $field['name'];?></td>
  66. <td class='text-left'><?php echo $lang->dataset->fieldTypeList[$field['type']];?></td>
  67. </tr>
  68. <?php endforeach;?>
  69. </tbody>
  70. </table>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>