Web Interfaces of PROSUME

edit.ctp 4.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * @var \App\View\AppView $this
  4. * @var \App\Model\Entity\User $user
  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><a href="/users">Users</a></li>
  27. <li class="active"><?= h($user->username) ?></li>
  28. </ol>
  29. </section>
  30. <!-- Main content -->
  31. <section class="content">
  32. <div class="row">
  33. <div class="col-xs-12">
  34. <div class="box">
  35. <!-- /.box-header -->
  36. <div class="box-body">
  37. <nav class="user-nav large-3 medium-4 columns" id="actions-sidebar">
  38. <ul class="side-nav">
  39. <li class="heading"><?= __('Actions') ?></li>
  40. <?php if($user->role != "admin"): ?>
  41. <li><?= $this->Form->postLink(
  42. __('Delete'),
  43. ['action' => 'delete', $user->id],
  44. ['confirm' => __('Are you sure you want to delete # {0}?', $user->id)]
  45. )
  46. ?></li>
  47. <?php endif ?>
  48. <li><?= $this->Html->link(__('List Users'), ['action' => 'index']) ?></li>
  49. </ul>
  50. </nav>
  51. <div class="users form large-9 medium-8 columns content">
  52. <?= $this->Form->create($user) ?>
  53. <fieldset>
  54. <legend><?= __('Edit User') ?></legend>
  55. <?php
  56. echo $this->Form->control('username');
  57. echo $this->Form->control('emailaddress', ['label'=>'Email']);
  58. echo $this->Form->control('role', [
  59. "type" => "select",
  60. "options" => ['admin'=>'admin', 'reader'=>'reader'],
  61. 'value' => $user->role
  62. ]);
  63. echo $this->Form->control('meter_id', [
  64. "label" => "Associated meter",
  65. "type" => "select",
  66. "options" => $meterList,
  67. 'value' => $user->meter_id
  68. ]);
  69. ?>
  70. </fieldset>
  71. <?= $this->Form->button(__('Submit'), ['class'=>'btn btn-success']) ?>
  72. <?= $this->Form->end() ?>
  73. </div>
  74. </div>
  75. <!-- /.box-body -->
  76. </div>
  77. <!-- /.box -->
  78. </div>
  79. <!-- /.col -->
  80. </div>
  81. <!-- /.row -->
  82. </section>
  83. <!-- /.content -->
  84. </div>
  85. <!-- /.content-wrapper -->
  86. <?= $this->element('Eprosume/footer') ?>
  87. </div>
  88. <!-- ./wrapper -->
  89. <?= $this->element('Eprosume/scripts') ?>
  90. </body>
  91. </html>