Exemplo n.º 1
0
<?php

session_start();
include_once "api.php";
if (!isset($_SESSION["audience_id"])) {
    header('Location: index.php');
} else {
    $audience_id = $_SESSION['audience_id'];
    $api = new Conducttr_API($_SESSION['audience_id']);
    $value = $api->get_audience_details();
    if (!empty($value)) {
        $profile_image = $value[0]['profile_image'];
        $audience_first_name = $value[0]['audience_first_name'];
        $audience_last_name = $value[0]['audience_last_name'];
        $project_id = $value[0]['project_id'];
        $delay = $api->get_delay();
    } else {
        $profile_image = 'styles/' . $_SESSION['PROJECT_ID'] . '/profiles/you.png';
        $audience_first_name = 'You';
        $project_id = $_SESSION['PROJECT_ID'];
        $delay = 3000;
    }
}
?>
<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title> GoSocial </title>
		
		<meta name="mobile-web-app-capable" content="yes">
Exemplo n.º 2
0
     exit(json_encode($value));
     break;
 case "send_answer":
     if (isset($_REQUEST["matchphrase"]) && isset($_REQUEST["character"]) && isset($_REQUEST["type"]) && isset($_REQUEST["index"])) {
         $value = $api->send_answer($_REQUEST["matchphrase"], $_REQUEST["character"], $_REQUEST["type"], $_REQUEST["index"]);
     } else {
         $value = array("Response" => "Error");
     }
     exit(json_encode($value));
     break;
 case "get_stats":
     $value = $api->get_stats();
     exit(json_encode($value));
     break;
 case "get_delay":
     $value = $api->get_delay();
     exit($value);
     break;
 case "set_delay":
     if (isset($_REQUEST["delay"]) && isset($_REQUEST["project_id"])) {
         $value = $api->set_delay($_REQUEST["delay"], $_REQUEST["project_id"]);
     } else {
         $value = array("Response" => "Error", "message" => "Invalid arguments");
     }
     exit(json_encode($value));
     break;
 case "update_profile":
     if (isset($_REQUEST["audience_phone"])) {
         $value = $api->update_profile($_REQUEST["audience_phone"]);
     } else {
         $value = "Missing argument";