# Need a simple script for personal diet plan

A simple site where myself and other family members can keep track of our weight loss. We are doing a contest like the &quot;Biggest Loser&quot; contest seen on American TV. No one wants to tell anyone else their weight, so we are basing the contest on 2 other factors: 1) percentage of loss, calculated weekly; and 2) number of bottles of water per day, calculated daily.

Basically the user (me) with go to a web page and select my name (and enter a password to validate that it is me) - doesn't need to be real secure, and we can use htaccess if needed. On a daily basis I need to report how many bottles of water I am drinking with the goal of 4 per day. This might be done simply with check boxes, or another creative way if you have something in mind. Then once a week on Mondays, I need to report my weight online. This will generate a percentage of gain or loss based on last weeks reported weight. If the percentage is positive, tha

Example:

--

A) Initial Account Setup:

Enter Current Weight: 165

Enter Goal Weight: 145

--

Auto generate and log date: 12/12/08

Enter Name: Jay

Enter bottles of water:

X Bottle 1

X Bottle 2

X Bottle 3

_ Bottle 4

Enter Weight: 164 (must be entered each Monday)

--

C) Calculations/formula for weekly report:

Pull in from log:name,previous_weight,current_weight

Percentage = (current_weight - previous_weight);

if current_weight &gt; previous_weight

then echo &quot;You gained &quot;. \$Percentage.&quot;% last week.&quot;

else

echo &quot;You lost &quot;. \$JayPercentage . &quot;% last week.&quot;;

Need a formula too, to calculate the bottles of water drank each day. For each bottle less than 4 per day not drunk, the user owes 25 cents to the prize pool. This should be calculated each week to determine how much the person owes each week. If they gain weight for the week, they owe \$5 to the prize tally.

The overall report page will be generated each week and show each users number of bottles for each day and how much owed, and their weight percentage and how much owed. It will not show their weights. And anyone in the group can view the report. The report will also have a running total of the prize.

If you can do a simple line chart too, that would be cool. ([url removed, login to view])