diff --git a/app/Api.php b/app/Api.php index ca673826df65d8dafd7c17f91f359039fc1a6e42..26c7e515b26952caf453c73bb6dc4f4c8439ce06 100644 --- a/app/Api.php +++ b/app/Api.php @@ -47,6 +47,12 @@ class Api { return json_decode($json, true); } + // //Asking for complete list of group types + static function get_group_types() { + $json = Api::get("campaigns/" . CAMPAIGN_ID . "/grouptypes"); + return json_decode($json, true); + } + // Asking for complete list of feedback categories static function get_feedback_categories() { $json = Api::get("campaigns/" . CAMPAIGN_ID . "/categories"); diff --git a/app/Main.php b/app/Main.php index 17eb770f35775dddf5fb5c88eb44beddf7d58e82..816a0f64247b0a3a22fd5c55165604a1e19ed68b 100644 --- a/app/Main.php +++ b/app/Main.php @@ -16,6 +16,13 @@ class Main extends Controller { //TODO: use weight for random $rand_id = rand(0, count($f3->get('contacts'))-1); $contacts = $f3->get('contacts'); + + $groups = Api::get_groups(); + $f3->set('groups', $groups); + + $group_types = Api::get_group_types(); + $f3->set('group_types', $group_types); + $f3->set('contact', $contacts[$rand_id]); $f3->set('random', rand(0, 2)); $f3->set('block_content', 'home.html'); diff --git a/templates/contact.html b/templates/contact.html index 4d776c20a4a6aa2f66801dc70fbf2da6347be944..2f2deef7d649365809bc84f432551abb54fb6165 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -3,94 +3,93 @@
- {{ _("Phone number") }}: {{ @contact.phone }}
-
+
+