Exemplo n.º 1
0
 /**
  * Adding query conditions
  *
  * @return array
  */
 public function actionAddCondition()
 {
     $parameterId = \Yii::$app->request->post('parameterId');
     if (!$parameterId || !in_array($parameterId, array_keys(Condition::getParameters()))) {
         return $this->replyError(Yii::t('analytics', 'Parameter not found'));
     }
     $viewParams = $this->getViewAndParamsByAttr(['parameter' => $parameterId]);
     return $this->replyOk($this->renderPartial($viewParams['view'], $viewParams['data']));
 }
Exemplo n.º 2
0
                    <?php 
echo Html::beginForm(\Yii::$app->urlManager->createUrl('analytics/default/report'), 'post', ['class' => 'analytics-form']);
?>

                    <div class="alert alert-danger" role="alert"></div>

                    <h3><?php 
echo Yii::t('analytics', 'Conditions');
?>
</h3>
                    <div class="panel panel-default analytycs-condition">
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-md-4">
                                    <?php 
$allParametrs = Condition::getParameters();
?>
                                    <?php 
echo Html::dropDownList('condition', '', $allParametrs, ['size' => count($allParametrs), 'id' => 'condition-select']);
?>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <?php 
echo Html::button(Yii::t('analytics', 'Add'), ['class' => 'btn btn-sm btn-block btn-primary']);
?>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-8">
                                    <div id="conditionList">
                                        <div class="row">
Exemplo n.º 3
0
<?php

use anmoroz\analytics\models\Condition;
use yii\helpers\Html;
?>
<tr id="parametr_condition_<?php 
echo $conditionModel->parameter;
?>
">
    <td><?php 
echo Condition::getParameters($conditionModel->parameter);
?>
</td>
    <td>
        <?php 
echo Html::dropDownList('condition[' . $conditionModel->parameter . '][condition]', $conditionModel->condition, Condition::getConditionForIntegerType(), ['class' => 'form-control input-small']);
?>
    </td>
    <td><?php 
echo Html::textInput('condition[' . $conditionModel->parameter . '][value]', $conditionModel->value, ['class' => 'form-control']);
?>
</td>
    <?php 
echo $this->render('_deleteButtonCell');
?>
</tr>