Esempio n. 1
0
     }
     break;
 case 'fetchRewards':
     if (isset($_GET['sort'])) {
         $sort = $_GET['sort'];
     } else {
         $sort = 'default';
     }
     if (isset($_GET['filter'])) {
         $filter = $_GET['filter'];
     } else {
         $filter = 'redeemable';
     }
     require_once PATH_CORE . "/classes/prizes.class.php";
     $rwObj = new rewards();
     $code = $rwObj->fetchRewards($sort, $filter, $currentPage, true, $session->u->eligibility);
     break;
 case 'fetchRewardsPage':
     if (isset($_GET['sort'])) {
         $sort = $_GET['sort'];
     } else {
         $sort = 'default';
     }
     require_once PATH_CORE . "/classes/prizes.class.php";
     $rwObj = new rewards();
     $code = $rwObj->fetchRewardsPage($sort, $currentPage, true, '', $session->u->eligibility);
     break;
 case 'fetchWinners':
     require_once PATH_CORE . "/classes/prizes.class.php";
     $rwObj = new rewards();
     $code = $rwObj->fetchWinners('', $currentPage);
 function fetchSummaryPage($textOnly = false)
 {
     require_once PATH_CORE . '/classes/prizes.class.php';
     $rewards = new rewards($this->db);
     if (!$textOnly) {
         $currentPage = 1;
         $inside .= '<h1>Summary of ' . SITE_TITLE . ' ' . SITE_TEAM_TITLE . ' Rewards</h1>';
         $inside .= '<a name="ingroup" />';
         /* REDEEM: $inside.='<h1>Rewards available to in-group members</h1> 
         					<a href="#outgroup">See rewards available to out-group members</a>';
         		
         			$inside.='<h5>Redeemable with Earned Points</h5><p>Eligible action team members can redeem their points for these rewards. Points turned in for prizes are not subtracted from your totals for weekly, grand and runners-up prizes.</p>';		
         			$inside.=$rewards->fetchRewards('pointCost','redeemable', $currentPage,true, 
         												'team');
         			*/
         /* REDEEM:
         			$inside.='<h5>Weekly Rewards</h5><p>These will be given to the top eligible participants for a specified week during the life of the Action Team period.</p>';													
         			$inside.=$rewards->fetchRewards('pointCost','weekly', $currentPage,true, 
         												'team');
         			*/
         $inside .= '<h5>Weekly Rewards</h5>' . '<p>These will be given to the top eligible participants for a specified week during the life of the ' . SITE_TEAM_TITLE . ' contest.';
         'The top scorer(s) will receive the first reward on the left; next-highest scoring members receive the next reward, etc.</p>';
         $inside .= $this->fetchWeeklyPrizeSchedule();
         $inside .= '<h5>Grand and Runners-up Rewards</h5><p>These will be awarded to the top eligible participants at the end of the ' . SITE_TEAM_TITLE . ' contest.</p>';
         $inside .= $rewards->fetchRewards('dollarValue', 'grand', $currentPage, true, 'team');
         /* REDEEM:
         			$inside.='<a name="outgroup" />';
         			$inside.='<h1>Rewards available to out-group members</h1>
         				<a href="#ingroup">See rewards available to in-group members</a>';
         			
         			$inside.='<h2>Redeemable</h2>';		
         			$inside.=$rewards->fetchRewards('pointCost','redeemable', $currentPage,true, 
         												'general');
         				
         			$inside.='<h2>Weekly</h2>';													
         			$inside.=$rewards->fetchRewards('pointCost','weekly', $currentPage,true, 
         												'general');
         												
         			$inside.='<h2>Grand and Runner-up</h2>';													
         			$inside.=$rewards->fetchRewards('pointCost','grand', $currentPage,true, 
         												'general');
         		*/
     } else {
         // build bloggable text summary of rewards available
         require_once PATH_CORE . '/classes/template.class.php';
         $this->templateObj = new template($this->db);
         $this->templateObj->registerTemplates(MODULE_ACTIVE, 'rewards');
         $temp .= '<h2>Grand and Runners-up Rewards</h2><p>These will be awarded to the top eligible participants at the end of the ' . SITE_TEAM_TITLE . ' contest.</p>';
         $prizeList = $this->templateObj->db->query("SELECT SQL_CALC_FOUND_ROWS * FROM Prizes WHERE isGrand>0 ORDER BY dollarValue DESC ;");
         if ($this->templateObj->db->countQ($prizeList) > 0) {
             $temp .= $this->templateObj->mergeTemplate($this->templateObj->templates['rewardList'], $this->templateObj->templates['rewardItemTextFinal']);
         }
         $temp .= '<h2>Weekly Rewards</h2>' . '<p>These will be given to the top eligible participants for a specified week during the life of the ' . SITE_TEAM_TITLE . ' contest.';
         'The top scorer(s) will receive the first reward on the left; next-highest scoring members receive the next reward, etc.</p>';
         $prizeList = $this->templateObj->db->query("SELECT SQL_CALC_FOUND_ROWS *,DATE_FORMAT(dateEnd, '%c/%e') AS shortDateEnd FROM Prizes WHERE isWeekly=1 ORDER BY dateEnd ASC, dollarValue DESC;");
         if ($this->templateObj->db->countQ($prizeList) > 0) {
             $temp .= $this->templateObj->mergeTemplate($this->templateObj->templates['rewardList'], $this->templateObj->templates['rewardItemTextWeekly']);
         }
         $inside .= $temp;
         $this->templateObj->cacheContent('rewardListText', $temp);
     }
     return $inside;
 }