Fitness Challenge Save

[insert_php]
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/db.php”;

require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/model/AgeRange.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/model/Student.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/model/Exercise.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/model/FitnessChallenge.php”;

require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/service/StudentService.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/service/StudentDateService.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/service/ExerciseService.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/service/PerformedExerciseService.php”;

$studentDateService= new StudentDateService();
$performedExerciseService = new PerformedExerciseService();

$exerciseService = new ExerciseService();
$exercises = $exerciseService->getExerciseList();
$exerciseCount = count($exercises);

$fitnessChallenge = new FitnessChallenge();
$ageRangeCount = count($fitnessChallenge->ageRangeArr);

echo “

January 2016

\n”;

echo “

\n”;
echo “

\n”;
echo ”

\n”;
echo ”

\n”;
echo ”

\n”;

for ($i=0; $i < $exerciseCount; $i++) { $currExercise = $exercises[$i]; echo "

\n”;
}
echo ”

\n”;
echo ”

\n”;
echo ”

\n”;

for ($ageRangeIdx = 0; $ageRangeIdx < $ageRangeCount; $ageRangeIdx++) { $currAgeRange = $fitnessChallenge->ageRangeArr[$ageRangeIdx];

$maxExerciseArr = array();
for ($exIdx=0; $exIdx < $exerciseCount; $exIdx++) { $currExercise = $exercises[$exIdx]; $currExerciseCode = $currExercise->getCode();

$maxExerciseArr[$currExerciseCode] = 0;
}

$arc = $studentDateService->getAgeRangeCount($currAgeRange->getMinAge(), $currAgeRange->getMaxAge());
//echo $currAgeRange->getDesc() . “, count = ” . $arc . “
“;

$studentDateArr = $studentDateService->getAgeRangeRecArr($currAgeRange->getMinAge(), $currAgeRange->getMaxAge());
$studentDateCount = count($studentDateArr);

// set max values
$maxExerciseArr = $studentDateService->setMaxExerciseValues($studentDateArr, $maxExerciseArr);

$colspanCount = $exerciseCount + 1;
$ageLineEntry = “Ages ” . $currAgeRange->getDesc();

if ($studentDateCount == 0)
{
$ageLineEntry .= ” : No Entries Found.”;
}

echo “

\n”;
echo ”

\n”;
echo “

\n”;

if ($studentDateCount > 0)
{
for ($i=0; $i < $studentDateCount; $i++) { $currStudentDateRec = $studentDateArr[$i]; echo "

\n”;
echo ”

\n”;

$performedExercises = $performedExerciseService->getPerformedExerciseList($currStudentDateRec->getId());
$performedExercisesCount = count($performedExercises);

// —–
for ($exIdx=0; $exIdx < $exerciseCount; $exIdx++) { $currExercise = $exercises[$exIdx]; $currExerciseCode = $currExercise->getCode();

$currExerciseCount = 0;

$maxClassEntry = ” “;

for ($perfExIdx = 0; $perfExIdx < $performedExercisesCount; $perfExIdx++) { $currperformedExercise = $performedExercises[$perfExIdx]; if ($currperformedExercise->getExerciseCode() == $currExerciseCode)
{
$currExerciseCount = $currperformedExercise->getNum();

if ($currExerciseCount == $maxExerciseArr[$currExerciseCode])
{
$maxClassEntry = ” maxEntry”;
}
}
}

//$countEntry = ” “;
$countEntry = “-“;
if ($currExerciseCount > 0)
{
$countEntry = $currExerciseCount;
}

echo ”

\n”;
}
// —–

echo “

\n”;
}
}
}
echo ”

\n”;
echo “

Name / Date ” . $currExercise->getDesc() . “
” . $ageLineEntry . “
” . $currStudentDateRec->getFullName() . ” (” . $currStudentDateRec->getDate() .”) ” . $countEntry . “

\n”;
echo “

\n”;

echo “DB\n”;

[/insert_php]

Top