Commit cad0698f authored by nepski's avatar nepski
Browse files

call view, POST and GET route

parent cd69d2d4
......@@ -23,7 +23,8 @@ class Main extends Controller {
$categories = Api::get_feedback_categories()['categories'];
$f3->set('feedback_categories', $categories);
$f3->set("contact_id", 42);
$contact_id = $f3->get('POST.contact_id');
$f3->set("contact_id", $contact_id);
//TODO: create call
//TODO: start call
......@@ -42,8 +43,36 @@ class Main extends Controller {
* Feedback SIP function
function feedbacksip($f3, $args) {
* call Page
* Form to call
* GET: show the form
* POST: send the form and GET feedbackform
function call($f3, $args) {
if ($f3->get('VERB') == 'GET') {
//$contact_id = $f3->get('POST.contact_id');
$f3->set('contact', Api::get_contact()); //by $contact_id
$f3->set('block_content', 'call.html');
elseif ($f3->get('VERB') == 'POST'){
$web = new Web;
//GET feedbackform
$f3->set('VERB', 'GET');
$this->feedbackform($f3, $args);
......@@ -13,5 +13,6 @@ POST /restapi/campaign/@id/feedback/add=RestApi->feedback_add
GET /restapi/campaign/@id/arguments/@lang=RestApi->arguments
GET|POST @feedback:/feedback=Main->feedbackform
GET|POST @call:/call=Main->call
POST @feedbacksip:/feedbacksip=Main->feedbacksip
\ No newline at end of file
<h2>{{ _("Call for free") }}</h2>
<form method="post" action="/call/">
<input type="text" id="contact_id" name="contact_id" hidden="hidden" value="{{ }}">
<p>{{ _("If you want to call for free, you must provide us with your phone number (the PiPhone will call that number to initiate the communication).") }}</p>
<label for="phone">{{_("Your phone number:") }}</label>
<input type="text" name="phone" id="phone" placeholder="+33123456789001" />
{{ _('Starting with your <a href="">country code</a>, without the initial 0') }}
<input type="submit" value="{{ _("I'm ready, call me") }}" />
<h2>{{ _("Call at your expense") }}</h2>
<p>{{ _("If you don't want to call for free, here is the number of the current MEP (you can either dial it from your phone or push the button if any VoIP client is installed on your device.") }}</p>
<a href="tel:{{ }}" target="_blank">☎ {{ }}</a>
<p><a href="/">{{ _("Cancel the call") }}</a></p>
Supports Markdown
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