Web Interfaces of PROSUME

index.ctp 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * @var \App\View\AppView $this
  4. * @var \App\Model\Entity\User[]|\Cake\Collection\CollectionInterface $users
  5. */
  6. $this->layout = false;
  7. ?>
  8. <!DOCTYPE html>
  9. <html>
  10. <?= $this->element('Eprosume/header') ?>
  11. <body class="hold-transition skin-green sidebar-mini">
  12. <div class="wrapper">
  13. <?= $this->element('Eprosume/mainHeader') ?>
  14. <!-- Left side column. contains the logo and sidebar -->
  15. <?= $this->element('Eprosume/leftSideColumn') ?>
  16. <!-- Content Wrapper. Contains page content -->
  17. <div class="content-wrapper">
  18. <!-- Content Header (Page header) -->
  19. <section class="content-header">
  20. <h1>
  21. Users
  22. <small></small>
  23. </h1>
  24. <ol class="breadcrumb">
  25. <li><a href="/"><i class="fa fa-dashboard"></i> <?= $app_name ?></a></li>
  26. <li class="active">Users</li>
  27. </ol>
  28. </section>
  29. <!-- Main content -->
  30. <section class="content">
  31. <div class="row">
  32. <div class="col-xs-12">
  33. <div class="box">
  34. <!-- /.box-header -->
  35. <div class="box-body">
  36. <nav class="user-nav large-3 medium-4 columns" id="actions-sidebar">
  37. <ul class="side-nav">
  38. <li class="heading"><?= __('Actions') ?></li>
  39. <li><?= $this->Html->link(__('New User'), ['action' => 'add']) ?></li>
  40. </ul>
  41. </nav>
  42. <div class="users index large-9 medium-8 columns content">
  43. <h3><?= __('Users') ?></h3>
  44. <table class="table table-striped" cellpadding="0" cellspacing="0">
  45. <thead>
  46. <tr>
  47. <th scope="col"><?= $this->Paginator->sort('id') ?></th>
  48. <th scope="col"><?= $this->Paginator->sort('username') ?></th>
  49. <th scope="col"><?= $this->Paginator->sort('emailaddress', 'Email') ?></th>
  50. <th scope="col"><?= $this->Paginator->sort('role') ?></th>
  51. <th scope="col"><?= $this->Paginator->sort('meter_id', 'Associated meter') ?></th>
  52. <th scope="col"><?= $this->Paginator->sort('created') ?></th>
  53. <th scope="col"><?= $this->Paginator->sort('modified') ?></th>
  54. <th scope="col" class="actions"><?= __('Actions') ?></th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <?php foreach ($users as $user): ?>
  59. <tr>
  60. <td><?= $this->Number->format($user->id) ?></td>
  61. <td><?= h($user->username) ?></td>
  62. <td><?= h($user->emailaddress) ?></td>
  63. <td><?= h($user->role) ?></td>
  64. <td><?= h($meterList[$user->meter_id] ?? "-") ?></td>
  65. <td><?= h($user->created) ?></td>
  66. <td><?= h($user->modified) ?></td>
  67. <td class="actions">
  68. <?= $this->Html->link(__('View'), ['action' => 'view', $user->id]) ?>
  69. <?= $this->Html->link(__('Edit'), ['action' => 'edit', $user->id]) ?>
  70. <?php if($user->role != "admin"): ?>
  71. <?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $user->id], ['confirm' => __('Are you sure you want to delete # {0}?', $user->id)]) ?>
  72. <?php else: ?>
  73. <td>&nbsp;</td>
  74. <?php endif ?>
  75. </td>
  76. </tr>
  77. <?php endforeach; ?>
  78. </tbody>
  79. </table>
  80. <div class="paginator">
  81. <ul class="pagination">
  82. <?= $this->Paginator->first('<< ' . __('first')) ?>
  83. <?= $this->Paginator->prev('< ' . __('previous')) ?>
  84. <?= $this->Paginator->numbers() ?>
  85. <?= $this->Paginator->next(__('next') . ' >') ?>
  86. <?= $this->Paginator->last(__('last') . ' >>') ?>
  87. </ul>
  88. <p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
  89. </div>
  90. </div>
  91. </div>
  92. <!-- /.box-body -->
  93. </div>
  94. <!-- /.box -->
  95. </div>
  96. <!-- /.col -->
  97. </div>
  98. <!-- /.row -->
  99. </section>
  100. <!-- /.content -->
  101. </div>
  102. <!-- /.content-wrapper -->
  103. <?= $this->element('Eprosume/footer') ?>
  104. </div>
  105. <!-- ./wrapper -->
  106. <?= $this->element('Eprosume/scripts') ?>
  107. </body>
  108. </html>