WLC Results Source Code
This source code uses forms to get data from the database.
[code lang="PHP"] No week selected"; } echo "Standings Sorted by Week: " . $week . "!
The percentages are determined by the formula (weekXweight - startWeight)/startWeight
Name | Wk 1 | Wk 2 | //This pattern continues for 10 weeks...
---|---|---|
" . $row['name'] . " | "; echo "" . $row['pt01'] . "% | "; echo "" . $row['pt02'] . "% | "; //This pattern continues for 10 weeks... echo "
You selected Person #: " . $person . " - " . $namerow[$person] . "
"; echo"Name | Wk 1 | Wk 2 | Wk 3 | Wk 4 | Wk 5 | Wk 6 | Wk 7 | Wk 8 | Wk 9 | Wk 10 |
---|---|---|---|---|---|---|---|---|---|---|
" . $namerow[$person] . " | " . $pct1row[$person] . "% | " . $pct2row[$person] . "% | //This pattern continues for 10 weeks...
Please select a person to view the results
"; } } elseif($type == "history") { //Show a table with all percentages per week //$result = mysql_query("SELECT * FROM wlc_spring"); echo "Full History of the Competition
Name | Wk 1 | Wk 2 | //This pattern continues for 10 weeks...
---|---|---|
" . $namerow[$x] . " | " . $pct1row[$x] . "% | " . $pct2row[$x] . "% | //This pattern continues for 10 weeks...
Check More Results?
"; } echo "Make a selection below to view results for the Weight Loss Challenge
Weight Loss Standings
Who is leading the pack on any given week?
Choose a week that you would like to see.
Personal History
Select your own or any other participant's personal history
Competition History
See how everyone has been doing weekly
"; //mysql_close($con); /* echo "Posting array:
"; foreach ($_POST as $p => $v) { echo "The POST value at '$p' is '$v'"; } echo "
Get array:
"; foreach ($_GET as $p => $v) { echo "The GET value at '$p' is '$v'"; } */ echo "
"; include("wlcDbClose.php"); ?> [/code]