Example #1
0
function max_weight_for_exercise_h($userID, $exerciseID)
{
    $CI =& get_instance();
    //get the last date done
    $CI->db->select('*');
    $CI->db->select_max('weight');
    $CI->db->from('sets');
    $CI->db->where('exercises_id
			', $exerciseID);
    $CI->db->where('users_id
			', $userID);
    //don't want the date to be the current one
    // $CI->db->where('date <', 'NOW()');
    $set = $CI->db->get()->row();
    $weight = $set->weight;
    $reps = $set->reps;
    $rest = $set->rest;
    //if there isn't a value
    if (!$weight) {
        echo "Not enough data";
        return;
    }
    //end if
    format_weight_reps_rest_h($weight, $reps, $rest);
}
Example #2
0
        ?>
									<?php 
        foreach (previous_exercise_sets_h($userID, $exercise->id, $workout_log_id) as $set) {
            ?>
					                	<li class="centered <?php 
            exercise_difficulty_h($set->difficulty);
            ?>
"  data-set-id="<?php 
            echo $set->id;
            ?>
" data-exercise-id="<?php 
            echo $exercise->id;
            ?>
" >
					                		<?php 
            format_weight_reps_rest_h($set->weight, $set->reps, $set->rest);
            ?>
					                		<a class="delete-set-btn" href="#" data-reveal-id="delete-set-modal">
					                			<span class='delete-set'><i class='fa fa-times'></i></span>
					                		</a>
					                		<!-- edit functionality -->
					                		<!-- <a href="#" data-reveal-id="edit-set-modal"><span class='edit-set'><i class='fa fa-pencil-square'></i></span></a> -->
					                	</li>
					            	<?php 
        }
        ?>
					            <?php 
    }
    ?>
				            </ul>
						</div>