Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ons-template id="cat-makan.html">
- <ons-page>
- <ons-toolbar class="wow fadeInDown">
- <div class="left">
- <ons-toolbar-button ng-click="menu.toggle()">
- <ons-icon icon="ion-navicon-round" size="20px" fixed-width="true"></ons-icon>
- Catatan Diet <?php echo $_SESSION['username'];?>
- </ons-toolbar-button>
- </div>
- <div class="right"></div>
- </ons-toolbar>
- <?php
- $QueryCatDiet = mysqli_query($db, "SELECT tgl FROM foodnote order by tgl ASC");
- while($datamenu = mysqli_fetch_array($QueryCatDiet)){
- $tgl2 = $datamenu['tgl'];
- ?>
- <ons-list modifier="inset" class="wow fadeIn" style="margin-top: 10px;">
- <ons-list-header> <?php echo $tgl2;?> </ons-list-header>
- <ons-list-item >
- <div class="formarea">
- <table class="table">
- <tr>
- <th>No.<th>
- <th>Makanan<th>
- <th>Kalori<th>
- </tr>
- <?php
- $QueryCatDiet2 = mysqli_query($db, "SELECT * FROM foodnote WHERE tgl = '$tgl2' ");
- $i = 1;
- if(mysqli_num_rows($QueryCatDiet2) > 0){
- $tot_kal = 0;
- while ($menu = mysqli_fetch_assoc($QueryCatDiet2)) {
- $tot_kal += $menu['tot_kal'];
- ?>
- <tr>
- <th><?php echo $i;?><th>
- <td><?php echo $menu['bahan_makan'] ;?><td>
- <td><?php echo $menu['tot_kal'] ;?> Kalori<td>
- </tr>
- <?php $i++;
- $menu++;
- }} else {
- echo "Belum ada data!";
- }
- ?>
- <tr>
- <th colspan="3">Total Kalori<th>
- <th><?php echo $tot_kal;?> Kalori<th>
- </tr>
- </table>
- </div>
- </ons-list-item>
- </ons-list>
- <?php } ?>
- </ons-page>
- </ons-template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement