Completed
Pull Request — FVSv2 (#47)
by Patrick
02:27
created

cyoa.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
require_once('class.VolunteerPage.php');
3
$page = new VolunteerPage('Burning Flipside - Flipside Volunteer System');
4
5
$page->addJSByURI('js/init_page.js', false);
6
$page->addJSByURI('js/question_node.js', false);
7
$page->addJSByURI('js/volunteer_position.js', false);
8
9
$page->add_head_tag('
0 ignored issues
show
The method add_head_tag() does not seem to exist on object<VolunteerPage>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
10
<script type="text/javascript">function doYes(){var answer=window.currentNode.GetYes();handleNode(answer)}
11
function doBack(){
12
        if(window.nodes.length == 1){
13
            window.alert("cannot go back from the start!");
14
        } else if (document.getElementById("result")){
15
            var mainDiv = document.getElementById("main_div");
16
            mainDiv.removeChild(document.getElementById("result"));
17
            if(document.getElementById("div_email_addr")){
18
                mainDiv.removeChild(document.getElementById("div_email_addr"));
19
            }
20
            if(document.getElementById("position_description")){
21
                mainDiv.removeChild(document.getElementById("position_description"));
22
            }
23
            if(document.getElementById("reset_page_div")){
24
                mainDiv.removeChild(document.getElementById("reset_page_div"));
25
            }
26
            mainDiv.appendChild(window.mainTable);
27
        } else {
28
            window.nodes.pop();
29
            window.currentNode = window.nodes[window.nodes.length-1];
30
            updateQuestionText();
31
        }
32
    }
33
function doNo(){var answer=window.currentNode.GetNo();handleNode(answer);}
34
function updateQuestionText(){var questionText=document.getElementById("question_text");questionText.innerHTML=window.currentNode.GetQuestion();}
35
function handleNode(answer){if(answer instanceof VolunteerPosition){answer.createNode();}else if(answer instanceof QuestionNode){window.currentNode=answer;updateQuestionText();}window.nodes.push(currentNode);}</script>
36
');
37
38
$page->body .= '
39
<div id="content">
40
<div id="main_div">
41
    <table height="100%" width="100%" align="center" id="main_table" class="table">
42
        <!--<tr><td colspan="3">&nbsp;</td>-->
43
        <tr><td colspan="3" align="center" id="question_cell"><h2 id="question_text">Does this shit work?</h2></td></tr>
44
        <tr>
45
            <td id="yes" ><a href=# onclick="doYes()"><img src="images/yes.jpg" class="img-responsive"></a></td>
46
            <td style="width:20%;">&nbsp;</td>
47
            <td id="no" ><a href=# onclick="doNo()"><img src="images/no.jpg" class="img-responsive"></a></td>
48
        </tr>
49
    </table>
50
</div>
51
<div id="VC_Footer">
52
    <p>
53
        <a href=# onclick="doBack()">Or, maybe you\'d like to go back to your previous quesiton?</a>
54
    </p>
55
    <p>
56
    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>
57
    </p>
58
</div>
59
</div>
60
<script type="text/javascript">
61
    window.nodes = new Array();
62
    init_page();
63
    updateQuestionText();
64
    window.nodes.push(window.currentNode);
65
    function reload(){
66
        location.reload();
67
    }
68
    function image_not_found(){
69
        var imageNode = document.getElementById("volunteer_image");
70
        imageNode.src = "images/lostimage.png";
71
        imageNode.style.width="470px";
72
    }
73
</script>
74
';
75
76
$page->printPage();
77