{* getProfile is included by getStats *}
{include_php file="shared_handle:getStats"}

<h1 class="underline">My Statistics - {$userProfile.firstName} {$userProfile.lastName} ({$userProfile.username})</h1>
<br />
{assign var="hideWidgets" value="true"}

<script language="javascript">{literal}
function goNewGraph() {
	var obj = document.getElementById('graphDropdown');
	var url;

	for (var x = 0; x < obj.options.length; x++) {
		if (obj.options[x].selected)
			url = obj.options[x].value;
	}

	graphwindow.location.replace(url);

	obj.selectedIndex = 0;
}{/literal}
</script>

<table border="0">
<tr>
	<td valign="middle">
		<div id="UserProfileColumn" class="contentColumn">
			<h2 class="withBG">Your Profile</h2>
			<span class="cellHeadLarge">Age:</span><span class="cellSmall">{$userProfile.age}</span><br />
			<span class="cellHeadLarge">Start Weight:</span><span class="cellSmall">{$userProfile.initialWeight}</span><br />
			<span class="cellHeadLarge">Height:</span><span class="cellSmall">{$userProfile.heightFeet}'{$userProfile.heightInches}&quot;</span><br />
			<span class="cellHeadLarge">Start BMI:</span><span class="cellSmall">{$userProfile.startBMI}</span><br />
			<span class="cellHeadLarge">Goal Weight:</span><span class="cellSmall">{$userProfile.goalWeight}</span><br />
		</div>
	</td>
	<td align="center">
		<iframe name="graphwindow" src="?pg=flashgraph-frame&compId={$compData.id}&format=small&type=weight&fillPrevious=1&precision=0&totalChange=0&userIds={$userProfile.id}" frameborder="0" width="425" height="220" scrollbars="no"></iframe><br />
		<form name="notUsed" style="margin:0px;">
		<select id="graphDropdown" onchange="goNewGraph();">
			<option value="">(Change Graph)</option>
			<option value="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=0&totalChange=1">Change in Weight</option>
			<option value="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=0" target="graphwindow">Weight</option>
			<option value="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=fat&fillPrevious=0&precision=1" target="graphwindow">Fat Intake</option>
			<option value="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=calories&fillPrevious=0&precision=1" target="graphwindow">Calorie Intake</option>
			<option value="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=carbs&fillPrevious=0&precision=1" target="graphwindow">Carb Intake</option>
			<option value="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=minutesExercise&fillPrevious=0&precision=1" target="graphwindow">Exercise</option>
			<option value="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=distanceExercised&fillPrevious=0&precision=1" target="graphwindow">Distance Exercised</option>
		</select>
		</form>
	<td valign="middle" align="center">
		<h2 style="text-align:center;"><i>"{$userProfile.personalSaying|default:"Your personal motto goes here."|replace:'"':''}"</i></h2>
	</td>
</tr>
</table>
<br />

<h2 class="withBG">Weekly Overview and Updates</h2>
<div>This is your Weight Loss Journal. To update your stats for the day or week, click on the appropriate week (column heading) below and a new window will open for you to enter your daily data.</div><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td valign="top" align="right">
	<div style="text-align:right;width:120px;height:39px;border-right:#000 1px solid;border-bottom:#000 1px solid;">Click&nbsp;to&nbsp;Update&nbsp;-&gt;&nbsp;</div>
	<div style="text-align:right;width:120px;height:29px;border-right:1px solid black;border-bottom:1px solid black;"><b>Weight</b>&nbsp;</div>
	<div style="text-align:right;width:120px;height:29px;border-right:1px solid black;border-bottom:1px solid black;"><b>Weight&nbsp;Lost</b>&nbsp;</div>
	<div style="text-align:right;width:120px;height:29px;border-right:1px solid black;border-bottom:1px solid black;"><b>BMI</b>&nbsp;</div>
	<div style="text-align:right;width:120px;height:29px;border-right:1px solid black;border-bottom:1px solid black;"><b>Calories</b>&nbsp;</div>
	<div style="text-align:right;width:120px;height:29px;border-right:1px solid black;border-bottom:1px solid black;"><b>Carbs</b>&nbsp;</div>
	<div style="text-align:right;width:120px;height:29px;border-right:1px solid black;border-bottom:1px solid black;"><b>Fat</b>&nbsp;</div>
	<div style="text-align:right;width:120px;height:29px;border-right:1px solid black;border-bottom:1px solid black;"><b>Minutes Exercise</b>&nbsp;</div>
	<div style="text-align:right;width:120px;height:29px;border-right:1px solid black;border-bottom:1px solid black;"><b>Distance&nbsp;Exercised</b>&nbsp;</div>
	</td>
	<td valign="top" align="left">
	<div style="width:569px;text-align:left;"><iframe src="?pg=myprofile/statsframe&cid={$smarty.get.cid}&userId={$userProfile.id}#recent" frameborder="0" width="569" height="302" scrollbars="auto"></iframe></div></td>
</tr>
</table>
<br />
(Note: The daily weight loss journal opens up in a new window so if you have a popup blocker you may need to disable it. &nbsp; Once you are finished and have returned to this page, you will need to click your browsers refresh button in order to see these values updated.)

<br />
<div class="hBox" style="text-align:right;">
	<a href="?pg=myhome" class="link">Back To My Home</a>
</div>




