Guest User

Untitled

a guest
May 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.50 KB | None | 0 0
  1. if( have_rows('zero') ):
  2.  
  3.  
  4. ?><div class="grid-50" style="float: left;"><table><tr><th colspan="2">Zero</th></tr><?php
  5.  
  6. while( have_rows('zero') ) : the_row(); ?>
  7.  
  8. <tr><td>Upon Waking</td><td><?php the_sub_field('upon_waking')?></td></tr>
  9.  
  10. <?php
  11. if ( have_rows('meal_1') ){
  12. while( have_rows('meal_1') ) {
  13. the_row();
  14.  
  15. $protein_object = (get_sub_field_object('protein_select'));
  16. $protein_value = get_sub_field('protein_select');
  17. $protein_label = ($protein_object['choices'][$protein_value]);
  18.  
  19. $carb_object = (get_sub_field_object('carb_select'));
  20. $carb_value = get_sub_field('carb_select');
  21. $carb_label = ($carb_object['choices'][$carb_value]);
  22.  
  23. $fat_object = (get_sub_field_object('fat_select'));
  24. $fat_value = get_sub_field('fat_select');
  25. $fat_label = ($fat_object['choices'][$fat_value]);
  26.  
  27. $protein_amount = round($zero_protein_feed / $protein_value * 10) *10;
  28. $fat_amount = round($zero_fat_feed / $fat_value * 10) *10 ;
  29.  
  30. ?><tr><td>Meal 1</td><td><?php echo $protein_amount ?>g <?php echo $protein_label ?>, <?php echo $fat_amount ?>g <?php echo $fat_label ?></td></tr><?php } }
  31.  
  32. if ( have_rows('meal_2') ){
  33. while( have_rows('meal_2') ) {
  34. the_row();
  35.  
  36. $protein_object = (get_sub_field_object('protein_select'));
  37. $protein_value = get_sub_field('protein_select');
  38. $protein_label = ($protein_object['choices'][$protein_value]);
  39.  
  40. $carb_object = (get_sub_field_object('carb_select'));
  41. $carb_value = get_sub_field('carb_select');
  42. $carb_label = ($carb_object['choices'][$carb_value]);
  43.  
  44. $fat_object = (get_sub_field_object('fat_select'));
  45. $fat_value = get_sub_field('fat_select');
  46. $fat_label = ($fat_object['choices'][$fat_value]);
  47.  
  48. $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
  49. $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
  50.  
  51. ?><tr><td>Meal 2</td><td><?php echo $protein_amount ?>g <?php echo $protein_label ?>, <?php echo $fat_amount ?>g <?php echo $fat_label ?></td></tr><?php } }
  52.  
  53. if ( have_rows('meal_3') ){
  54. while( have_rows('meal_3') ) {
  55. the_row();
  56.  
  57. $protein_object = (get_sub_field_object('protein_select'));
  58. $protein_value = get_sub_field('protein_select');
  59. $protein_label = ($protein_object['choices'][$protein_value]);
  60.  
  61. $carb_object = (get_sub_field_object('carb_select'));
  62. $carb_value = get_sub_field('carb_select');
  63. $carb_label = ($carb_object['choices'][$carb_value]);
  64.  
  65. $fat_object = (get_sub_field_object('fat_select'));
  66. $fat_value = get_sub_field('fat_select');
  67. $fat_label = ($fat_object['choices'][$fat_value]);
  68.  
  69. $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
  70. $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
  71.  
  72. ?><tr><td>Meal 3</td><td><?php echo $protein_amount ?>g <?php echo $protein_label ?>, <?php echo $fat_amount ?>g <?php echo $fat_label ?></td></tr><?php } }
  73.  
  74. if ( have_rows('meal_4') ){
  75. while( have_rows('meal_4') ) {
  76. the_row();
  77.  
  78. $protein_object = (get_sub_field_object('protein_select'));
  79. $protein_value = get_sub_field('protein_select');
  80. $protein_label = ($protein_object['choices'][$protein_value]);
  81.  
  82. $carb_object = (get_sub_field_object('carb_select'));
  83. $carb_value = get_sub_field('carb_select');
  84. $carb_label = ($carb_object['choices'][$carb_value]);
  85.  
  86. $fat_object = (get_sub_field_object('fat_select'));
  87. $fat_value = get_sub_field('fat_select');
  88. $fat_label = ($fat_object['choices'][$fat_value]);
  89.  
  90. $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
  91. $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
  92.  
  93. ?><tr><td>Meal 4</td><td><?php echo $protein_amount ?>g <?php echo $protein_label ?>, <?php echo $fat_amount ?>g <?php echo $fat_label ?></td></tr><?php } }
  94.  
  95. if ( have_rows('meal_5') ){
  96. while( have_rows('meal_5') ) {
  97. the_row();
  98.  
  99. $protein_object = (get_sub_field_object('protein_select'));
  100. $protein_value = get_sub_field('protein_select');
  101. $protein_label = ($protein_object['choices'][$protein_value]);
  102.  
  103. $carb_object = (get_sub_field_object('carb_select'));
  104. $carb_value = get_sub_field('carb_select');
  105. $carb_label = ($carb_object['choices'][$carb_value]);
  106.  
  107. $fat_object = (get_sub_field_object('fat_select'));
  108. $fat_value = get_sub_field('fat_select');
  109. $fat_label = ($fat_object['choices'][$fat_value]);
  110.  
  111. $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
  112. $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
  113.  
  114. if ($feeds_per_day > 4){
  115.  
  116. ?><tr><td>Meal 5</td><td><?php echo $protein_amount ?>g <?php echo $protein_label ?>, <?php echo $fat_amount ?>g <?php echo $fat_label ?></td></tr><?php } }
  117.  
  118. }
  119.  
  120. if ( have_rows('meal_6') ){
  121. while( have_rows('meal_6') ) {
  122. the_row();
  123.  
  124. $protein_object = (get_sub_field_object('protein_select'));
  125. $protein_value = get_sub_field('protein_select');
  126. $protein_label = ($protein_object['choices'][$protein_value]);
  127.  
  128. $carb_object = (get_sub_field_object('carb_select'));
  129. $carb_value = get_sub_field('carb_select');
  130. $carb_label = ($carb_object['choices'][$carb_value]);
  131.  
  132. $fat_object = (get_sub_field_object('fat_select'));
  133. $fat_value = get_sub_field('fat_select');
  134. $fat_label = ($fat_object['choices'][$fat_value]);
  135.  
  136. $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
  137. $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
  138.  
  139. if ($feeds_per_day > 5){
  140.  
  141. ?><tr><td>Meal 6</td><td><?php echo $protein_amount ?>g <?php echo $protein_label ?>, <?php echo $fat_amount ?>g <?php echo $fat_label ?></td></tr><?php } }
  142.  
  143. }
  144.  
  145.  
  146. endwhile;
  147.  
  148. ?></table></div><?php
  149. endif;
  150.  
  151. $mcount = 0;
  152. while( have_rows('zero') ) : the_row(); $mcount++;?>
  153.  
  154. <tr><td>Upon Waking</td><td><?php the_sub_field('upon_waking')?></td></tr>
  155.  
  156. <?php
  157. if ( have_rows('meal_'.$mcount) ){
  158. while( have_rows('meal_'.$mcount) ) {
  159. the_row();
  160.  
  161. $protein_object = (get_sub_field_object('protein_select'));
  162. $protein_value = get_sub_field('protein_select');
  163. $protein_label = ($protein_object['choices'][$protein_value]);
  164.  
  165. $carb_object = (get_sub_field_object('carb_select'));
  166. $carb_value = get_sub_field('carb_select');
  167. $carb_label = ($carb_object['choices'][$carb_value]);
  168.  
  169. $fat_object = (get_sub_field_object('fat_select'));
  170. $fat_value = get_sub_field('fat_select');
  171. $fat_label = ($fat_object['choices'][$fat_value]);
  172.  
  173. $protein_amount = round($zero_protein_feed / $protein_value * 10) *10;
  174. $fat_amount = round($zero_fat_feed / $fat_value * 10) *10 ;
  175.  
  176. ?><tr><td>Meal <?php echo$mcount; ?></td><td><?php echo $protein_amount ?>g <?php echo $protein_label ?>, <?php echo $fat_amount ?>g <?php echo $fat_label ?></td></tr><?php } } ?>`
Add Comment
Please, Sign In to add comment