Web Interfaces of PROSUME

history_daily.ctp 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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
  18. <small></small>
  19. </h1>
  20. <ol class="breadcrumb">
  21. <li><a href="/"><i class="fa fa-dashboard"></i> <?= $app_name ?></a></li>
  22. <li class="active"><a href="/history/daily">Daily History</a></li>
  23. </ol>
  24. </section>
  25. <!-- Main content -->
  26. <section class="content">
  27. <div class="row">
  28. <div class="col-xs-12">
  29. <div class="box">
  30. <!-- /.box-header -->
  31. <div class="box-body">
  32. <?= $this->element('Eprosume/dataTableToolbar', [
  33. "prosumers" => $prosumers,
  34. "column" => 1,
  35. "columnTimestamp"=>0
  36. ]) ?>
  37. <table id="valueTable" class="table table-bordered table-striped">
  38. <thead>
  39. <tr>
  40. <th>Day</th>
  41. <th>From</th>
  42. <th>To</th>
  43. <th>Asset</th>
  44. <th>Value</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. <?php foreach ($blocks as $block) {
  49. if ($block['asset'] == 'PRS') { ?>
  50. <tr class="blockRow" name="<?= $block['id']; ?>">
  51. <td>
  52. <a href="/web/block/<?= $block['id']; ?>"><?= $block['timestamp']; ?></a>
  53. </td>
  54. <td>
  55. <a href="/web/meter/<?= $block['wallet_from']; ?>"><?= $block['wallet_from']; ?></a>
  56. </td>
  57. <td>
  58. <a href="/web/meter/<?= $block['wallet_to']; ?>"><?= $block['wallet_to']; ?></a>
  59. </td>
  60. <td><?= $block['asset']; ?></td>
  61. <td><?= @number_format($block['amount'], 2, ',', '.'); ?></td>
  62. <td></td>
  63. <td></td>
  64. <td></td>
  65. </tr>
  66. <?php } else { ?>
  67. <tr class="blockRow" name="<?= $block['id']; ?>">
  68. <td>
  69. <a href="/web/block/<?= $block['id']; ?>"><?= $block['timestamp']; ?></a>
  70. </td>
  71. <td>
  72. <a href="/web/meter/<?= $block['wallet_from']; ?>"><?= $block['wallet_from']; ?></a>
  73. </td>
  74. <td>
  75. <a href="/web/meter/<?= $block['wallet_to']; ?>"><?= $block['wallet_to']; ?></a>
  76. </td>
  77. <td><?= $block['asset']; ?></td>
  78. <td><?= @number_format($block['amount'], 2, ',', '.'); ?></td>
  79. <td><?= @number_format($block['memo']['consumedEnergy'], 2, ',', '.'); ?></td>
  80. <td><?= @number_format($block['memo']['producedEnergy'], 2, ',', '.'); ?></td>
  81. <td><?= @number_format($block['memo']['soldEnergy'], 2, ',', '.'); ?></td>
  82. </tr>
  83. <?php } ?>
  84. <?php } ?>
  85. </tbody>
  86. </table>
  87. </div>
  88. <!-- /.box-body -->
  89. </div>
  90. <!-- /.box -->
  91. </div>
  92. <!-- /.col -->
  93. </div>
  94. <!-- /.row -->
  95. </section>
  96. <!-- /.content -->
  97. </div>
  98. <!-- /.content-wrapper -->
  99. <?= $this->element('Eprosume/footer') ?>
  100. </div>
  101. <!-- ./wrapper -->
  102. <?= $this->element('Eprosume/scripts') ?>
  103. </body>
  104. </html>