Esempio n. 1
0
 public function run()
 {
     TbPanel::begin(array('header' => $this->header));
     $col1 = $col = '';
     $print = true;
     foreach ($this->models as $sModel) {
         if ($sModel->priority >= $this->from && $sModel->priority <= $this->to) {
             $tmp = EAVHelper::addRow($sModel->id, $sModel->value, $sModel);
             if ($print) {
                 $col .= $tmp;
                 $print = false;
             } else {
                 $col1 .= $tmp;
                 $print = true;
             }
         }
     }
     echo "<div class='col-xs-6'>{$col1}</div><div class='col-xs-6'>{$col}</div>";
     TbPanel::end();
 }
Esempio n. 2
0
 public function actionFields($id)
 {
     $model = $this->loadModel($id);
     //echo \yii\helpers\Json::encode("echo ".$model->value);
     $form = $model->loadPayment();
     //$form = new $model->value;
     $form->type = $id;
     $form->sum = $_POST['bill']['sum'];
     $form->line = (int) $_POST['bill']['line'];
     $text = '';
     foreach ($form->field() as $field => $type) {
         $rType = $type;
         $value = '';
         if (is_array($rType)) {
             $rType = $type['type'];
             $value = $type['value'];
         }
         $text .= EAVHelper::addRow($field, $value, $rType, 'Doccheques[' . $form->line . ']');
     }
     echo \yii\helpers\Json::encode(array("line" => $form->line, "form" => $text, "bill" => $form->stoppage()));
 }
Esempio n. 3
0
<div class="form">

    <?php 
$form = kartik\form\ActiveForm::begin(array('id' => 'itemcategory-form', 'enableAjaxValidation' => true));
?>

    <?php 
echo $form->errorSummary($model);
?>


    <?php 
foreach ($model->getSettings() as $sModel) {
    //if ($sModel->hidden == 0) {
    echo \app\helpers\EAVHelper::addRow($sModel->id, $sModel->value, $sModel);
    //}
}
?>



    <div class="form-actions">
        <?php 
echo \yii\helpers\Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => 'btn btn-success']);
?>
    </div>

    <?php 
kartik\form\ActiveForm::end();
?>