{assign var="pgLayout" value="none"}{include_php file="shared_handle:getStats"}<html>
<head>
	<link rel="stylesheet" href="{$skinFolder}/styles/base.css" />
	<style>
	.verticalText {ldelim}
		writing-mode: tb-rl;
		filter: flipv fliph;
	{rdelim}
	.tch {ldelim}
		height:40px;
		border-right:1px solid black;
		border-bottom:1px solid black;
		background-color:#EEE;
	{rdelim}
	.tc {ldelim}
		height:30px;
		border-right:1px dashed #CCC;
		border-bottom:1px dashed #CCC;
		background-color:#FFF;
		text-align:center;
	{rdelim}
	</style>

<script language="javascript">{literal}
function xWindow(name, w, h, x, y, loc, men, res, scr, sta, too)
{
  var f = '';
  if (w && h) {
    if (document.layers) f = 'screenX=' + x + ',screenY=' + y;
    else f = 'left=' + x + ',top=' + y;
    f += ',width=' + w + ',height=' + h + ',';
  }
  f += ('location='+loc+',menubar='+men+',resizable='+res
    +',scrollbars='+scr+',status='+sta+',toolbar='+too);
  this.features = f;
  this.name = name;
  this.load = function(sUrl) {
    if (this.wnd && !this.wnd.closed) this.wnd.location.href = sUrl;
    else this.wnd = window.open(sUrl, this.name, this.features);
    this.wnd.focus();
    return false;
  }
}
winUpdater = new xWindow('updateWindow', 600, 400, 100, 100, 'yes', 'no', 'no', 'yes', 'yes', 'no');
{/literal}</script>

</head>
<body style="margin:0px;background-image:none;">
{* display var=$userStats *}
{* display var=$compData *}
<table width="100%" height="280" border="0" cellpadding="0" cellspacing="0" align="left">
<tr>
	{if $user->id eq $userProfile.id OR $acm->isDomainAdmin()}
		{foreach name="headingLoop" from=$userStats.weeks item="week" key="num"}
		<td height="40" nowrap="nowrap" align="center" class="tch"><div class="">&nbsp;<a href="javascript://" onclick="winUpdater.load('?pg=myprofile/update&start={$week.weekOfTimestamp}&userId={$userProfile.id}');return false;"><em>Week {$num}</em></a>&nbsp;<br /><small>{$week.weekOf}&nbsp;</small></div></td>
		{/foreach}
	{else}
		{foreach name="headingLoop" from=$userStats.weeks item="week" key="num"}
		<td height="40" nowrap="nowrap" align="center" class="tch"><div class=""><small>&nbsp;<b>Week {$num}</b>&nbsp;<br />{$week.weekOf}&nbsp;</small></div></td>
		{/foreach}
	{/if}
</tr>
<tr>
	{foreach from=$userStats.weeks item="week"}
	<td height="30" valign="middle" align="right" class="tc"><div>{$week.weight}</div></td>
	{/foreach}
</tr>
<tr>
	{foreach from=$userStats.weeks item="week"}
	<td height="30" valign="middle" align="right" class="tc"><div>{$week.totalLost|default:"0"}</div></td>
	{/foreach}
</tr>
<tr>
	{foreach from=$userStats.weeks item="week"}
	<td height="30" valign="middle" align="right" class="tc"><div>{$week.bmi|default:"0"}</div></td>
	{/foreach}
</tr>
<tr>
	{foreach from=$userStats.weeks item="week"}
	<td height="30" valign="middle" align="right" class="tc"><div>{$week.calories|default:"0"}</div></td>
	{/foreach}
</tr>
<tr>
	{foreach from=$userStats.weeks item="week"}
	<td height="30" valign="middle" align="right" class="tc"><div>{$week.carbs|default:"0"}</div></td>
	{/foreach}
</tr>
<tr>
	{foreach from=$userStats.weeks item="week"}
	<td height="30" valign="middle" align="right" class="tc"><div>{$week.fat|default:"0"}</div></td>
	{/foreach}
</tr>
<tr>
	{foreach from=$userStats.weeks item="week"}
	<td height="30" valign="middle" align="right" class="tc"><div>{$week.minutesExercise|default:"0"}</div></td>
	{/foreach}
</tr>
<tr>
	{foreach from=$userStats.weeks item="week"}
	<td height="30" valign="middle" align="right" class="tc"><div>{$week.distanceExercised|default:"0"}</div></td>
	{/foreach}
</tr>
</table><a name="recent"></a>
</body>
</html>
