
{include file="layouts/forceLoggedIn.tpl"}
{include_php file="shared_handle:myHome"}
{include_php file="shared_handle:getProfile"}
{assign var="pgLayout" value="layouts/withLeftNav.tpl"}
<h1>{$page.title} - {$userProfile.firstName} {$userProfile.lastName} ({$userProfile.username})</h1>

{select_query return="row" assign="aHRA"}
	dateTaken, pointsEarned FROM surveys_taken
		WHERE userId = {$user->id}
		AND surveyId = 8
		ORDER BY dateTaken DESC
		LIMIT 1
{/select_query}

<table width="700">
<tr><td width="205" valign="top">
	<div id="UserProfileColumn" class="contentColumn">
	<h2 class="withBG">Your Profile</h2>
		<span class="cellHeadLarge">Age:</span><span class="cellSmall">{$userProfile.age|default:"-"}</span><br />
		<span class="cellHeadLarge">Height:</span><span class="cellSmall">{$userProfile.heightFeet|default:"-"}'{$userProfile.heightInches|default:"-"}&quot;</span><br />
		<span class="cellHeadLarge">Start BMI:</span><span class="cellSmall">{$userProfile.startBMI|default:"-"}</span><br />
		<span class="cellHeadLarge">Start Weight:</span><span class="cellSmall">{$userProfile.initialWeight|default:"-"}</span><br /><span class="cellHeadLarge">Goal Weight:</span><span class="cellSmall">{$userProfile.goalWeight|default:"-"}</span><br />
		<span class="cellHeadLarge">Current Weight:</span><span class="cellSmall">{$userProfile.currentWeight|default:"-"}</span><br />
		<span class="cellHeadLarge">HRA Score:</span><span class="cellSmall">{$aHRA.pointsEarned|default:"-"}</span><br />

		<a href="?pg=my_profile" class="link"><img src="{$skinFolder}images/btn_profile.gif" border="0" alt="Update Profile" vspace="10" /></a><br />
		<a href="?pg=my_settings" class="link"><img src="{$skinFolder}images/btn_settings.gif" border="0" alt="Account Settings" vspace="0" /></a>
	</div>
</td><td valign="top" align="center">
	<div id="graphContainer">
	<iframe name="graphwindow" src="?pg=flashgraph-frame&compId={$compData.id}&format=small{* &type=weight&fillPrevious=1&precision=1&totalChange=0&userIds={$userProfile.id} *}" frameborder="0" width="425" height="230" scrollbars="no"></iframe></div>
	<small>
		<a href="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1&totalChange=1" target="graphwindow">Change in Weight</a> |
		<a href="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1" target="graphwindow">Weight</a> |
		<a href="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=fat&fillPrevious=0&precision=1" target="graphwindow">Fat Intake</a> |
		<a href="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=calories&fillPrevious=0&precision=1" target="graphwindow">Calorie Intake</a> |
		<a href="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=carbs&fillPrevious=0&precision=1" target="graphwindow">Carb Intake</a><br />
		<a href="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=water&fillPrevious=0&precision=1" target="graphwindow">Water Intake</a> |
		<a href="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=minutesExercise&fillPrevious=0&precision=1" target="graphwindow">Exercise Min</a> |
		<a href="?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=distanceExercised&fillPrevious=0&precision=1" target="graphwindow">Distance Exercised</a>
	</small>
</td></tr>
<tr><td colspan="2">
<div id="statsContainer">
	<a name="updateStats"></a>
	<iframe name="profileUpdateFrame" src="?pg=myprofile/update&userId={$smarty.request.userId|default:$userProfile.id}" frameborder="0" width="700" height="440" scrollbars="no"></iframe>
</div>
<blockquote>
<dl>
	<dt>Motto:</dt>
	<dd>{$userProfile.personalSaying|default:"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal"}</dd>
	<dt>Nutrition Goal:</dt>
	<dd>{$userProfile.nutritionGoal|default:"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal"}</dd>
	<dt>Fitness Goal:</dt>
	<dd>{$userProfile.fitnessGoal|default:"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal"}</dd>
	<dt>Lifestyle Goal:</dt>
	<dd>{$userProfile.lifestyleGoal|default:"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal"}</dd>
</dl>
</blockquote>
</td></tr>
</table>