Commit 8f444e4f authored by nepski's avatar nepski

use API

parent 0fff81d9
......@@ -10,13 +10,21 @@ class Main extends Controller {
function feedbackform($f3, $args) {
if ($f3->get('VERB') == 'GET'){
$f3->set('feedback_categories', Api::get_feedback_categories());
$f3->set("contact_id", 42);
//create call
//start call
//end call
$f3->set('block_content', 'feedbackform.html');
}
elseif ($f3->get('VERB') == 'POST'){
$contact_id = $f3->get('POST.contact_id');
$feedback = $f3->get('POST.feedback');
//send feedback to campaign
$f3->set('post_feedback_result', Api::post_feedback($contact_id, $feedback));
$f3->set('block_content', 'thankyou.html');
}
}
......
......@@ -5,11 +5,17 @@
<p>{{ _("Please tell us what happened if you was able to talk to someone. Your feedback is important to us.") }}</p>
<form method="post" action="/feedback/" >
<input type="text" id="contact_id" name="contact_id" hidden="hidden" value="{{ @contact_id }}" />
<repeat group="feedback_categories" value="feedback_category">
<p>
<input type="radio" group="feedback_category" value="{{ trim(@feedback_category }}" />
{{ trim(@feedback_category }}
</p>
</repeat>
<p>
<textarea id="feedback" name="feedback"></textarea>
</p>
<input type="submit" name="go" value="{{ _("Send my feedback") }}" />
<input type="submit" name="go" value="{{ _("Send my feedback") }}" />
</form>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment