use app\bundles\VisualizationBundle; /* @var $this yii\web\View */ /* @var $formModel app\models\Form */ /* @var $formDataModel app\models\FormData */ VisualizationBundle::register($this); $this->title = $formModel->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Forms'), 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $formModel->name, 'url' => ['view', 'id' => $formModel->id]]; $this->params['breadcrumbs'][] = ['label' => Yii::t("app", "Submissions"), 'url' => ['submissions', 'id' => $formModel->id]]; $this->params['breadcrumbs'][] = Yii::t("app", "Submissions Analytics"); // PHP options required by submissions.stats.js $options = array("form_id" => $formModel->id, "endPoint" => Url::to(['ajax/stats', 'id' => $formModel->id]), "countriesJSON" => Yii::getAlias('@web') . '/static_files/json/world-countries.json', "i18n" => ["yes" => Yii::t('app', 'Yes'), "no" => Yii::t('app', 'No'), "noData" => Yii::t('app', 'No data')]); // Pass php options to javascript before VisualizationBundle $this->registerJs("var options = " . json_encode($options) . ";", $this::POS_BEGIN, 'stats-options'); // Load submissions.stats.js after VisualizationBundle $this->registerJsFile('@web/static_files/js/submissions.stats.js', ['depends' => VisualizationBundle::className()]); ?> <div class="analytics-page box box-big box-light"> <div class="pull-right"> <small><?php echo Html::a(Yii::t('app', 'Performance Analytics') . ' <span class="glyphicon glyphicon-arrow-right"> </span> ', ['analytics', 'id' => $formModel->id], ['title' => Yii::t('app', 'Go to Performance Analytics'), 'class' => 'text-muted hidden-xs']); ?> </small> </div> <div class="box-header"> <h3 class="box-title"><?php echo Html::encode($this->title); ?> <span class="box-subtitle"><?php
use yii\helpers\Url; use app\bundles\VisualizationBundle; /* @var $this yii\web\View */ /* @var $formModel app\models\Form */ /* @var $formDataModel app\models\FormData */ VisualizationBundle::register($this); $this->title = $formModel->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Forms'), 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $formModel->name, 'url' => ['view', 'id' => $formModel->id]]; $this->params['breadcrumbs'][] = Yii::t('app', 'Performance Analytics'); // PHP options required by form.analytics.js $options = array("endPoint" => Url::to(['ajax/analytics', 'id' => $formModel->id]), "i18n" => ["users" => Yii::t('app', 'Users'), "beganFilling" => Yii::t('app', 'Began Filling'), "conversions" => Yii::t('app', 'Conversions'), "medianPerDay" => Yii::t('app', 'Median per Day'), "minutes" => Yii::t('app', 'minutes'), "months" => [Yii::t('app', 'Jan'), Yii::t('app', 'Feb'), Yii::t('app', 'Mar'), Yii::t('app', 'Apr'), Yii::t('app', 'May'), Yii::t('app', 'Jun'), Yii::t('app', 'Jul'), Yii::t('app', 'Aug'), Yii::t('app', 'Sep'), Yii::t('app', 'Oct'), Yii::t('app', 'Nov'), Yii::t('app', 'Dec')], "days" => [Yii::t('app', 'Sun'), Yii::t('app', 'Mon'), Yii::t('app', 'Tue'), Yii::t('app', 'Wed'), Yii::t('app', 'Thu'), Yii::t('app', 'Fri'), Yii::t('app', 'Sat')]]); // Pass php options to javascript before VisualizationBundle $this->registerJs("var options = " . json_encode($options) . ";", View::POS_BEGIN, 'analytics-options'); // Load form.analytics.js after VisualizationBundle $this->registerJsFile('@web/static_files/js/form.analytics.js', ['depends' => VisualizationBundle::className()]); ?> <div class="analytics-page box box-big box-light"> <div class="pull-right"> <small> <?php echo Html::a(Yii::t('app', 'Submissions Analytics') . ' <span class="glyphicon glyphicon-arrow-right"> </span> ', ['stats', 'id' => $formModel->id], ['title' => Yii::t('app', 'Go to Submissions Analytics'), 'class' => 'text-muted hidden-xs']); ?> </small> </div> <div class="box-header"> <h3 class="box-title"><?php echo Html::encode($this->title); ?>