Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( have_rows('zero') ):
- ?><div class="grid-50" style="float: left;"><table><tr><th colspan="2">Zero</th></tr><?php
- while( have_rows('zero') ) : the_row(); ?>
- <tr><td>Upon Waking</td><td><?php the_sub_field('upon_waking')?></td></tr>
- <?php
- if ( have_rows('meal_1') ){
- while( have_rows('meal_1') ) {
- the_row();
- $protein_object = (get_sub_field_object('protein_select'));
- $protein_value = get_sub_field('protein_select');
- $protein_label = ($protein_object['choices'][$protein_value]);
- $carb_object = (get_sub_field_object('carb_select'));
- $carb_value = get_sub_field('carb_select');
- $carb_label = ($carb_object['choices'][$carb_value]);
- $fat_object = (get_sub_field_object('fat_select'));
- $fat_value = get_sub_field('fat_select');
- $fat_label = ($fat_object['choices'][$fat_value]);
- $protein_amount = round($zero_protein_feed / $protein_value * 10) *10;
- $fat_amount = round($zero_fat_feed / $fat_value * 10) *10 ;
- ?><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 } }
- if ( have_rows('meal_2') ){
- while( have_rows('meal_2') ) {
- the_row();
- $protein_object = (get_sub_field_object('protein_select'));
- $protein_value = get_sub_field('protein_select');
- $protein_label = ($protein_object['choices'][$protein_value]);
- $carb_object = (get_sub_field_object('carb_select'));
- $carb_value = get_sub_field('carb_select');
- $carb_label = ($carb_object['choices'][$carb_value]);
- $fat_object = (get_sub_field_object('fat_select'));
- $fat_value = get_sub_field('fat_select');
- $fat_label = ($fat_object['choices'][$fat_value]);
- $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
- $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
- ?><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 } }
- if ( have_rows('meal_3') ){
- while( have_rows('meal_3') ) {
- the_row();
- $protein_object = (get_sub_field_object('protein_select'));
- $protein_value = get_sub_field('protein_select');
- $protein_label = ($protein_object['choices'][$protein_value]);
- $carb_object = (get_sub_field_object('carb_select'));
- $carb_value = get_sub_field('carb_select');
- $carb_label = ($carb_object['choices'][$carb_value]);
- $fat_object = (get_sub_field_object('fat_select'));
- $fat_value = get_sub_field('fat_select');
- $fat_label = ($fat_object['choices'][$fat_value]);
- $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
- $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
- ?><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 } }
- if ( have_rows('meal_4') ){
- while( have_rows('meal_4') ) {
- the_row();
- $protein_object = (get_sub_field_object('protein_select'));
- $protein_value = get_sub_field('protein_select');
- $protein_label = ($protein_object['choices'][$protein_value]);
- $carb_object = (get_sub_field_object('carb_select'));
- $carb_value = get_sub_field('carb_select');
- $carb_label = ($carb_object['choices'][$carb_value]);
- $fat_object = (get_sub_field_object('fat_select'));
- $fat_value = get_sub_field('fat_select');
- $fat_label = ($fat_object['choices'][$fat_value]);
- $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
- $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
- ?><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 } }
- if ( have_rows('meal_5') ){
- while( have_rows('meal_5') ) {
- the_row();
- $protein_object = (get_sub_field_object('protein_select'));
- $protein_value = get_sub_field('protein_select');
- $protein_label = ($protein_object['choices'][$protein_value]);
- $carb_object = (get_sub_field_object('carb_select'));
- $carb_value = get_sub_field('carb_select');
- $carb_label = ($carb_object['choices'][$carb_value]);
- $fat_object = (get_sub_field_object('fat_select'));
- $fat_value = get_sub_field('fat_select');
- $fat_label = ($fat_object['choices'][$fat_value]);
- $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
- $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
- if ($feeds_per_day > 4){
- ?><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 } }
- }
- if ( have_rows('meal_6') ){
- while( have_rows('meal_6') ) {
- the_row();
- $protein_object = (get_sub_field_object('protein_select'));
- $protein_value = get_sub_field('protein_select');
- $protein_label = ($protein_object['choices'][$protein_value]);
- $carb_object = (get_sub_field_object('carb_select'));
- $carb_value = get_sub_field('carb_select');
- $carb_label = ($carb_object['choices'][$carb_value]);
- $fat_object = (get_sub_field_object('fat_select'));
- $fat_value = get_sub_field('fat_select');
- $fat_label = ($fat_object['choices'][$fat_value]);
- $protein_amount = round($zero_protein_feed / $protein_value * 10) * 10 ;
- $fat_amount = round($zero_fat_feed / $fat_value * 10) * 10 ;
- if ($feeds_per_day > 5){
- ?><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 } }
- }
- endwhile;
- ?></table></div><?php
- endif;
- $mcount = 0;
- while( have_rows('zero') ) : the_row(); $mcount++;?>
- <tr><td>Upon Waking</td><td><?php the_sub_field('upon_waking')?></td></tr>
- <?php
- if ( have_rows('meal_'.$mcount) ){
- while( have_rows('meal_'.$mcount) ) {
- the_row();
- $protein_object = (get_sub_field_object('protein_select'));
- $protein_value = get_sub_field('protein_select');
- $protein_label = ($protein_object['choices'][$protein_value]);
- $carb_object = (get_sub_field_object('carb_select'));
- $carb_value = get_sub_field('carb_select');
- $carb_label = ($carb_object['choices'][$carb_value]);
- $fat_object = (get_sub_field_object('fat_select'));
- $fat_value = get_sub_field('fat_select');
- $fat_label = ($fat_object['choices'][$fat_value]);
- $protein_amount = round($zero_protein_feed / $protein_value * 10) *10;
- $fat_amount = round($zero_fat_feed / $fat_value * 10) *10 ;
- ?><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