} 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); // hack: wont work w/ custom wherestring break; case 'hideTip': $tip = requestStr('tip'); require_once PATH_CORE . '/classes/user.class.php'; $userObj = new UserInfoTable($db); $userObj->hideTip($userid, $tip); $code = ''; break; case 'log':
function fetchWeeklyPrizeSchedule() { require_once PATH_CORE . '/classes/prizes.class.php'; $rewards = new rewards($this->db); $studyWeeks = $this->templateObj->templates['ContestWeeks']; //9; $studyStartDate = $this->templateObj->templates['ContestStartDate']; //'2009/3/01 00:10:00'; //$studyEndDate = '2009/4/28'; //$whereString = '';//;"dateEnd<'$studyEndDate' AND dateStart>'$studyStartDate'"; // this is too buggy $currentPage = 1; for ($i = 0; $i < $studyWeeks; $i++) { $inside .= "<h3>Week " . ($i + 1) . " (ending " . date('F j, Y', strtotime($studyStartDate) + ($i + 1) * 60 * 60 * 24 * 7) . ")</h3>"; $inside .= '<div id="rewardGrid">' . $rewards->fetchRewardsPage('dollarValue', 'weekly', $currentPage, true, " (WEEK(dateStart,1)-WEEK('{$studyStartDate}',1))={$i}", 'team') . '</div>'; } return $inside; }