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

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . "/app/util/api.php";
require_once __DIR__ . "/templates/head.php";
require_once __DIR__ . "/templates/body.php";
require_once __DIR__ . "/config/luminate.php";
$url = "https://secure2.convio.net/cmp/site/CRSurveyAPI";
$param = array("response_format" => "json", "api_key" => api_key(), "method" => "listSurveys", "published_only" => "true", "list_category_id" => "1761", "list_page_size" => "500", "v" => "1.0");
$res = sendAPI($url, $param);
$jres = json_encode($res);
print "<script>console.log({$jres});</script>";
$surveys = $res->listSurveysResponse->surveys;
if (isset($surveys->surveyName)) {
    $surveys = array($surveys);
}
body_open();
?>

 <form action="upload/" method="post">
   <div id="survey_table">
   <table class="table">
     <tr>
       <th>Surveys</th>
     </tr>
     <?php 
foreach ($surveys as $key => $s) {
    ?>
      <tr>
コード例 #2
0
ファイル: ajax.php プロジェクト: CMP-Studio/Lumifoo
<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
session_start();
require_once __DIR__ . "/../app/util/api.php";
require_once __DIR__ . "/../config/luminate.php";
header('Content-Type: application/json');
$id = $_SESSION["survey_id"];
$token = $_SESSION["sso_token"];
$params = array("response_format" => "json", "api_key" => api_key(), "v" => "1.0", "method" => "submitSurvey", "survey_id" => $id, "sso_auth_token" => $token);
$post = array_merge($params, $_POST);
$url = "https://secure2.convio.net/cmp/site/CRSurveyAPI";
$return = sendAPI($url, $post, true);
print json_encode($return);