/
index.php
65 lines (57 loc) · 1.43 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?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>
<td>
<div class="radio">
<label>
<input type="radio" name="survey_id" id="sr_<?php print $s->surveyId; ?>" value="<?php print $s->surveyId; ?>">
<?php
print $s->surveyName;
?>
</label>
</div>
</td>
</tr>
<?php } ?>
</table>
</div>
<div id="survey_submit">
<button class="btn btn-default" type="submit">Next</button>
</div>
</form>
<?php body_close(); ?>