getRow("SELECT * FROM session WHERE id = $session_id"); $session_is_active = (time() < (strtotime($row["weight_entry_end"]) + 60*60*24) ); if($session_is_active){ $email = form_any("email"); $competitor_id = form_table($db, "competitor", "id", "competitor_id"); if(form_isset("submitted")){ if($competitor_id){ $competitor = $db->getRow("SELECT * FROM competitor WHERE id = ".$db->quoteSql($competitor_id)); if(strtolower($competitor["email"]) == strtolower($email)){ util_addWeeks($session_id, $competitor_id); $weights = $db->getAllRows("SELECT * FROM session_weight WHERE session_id = $session_id AND competitor_id = $competitor_id ORDER BY start_date"); if(form_isset("weights-submitted")){ foreach($weights as $i => $row){ $weight = form_any("weight_".$row["id"]); $direction = form_array(array("gained", "lost", "nochange"), "direction_".$row["id"]); $weights[$i]["comments"] = form_any("comments_".$row["id"]); $weights[$i]["weight"] = $weight; $weights[$i]["direction"] = $direction; if($direction == 'nochange' || $direction == 'No Change') { $weights[$i]["weight"] = 0; if(!$errors["direction_".$row["id"]] && $direction){ util_data_insertOrUpdate($weights[$i], "session_weight", "id", $row["id"]); } } else { if(!$direction && $weight){ $errors["direction_".$row["id"]] = "Required"; } if($weight && !is_numeric($weight) || $weight < 0){ $errors["weight_".$row["id"]] = "Invalid value"; } if(!$errors["direction_".$row["id"]] && $weight && $direction){ util_data_insertOrUpdate($weights[$i], "session_weight", "id", $row["id"]); } } } if(!$errors){ $saved = true; } } }else{ $error = true; } }else{ $error = true; } } } ?>

Sorry weight loss entry for this session is no longer available.


Your updates have been saved.

Week ending Gained Lost No Change Pounds Comments
/> /> /> " name="weight_" class="form-control">

Invalid company & email