require_once($_SERVER['DOCUMENT_ROOT']."/awards/emmys/awards.inc");
require_once($_SERVER['DOCUMENT_ROOT']."/awards/include/makepicks.inc");
class page {
public $base = null;
public $visual = null;
function page()
{
$this->base = new awards();
$this->base->title .= " - Make Picks";
if (!$this->base->isMobile) $this->visual = new visual_desktop($this->base);
else $this->visual = new visual_mobile($this->base);
$this->visual->Header($this->base->user->logged_in);
$this->base->awardBar();
$this->content();
$this->visual->Footer();
}
function content()
{
?>
" style="padding-bottom:6px;">
if (!$this->base->user->logged_in && !$GLOBALS['isMobile'])
{
?>
if ($this->base->user->fb_logged_in)
{
$fb_user = $this->base->user->facebook->getUser();
if ($fb_user)
{
try
{
$user_profile = $this->base->user->facebook->api('/me');
$name = $user_profile['name'];
}
catch (FacebookApiException $e)
{
$fb_user = null;
}
}
register_form($this->base->user->fb_id, "", $name);
}
else
{
register_form($this->base->user->fb_id);
}
?>
}
$sql = "SELECT categoryid, categoryname FROM awards_categories WHERE awardsid = ".$GLOBALS['awards-emmys_id'];
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result))
{
$categories[$row['categoryid']] = $row['categoryname'];
}
$sql = "SELECT categoryid, nomineeid, nomineename FROM awards_nominees WHERE awardsid = ".$GLOBALS['awards-emmys_id']." ORDER BY categoryid, nomineeid";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result))
{
$nominees[$row['categoryid']][$row['nomineeid']] = $row['nomineename'];
}
if ($this->base->user->logged_in)
{
$sql = "SELECT categoryid, pick FROM awards_picks WHERE awardsid = ".$GLOBALS['awards-emmys_id']." AND groupid = 0 AND userid = ".$this->base->user->id;
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result))
{
$picks[$row['categoryid']] = $row['pick'];
}
}
if ($this->base->teamgroup->isTeam)
{
$sql = "SELECT categoryid, points FROM awards_groups_catpoints WHERE awardsid = ".$GLOBALS['awards-emmys_id']." AND teamid = ".$this->base->teamgroup->teamId." AND groupid = 0";
$result = mysql_query($sql);
}
else if ($this->base->teamgroup->isGroup)
{
$sql = "SELECT categoryid, points FROM awards_groups_catpoints WHERE awardsid = ".$GLOBALS['awards-emmys_id']." AND teamid = 0 AND groupid = ".$this->base->teamgroup->groupId;
$result = mysql_query($sql);
}
if (!mysql_num_rows($result) || $this->base->teamgroup->isICH)
{
$sql = "SELECT categoryid, points FROM awards_groups_catpoints WHERE awardsid = ".$GLOBALS['awards-emmys_id']." AND teamid = 0 AND groupid = 0";
$result = mysql_query($sql);
}
while ($row = mysql_fetch_assoc($result))
{
$points[$row['categoryid']] = $row['points'];
}
?>
$this->base->teamgroup->Header($this->base->user->id);
?>
Make Emmy Picks
$formaction = $this->base->url_awards."makepicks_process.php?awardsid=".$GLOBALS['awards-emmys_id'];
if ($this->base->teamgroup->isTeam)
{
$formaction .= "&teamtag=".$this->base->teamgroup->teamTag;
}
else if ($this->base->teamgroup->isGroup)
{
$formaction .= "&groupid=".$this->base->teamgroup->groupId;
}
?>
">
Notes:
- You only need to make one set of picks. Picks will be used for all the groups you have joined.
- Some awards may be given out prior to the telecast. Those categories will be removed from scoring.
}
}
new page();
?>