Web Interfaces of PROSUME

history_hgm.ctp 3.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. $this->layout = false;
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <?= $this->element('Eprosume/header') ?>
  7. <body class="hold-transition skin-green sidebar-mini">
  8. <div class="wrapper">
  9. <?= $this->element('Eprosume/mainHeader') ?>
  10. <!-- Left side column. contains the logo and sidebar -->
  11. <?= $this->element('Eprosume/leftSideColumn') ?>
  12. <!-- Content Wrapper. Contains page content -->
  13. <div class="content-wrapper">
  14. <!-- Content Header (Page header) -->
  15. <section class="content-header">
  16. <h1>
  17. History Meter
  18. <small><?= $meter_id; ?></small>
  19. </h1>
  20. <ol class="breadcrumb">
  21. <li><a href="/web"><i class="fa fa-dashboard"></i> <?= $app_name ?></a></li>
  22. <li><a href="/web/history">History</a></li>
  23. <li class="active"><a href="/<?= $meter_id; ?>"><?= $meter_id; ?></a></li>
  24. </ol>
  25. </section>
  26. <!-- Main content -->
  27. <section class="content">
  28. <div class="row">
  29. <div class="col-xs-12">
  30. <div class="box">
  31. <!-- /.box-header -->
  32. <div class="box-body">
  33. <?= $this->element('Eprosume/dataTableToolbar', [
  34. "prosumers" => $prosumers,
  35. "column" => "1,2",
  36. "columnTimestamp"=>0
  37. ]) ?>
  38. <table id="valueTable" class="table table-bordered table-striped">
  39. <thead>
  40. <tr>
  41. <th>Timestamp</th>
  42. <th>From</th>
  43. <th>To</th>
  44. <th>Consumed Energy</th>
  45. <th>Purchased Energy</th>
  46. <th>Produced Energy</th>
  47. <th>Sold Energy</th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. <?php foreach($blocks as $block) {
  52. if(empty($block['memo']['consumedEnergy'])) continue;
  53. ?>
  54. <tr>
  55. <td><?= $block['timestamp']; ?></td>
  56. <td><a href="/web/meter/<?= $block['wallet_from']; ?>"><?= $block['wallet_from']; ?></a></td>
  57. <td><a href="/web/meter/<?= $block['wallet_to']; ?>"><?= $block['wallet_to']; ?></a></td>
  58. <td><?= @number_format($block['memo']['consumedEnergy'],2,',','.'); ?></td>
  59. <td><?= @number_format($block['memo']['purchasedEnergy'],2,',','.'); ?></td>
  60. <td><?= @number_format($block['memo']['producedEnergy'],2,',','.'); ?></td>
  61. <td><?= @number_format($block['memo']['soldEnergy'],2,',','.'); ?></td>
  62. </tr>
  63. <?php } ?>
  64. </tbody>
  65. </table>
  66. </div>
  67. <!-- /.box-body -->
  68. </div>
  69. <!-- /.box -->
  70. </div>
  71. <!-- /.col -->
  72. </div>
  73. <!-- /.row -->
  74. </section>
  75. <!-- /.content -->
  76. </div>
  77. <!-- /.content-wrapper -->
  78. <?= $this->element('Eprosume/footer') ?>
  79. </div>
  80. <!-- ./wrapper -->
  81. <?= $this->element('Eprosume/scripts') ?>
  82. </body>
  83. </html>