$content_template, ); // Set Section Variables if($page_section == 'form') { $section[$page_section]['var'] = array( 'page_activate' => APP_ACTIVATE, 'owner' => $companyName, ); } ////////////////////// $randomImgArr = array(); $totalNumOfImg = 6; while(sizeof($randomImgArr) < 3) { $randomNum = rand(1, $totalNumOfImg); if(!(in_array($randomNum, $randomImgArr))) array_push($randomImgArr, $randomNum); } $var['randomImgArr'] = $randomImgArr; $current_page = isset($_GET['page']) ? intval($_GET['page']) : 1; $total_record_per_page = 9; $record_per_page = 7; $image_per_page = $total_record_per_page - $image_per_page; $first_record_index = 1 + ($current_page - 1) * $record_per_page; $total_records = getAllRecordCount(); $total_pages = ceil($total_records/$record_per_page); if($_GET['section'] == 'vote'){ $var['itinerary'] = getAllRecords($record_per_page, $first_record_index); $var['page'] = $current_page; $var['total_pages'] = $total_pages; $var['page_prev'] = ($current_page-1 > 0) ? $current_page-1 : 1; $var['next_prev'] = ($current_page+1 < $total_pages) ? $current_page+1 : $total_pages; $var['img_index_1'] = rand(1,sizeof($var['itinerary'])); $var['img_index_2'] = rand(1,sizeof($var['itinerary'])); } else { $var['itinerary'] = ""; $var['page'] = ""; $var['total_pages'] = ""; $var['page_prev'] = ""; $var['next_prev'] = ""; // print_r($_GET); exit; } if($_GET['section'] == 'voteDetail'){ // print_r($_GET); exit; $var['record_id'] = isset($_GET['recordID']) ? intval($_GET['recordID']) : 1; $var['itinerary_detail'] = getRecordByID(intval($_GET['recordID'])); $content_template = TEMPLATE_PATH."content_".$_GET['section'].".tpl.php"; $page_template = TEMPLATE_PATH."page_".$_GET['section'].".tpl.php"; } else { $var['itinerary_detail'] = ""; } if($_GET['section'] == 'verify'){ $verify_status = 0; $voted_id = isset($_GET['vid']) ? $_GET['vid'] : ''; $email_vote = isset($_GET['email']) ? $_GET['email'] : ''; $verify_token = isset($_GET['vt']) ? $_GET['vt'] : ''; if(($voted_id != '') && ($email_vote != '') && ($verify_token != '')) { $verify_status = voteVerification($voted_id, $email_vote, $verify_token); } else { // no record $verify_status = 3; } $var['verify_status'] = $verify_status; } //////////////////////// // Set Page Variables $var['og'] = $page_config['FB_OG'][$page_section]; $var['info'] = array( 'company' => $companyName, 'campaign' => $campaignName, 'url' => CAMPAIGN_PATH, ); $var['html'] = array( 'footer' => $footer_template, 'modal' => $modal_template, 'noscript' => $noscript_template, 'script' => $script_template, 'sections' => $content_template, 'terms' => $terms_template, 'itinerary_demo' => $itinerary_demo_template, ); $var['app'] = array( 'activate' => APP_ACTIVATE, 'debug' => $debug, 'theme_color' => $theme_color, ); // Define Page Object $page = new Template($page_template); $page->var = $var; // Display Page ob_start(); $page->display(); ob_end_flush(); ?>