| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class FMControllerFormMakerSubmits |
| 5 |
*/ |
| 6 |
class FMControllerFormMakerSubmits extends FMAdminController { |
| 7 |
|
| 8 |
private $model; |
| 9 |
private $view; |
| 10 |
|
| 11 |
public function __construct() { |
| 12 |
require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FormMakerSubmits.php"; |
| 13 |
$this->model = new FMModelFormMakerSubmits(); |
| 14 |
require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FormMakerSubmits.php"; |
| 15 |
$this->view = new FMViewFormMakerSubmits(); |
| 16 |
} |
| 17 |
|
| 18 |
public function execute() { |
| 19 |
$this->display(); |
| 20 |
} |
| 21 |
|
| 22 |
public function display() { |
| 23 |
$params = array(); |
| 24 |
$form_id = esc_html(stripslashes($_GET['form_id'])); |
| 25 |
$params['label_order'] = $this->model->get_from_label_order($form_id); |
| 26 |
$group_id = esc_html(stripslashes($_GET['group_id'])); |
| 27 |
$params['rows'] = $this->model->get_submissions($group_id); |
| 28 |
$labels_id = array(); |
| 29 |
$labels_name = array(); |
| 30 |
$labels_type = array(); |
| 31 |
$label_all = explode('#****#', $params['label_order']); |
| 32 |
$label_all = array_slice($label_all, 0, count($label_all) - 1); |
| 33 |
foreach ( $label_all as $key => $label_each ) { |
| 34 |
$label_id_each = explode('#**id**#', $label_each); |
| 35 |
array_push($labels_id, $label_id_each[0]); |
| 36 |
$label_oder_each = explode('#**label**#', $label_id_each[1]); |
| 37 |
array_push($labels_name, $label_oder_each[0]); |
| 38 |
array_push($labels_type, $label_oder_each[1]); |
| 39 |
} |
| 40 |
$params['labels_id'] = $labels_id; |
| 41 |
$params['labels_name'] = $labels_name; |
| 42 |
$params['labels_type'] = $labels_type; |
| 43 |
$this->view->display($params); |
| 44 |
} |
| 45 |
} |
| 46 |
|