コード例 #1
0
ファイル: index.php プロジェクト: totalrandom/vaa2012-2
<?php

// put full path to Smarty.class.php
require '/usr/local/lib/php/Smarty/libs/Smarty.class.php';
$smarty = new Smarty();
$smarty->setTemplateDir('../../../smarty/templates');
$smarty->setCompileDir('../../../smarty/templates_c');
$smarty->setCacheDir('../../../smarty/cache');
$smarty->setConfigDir('../../../smarty/configs');
//get files with questions and answers
$afile = '../answers.json';
$qfile = '../questions.json';
$rfile = '../region.json';
//extract user values
$user = get_user_values();
//read parties
$parties = json_decode(file_get_contents($afile));
//read region info
$region = json_decode(file_get_contents($rfile));
if (isset($_GET['constituency_code'])) {
    $cc = $_GET['constituency_code'];
} else {
    $cc = 8;
}
//$region->inflection = code2constituency($cc);
//partner
if (isset($_GET['partner'])) {
    switch ($_GET['partner']) {
        case 'ihned':
            $partner = array('name' => 'ihned', 'swatch_bar' => 'g', 'swatch_question_body' => 'd', 'swatch_progressbar' => 'a');
            break;
コード例 #2
0
ファイル: index.php プロジェクト: totalrandom/vaa2012-2
<?php

/**
* VAA
* reads questions from json
*/
session_start();
include "cache.php";
$relative_path = "";
include "common.php";
//read questions
$qfile = 'questions_' . $lang . '.json';
$questions = json_decode(file_get_contents($qfile));
//get prefilled user's values, if exist
$user = json_encode(get_user_values());
$smarty->assign('user', $user);
$smarty->assignByRef('questions', $questions);
$smarty->display('page.tpl');