Main.php 1017 Bytes
Newer Older
Mindiell's avatar
Mindiell committed
1 2 3 4
<?php

class Main extends Controller {
    /*
Mindiell's avatar
Mindiell committed
5 6 7 8 9
     * Home page
     * Presents campaign information and a random Contact
     */
    function home($f3,$args) {
        $f3->set('campaign', Api::get_campaign());
10
        $f3->set('contact', Api::get_contact());
Mindiell's avatar
Mindiell committed
11 12 13
        $f3->set('block_content','home.html');
    }

14
    function feedbackform($f3, $args) {
nepski's avatar
nepski committed
15
        if ($f3->get('VERB') == 'GET'){
nepski's avatar
use API  
nepski committed
16 17 18
            $f3->set('feedback_categories', Api::get_feedback_categories());
            $f3->set("contact_id", 42);

nepski's avatar
nepski committed
19 20 21
            //create call
            //start call
            //end call
nepski's avatar
use API  
nepski committed
22

nepski's avatar
nepski committed
23 24 25
            $f3->set('block_content', 'feedbackform.html');
        }
        elseif ($f3->get('VERB') == 'POST'){
nepski's avatar
use API  
nepski committed
26 27 28
            $contact_id = $f3->get('POST.contact_id');
            $feedback = $f3->get('POST.feedback');

nepski's avatar
nepski committed
29
            //send feedback to campaign
nepski's avatar
use API  
nepski committed
30
            $f3->set('post_feedback_result', Api::post_feedback($contact_id, $feedback));
nepski's avatar
nepski committed
31 32
            $f3->set('block_content', 'thankyou.html');
        }
33
    }
nepski's avatar
nepski committed
34

nepski's avatar
nepski committed
35

Mindiell's avatar
Mindiell committed
36 37
};