Advertisement
Guest User

Tanggal Ganda

a guest
Aug 30th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. <ons-template id="cat-makan.html">
  2. <ons-page>
  3. <ons-toolbar class="wow fadeInDown">
  4. <div class="left">
  5. <ons-toolbar-button ng-click="menu.toggle()">
  6. <ons-icon icon="ion-navicon-round" size="20px" fixed-width="true"></ons-icon>
  7. Catatan Diet <?php echo $_SESSION['username'];?>
  8. </ons-toolbar-button>
  9. </div>
  10. <div class="right"></div>
  11. </ons-toolbar>
  12.  
  13. <?php
  14.  
  15. $QueryCatDiet = mysqli_query($db, "SELECT tgl FROM foodnote order by tgl ASC");
  16.  
  17. while($datamenu = mysqli_fetch_array($QueryCatDiet)){
  18. $tgl2 = $datamenu['tgl'];
  19.  
  20. ?>
  21.  
  22. <ons-list modifier="inset" class="wow fadeIn" style="margin-top: 10px;">
  23. <ons-list-header> <?php echo $tgl2;?> </ons-list-header>
  24.  
  25. <ons-list-item >
  26. <div class="formarea">
  27. <table class="table">
  28. <tr>
  29. <th>No.<th>
  30. <th>Makanan<th>
  31. <th>Kalori<th>
  32. </tr>
  33. <?php
  34. $QueryCatDiet2 = mysqli_query($db, "SELECT * FROM foodnote WHERE tgl = '$tgl2' ");
  35.  
  36. $i = 1;
  37. if(mysqli_num_rows($QueryCatDiet2) > 0){
  38.  
  39. $tot_kal = 0;
  40. while ($menu = mysqli_fetch_assoc($QueryCatDiet2)) {
  41. $tot_kal += $menu['tot_kal'];
  42.  
  43. ?>
  44. <tr>
  45. <th><?php echo $i;?><th>
  46. <td><?php echo $menu['bahan_makan'] ;?><td>
  47. <td><?php echo $menu['tot_kal'] ;?> Kalori<td>
  48. </tr>
  49. <?php $i++;
  50. $menu++;
  51. }} else {
  52. echo "Belum ada data!";
  53. }
  54. ?>
  55. <tr>
  56. <th colspan="3">Total Kalori<th>
  57. <th><?php echo $tot_kal;?> Kalori<th>
  58. </tr>
  59. </table>
  60.  
  61. </div>
  62. </ons-list-item>
  63. </ons-list>
  64.  
  65. <?php } ?>
  66.  
  67. </ons-page>
  68. </ons-template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement