PageRenderTime 44ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/application/views/en/project/tables.php

https://github.com/data-quest/histat-web
PHP | 113 lines | 94 code | 19 blank | 0 comment | 14 complexity | 31c02b8947cc46399c715c75b2b0da1c MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-3.0, LGPL-2.1
  1. <?php
  2. $public = $project->Zugangsklasse == "-1";
  3. ?>
  4. <div id="project_details" style="display:none" <?= $public?'class="public"':''?>>
  5. <table border="0" cellpadding="0" cellspacing="0">
  6. <tr >
  7. <td width="10%">ZA <?= $project->ZA_Studiennummer ?></td>
  8. <td class="even" width="13%"><?= $project->theme->Thema ?></td>
  9. <td width="50%"><?= $project->Projektautor ?>, <?= $project->Projektname ?></td>
  10. <td class="timelines hide" width="22%"><?=__('close table view') ?></td>
  11. <td class="details"><span style="width:100%;display:block;"><?= HTML::anchor('project/details/' . $project->ID_Projekt, __('details...')) ?></span></div></td>
  12. </tr>
  13. </table>
  14. <?php
  15. $keymasks = $project->getKeymasks();
  16. $max = 10;
  17. $countTables = ceil(count($keymasks) / $max);
  18. if ($page <= 1) {
  19. $page = 1;
  20. } elseif ($page >= $countTables) {
  21. $page = $countTables;
  22. }
  23. $index = 0;
  24. for ($table = 0; $table < $countTables; $table++):
  25. ?>
  26. <table class="border-all" style="<?= $table + 1 != $page ? 'display:none;' : '' ?>margin:10px auto;width:98%">
  27. <?php for ($row = 0; $row < $max; $row++): ?>
  28. <?php if(isset($keymasks[$index])): ?>
  29. <tr >
  30. <td style="border:0px" width ="10%"></td>
  31. <td style="border:0px" valign="top" >
  32. <?= isset($keymasks[$index]->Name) ? HTML::anchor('table/details/' . $keymasks[$index]->ID_HS . '#tabelle', $keymasks[$index]->Name) : ''; ?>
  33. </td>
  34. <td style="border:0px" valign="top" width ="20%">
  35. <div class="link">
  36. <?php
  37. $count =$project->getTimelines($keymasks[$index]->ID_HS);
  38. ?>
  39. <?= isset($keymasks[$index]->Name) ? HTML::anchor('table/details/' . $keymasks[$index]->ID_HS . '#tabelle', __(':timelines Zeitreihen',array(':timelines'=>$count[0]->timelines))) : ''; ?>
  40. </div>
  41. </td>
  42. </tr>
  43. <?php endif;?>
  44. <?php $index++ ?>
  45. <?php endfor; ?>
  46. </table>
  47. <?php endfor; ?>
  48. <div class="clear"></div>
  49. <?php if ($countTables > 1) : ?>
  50. <div class="pages">
  51. <?= HTML::anchor('project/tables/' . $project->ID_Projekt . '/' . ($page - 1), "zur端ck", array('class' => 'prev')) ?>
  52. <div class="list">
  53. <?php
  54. $start = max(0, $page - 7);
  55. $end = min($countTables, $page + 7);
  56. if ($page > $countTables - 7) {
  57. $start-= $page + 7 - $countTables;
  58. }
  59. if ($page < 7) {
  60. $end += 7 - $page;
  61. }
  62. if ($start < 1) {
  63. $start = 0;
  64. }
  65. if ($end > $countTables) {
  66. $end = $countTables;
  67. }
  68. ?>
  69. <div style="width:<?= 15 * 50 ?>px">
  70. <?php
  71. for ($i = $start; $i < $end; $i++):
  72. ?>
  73. <?php
  74. $attr = array();
  75. if ($page == $i + 1) {
  76. $attr['class'] = 'current';
  77. }
  78. ?>
  79. <?= HTML::anchor('project/tables/' . $project->ID_Projekt . '/' . ($i + 1), ($i + 1), $attr) ?>
  80. <?php endfor; ?>
  81. </div>
  82. </div>
  83. <?= HTML::anchor('project/tables/' . $project->ID_Projekt . '/' . ($page + 1), "vor", array('class' => 'next')) ?>
  84. <div class="clear"></div>
  85. </div>
  86. <div class="clear"></div>
  87. <?php endif; ?>
  88. </div>
  89. <script type="text/javascript">
  90. var more = "more...";
  91. var less = "less...";
  92. var title = "<?= $project->Projektname ?>"
  93. var closeText = "close";
  94. </script>