Exemplo n.º 1
0
<?php

require_once ROOT_PATH . 'includes/Call.php';
CallMapper::registerMapArray(array(array('getsurvey', NULL, array('survey', array('action' => 'getsurvey')), NULL, 50), array('freedashboard', NULL, array(array('action' => 'freedashboard')), NULL, 50), array('saveuserdata', NULL, array(array('action' => 'saveuserdata')), NULL, 50), array('savesurveyresult', NULL, array(array('action' => 'savesurveyresult')), NULL, 50), array('savedemoresult', NULL, array(array('action' => 'savedemoresult')), NULL, 50), array('widgetsurvey', NULL, array(array('action' => 'widgetsurvey')), NULL, 50), array('setemail', NULL, array(array('action' => 'setemail')), NULL, 50), array('startsurvey', NULL, array('survey')), array('startsurvey', NULL, array('uid')), array('scorecard', NULL, array(array('action' => 'scorecard')), NULL, 80), array('dashboardlogin', NULL, array(array('action' => 'dashboardlogin')), NULL, 80), array('dashboard', NULL, array(array('action' => 'dashboard')), NULL, 80), array('deleteresult', NULL, array(array('action' => 'deleteresult')), NULL, 80), array('verbatims', NULL, array(array('action' => 'verbatims')), NULL, 80), array('reportcsv', NULL, array(array('action' => 'reportcsv')), NULL, 80), array('surveycode', NULL, NULL, NULL, 1000)));
Exemplo n.º 2
0
<?php

//ini_set('display_errors',0);
error_reporting(E_ALL);
require_once 'config.php';
require_once ROOT_PATH . 'includes/WebCalls/Survey.php';
require_once ROOT_PATH . 'includes/WebCalls/Results.php';
require_once ROOT_PATH . 'includes/Call.php';
require_once ROOT_PATH . 'includes/Routes.php';
//ob_start();//Start buffering
try {
    //set_error_handler("userErrorHandler",E_ALL | E_STRICT);
    $call_mapper = new CallMapper();
    $method = $call_mapper->getCallName($_SERVER['QUERY_STRING'], $_REQUEST);
    //print "Method: $method";
    $call_factory = new WebCallFactory($_REQUEST);
    if (!$method || !$call_factory->isCall($method)) {
        $out_type = 'html';
        if (array_key_exists("out", $_REQUEST)) {
            $out_type = $_REQUEST['out'];
        }
        $answer = new Answer('error', 'Unknow method: "' . $method . '"', $out_type);
    } else {
        $call_obj = $call_factory->getCall($method);
        $answer = $call_obj->call();
    }
    $answer_mime = $answer->output_mime();
    if (!$answer_mime) {
        $answer_mime = 'text/html';
    }
    $answer_str = $answer->output();