-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcyoa.php
78 lines (74 loc) · 3.37 KB
/
cyoa.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
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
require_once('class.SecurePage.php');
$page = new SecurePage('Burning Flipside - Flipside Volunteer System');
$page->addJS('scripts/init_page.js');
$page->addJS('scripts/question_node.js');
$page->addJS('scripts/volunteer_position.js');
$page->content['otherHeadData'] = '
<script type="text/javascript">function doYes(){var answer=window.currentNode.GetYes();handleNode(answer)}
function doBack(){
if(window.nodes.length == 1){
window.alert("cannot go back from the start!");
} else if (document.getElementById("result")){
var mainDiv = document.getElementById("main_div");
mainDiv.removeChild(document.getElementById("result"));
if(document.getElementById("div_email_addr")){
mainDiv.removeChild(document.getElementById("div_email_addr"));
}
if(document.getElementById("position_description")){
mainDiv.removeChild(document.getElementById("position_description"));
}
if(document.getElementById("reset_page_div")){
mainDiv.removeChild(document.getElementById("reset_page_div"));
}
mainDiv.appendChild(window.mainTable);
} else {
window.nodes.pop();
window.currentNode = window.nodes[window.nodes.length-1];
updateQuestionText();
}
}
function doNo(){var answer=window.currentNode.GetNo();handleNode(answer);}
function updateQuestionText(){var questionText=document.getElementById("question_text");questionText.innerHTML=window.currentNode.GetQuestion();}
function handleNode(answer){if(answer instanceof VolunteerPosition){answer.createNode();}else if(answer instanceof QuestionNode){window.currentNode=answer;updateQuestionText();}window.nodes.push(currentNode);}</script>
';
$page->body .= '
<div id="content">
<div id="main_div">
<table height="100%" width="100%" align="center" id="main_table" class="table">
<!--<tr><td colspan="3"> </td>-->
<tr><td colspan="3" align="center" id="question_cell"><h2 id="question_text">Does this shit work?</h2></td></tr>
<tr>
<td id="yes" ><a href=# onclick="doYes()"><img src="images/yes.jpg" class="img-responsive"></a></td>
<td style="width:20%;"> </td>
<td id="no" ><a href=# onclick="doNo()"><img src="images/no.jpg" class="img-responsive"></a></td>
</tr>
</table>
</div>
<div id="VC_Footer">
<p>
<a href=# onclick="doBack()">Or, maybe you\'d like to go back to your previous question?</a>
</p>
<p>
Confused about anything you see here? Did you find an error or a dead link? You might want to visit the <a href="http://wiki.burningflipside.com/wiki/Volunteer_Coordinator">Volunteer Coordinator page on Pyropedia</a> or email the volunteer team at <a href="mailto:[email protected]">[email protected]</a>
</p>
</div>
</div>
<script type="text/javascript">
window.nodes = new Array();
initPage();
updateQuestionText();
window.nodes.push(window.currentNode);
function reload(){
location.reload();
}
function imageNotFound(){
var imageNode = document.getElementById("volunteer_image");
imageNode.src = "images/lostimage.png";
imageNode.style.width="470px";
}
</script>
';
$page->printPage();