Exemplo n.º 1
0
 /**
  * Finds the View model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return View the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = View::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 2
0
 public function getViews()
 {
     return $this->hasMany(View::className(), ['id' => 'view_id'])->viaTable('sale_view', ['sale_id' => 'id']);
 }
Exemplo n.º 3
0
                                <div class="col-md-6">
                                    <?php 
echo $form->field($model, 'address', ['template' => "{label}\n<div class=\"input-group\">{input}\n<span class=\"input-group-btn\"><button class=\"btn btn-default\" type=\"button\"><span class=\"glyphicon glyphicon-refresh\" aria-hidden=\"true\"></span></button></span></div>\n{hint}\n{error}"])->textInput(['maxlength' => true]);
?>
                                </div>
                                <div class="col-md-6">
                                    <?php 
echo $form->field($model, 'gps', ['template' => "{label}\n<div class=\"input-group\">{input}\n<span class=\"input-group-btn\"><button class=\"btn btn-default\" type=\"button\"><span class=\"glyphicon glyphicon-refresh\" aria-hidden=\"true\"></span></button></span></div>\n{hint}\n{error}"])->textInput(['maxlength' => true]);
?>
                                </div>
                            </div>

                            <div id="map_canvas" style="height: 300px; margin-bottom: 20px;"></div>

                            <?php 
echo $form->field($model, 'view_ids')->checkBoxList(View::getList());
?>

                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="box">
                        <div class="box-header with-border">
                            <h4 class="box-title"><?php 
echo Yii::t('app', 'Extra');
?>
</h4>
                        </div>
                        <div class="box-body">
Exemplo n.º 4
0
 public static function view()
 {
     $alias = static::getCategory('view');
     $temp = View::getList();
     $origin = [];
     foreach ($temp as $id => $value) {
         $origin[$value] = $id;
     }
     return array_merge($origin, $alias);
 }
Exemplo n.º 5
0
         <div class="row fromto">
             <div class="col-xs-6">
                 <?php 
 echo $form->field($model, 'plot_from')->label(false)->textInput(['placeholder' => Yii::t('app', 'From')]);
 ?>
             </div>
             <div class="col-xs-6">
                 <?php 
 echo $form->field($model, 'plot_to')->label(false)->textInput(['placeholder' => Yii::t('app', 'To')]);
 ?>
             </div>
         </div>
     </div>
     <div class="col-xs-6 col-sm-4 col-md-2">
         <?php 
 echo $form->field($model, 'view_ids')->dropDownList(View::getList(), ['class' => 'form-control selectpicker', 'data-style' => 'form-control', 'title' => Yii::t('app', 'Choose One'), 'multiple' => 'multiple']);
 ?>
     </div>
     <div class="col-xs-6 col-sm-4 col-md-2">
         <?php 
 echo $form->field($model, 'facility_ids')->dropDownList(Facilities::getList(), ['class' => 'form-control selectpicker', 'data-style' => 'form-control', 'title' => Yii::t('app', 'Choose One'), 'multiple' => 'multiple']);
 ?>
     </div>
 </div>
 <div class="row">
     <div class="col-xs-6 col-sm-4 col-md-2">
         <?php 
 echo $form->field($model, 'name')->textInput();
 ?>
     </div>
     <div class="col-xs-6 col-sm-4 col-md-2">
Exemplo n.º 6
0
                <?php 
echo Html::activeHiddenInput($sale, 'id');
?>
                <?php 
echo Html::activeHiddenInput($sale, 'user_id');
?>
                <?php 
echo Html::activeHiddenInput($parse, 'id');
?>
            </div>
        </div>

        <div class="row">
            <div class="col-md-2">
                <?php 
echo $form->field($sale, 'view_ids', ['template' => '{input}'])->checkboxList(View::getList(), ['data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('view_ids')]);
?>
            </div>
            <div class="col-md-4">
                <?php 
echo $form->field($content, 'name', ['template' => '{input}'])->textInput(['data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('name')]);
?>
            </div>
            <div class="col-md-2">
                <?php 
echo $form->field($content, 'description', ['template' => '{input}'])->textarea(['data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('description')]);
?>
                <?php 
foreach ($image as $i) {
    if (!empty($i->url)) {
        echo Html::a(' <i class="glyphicon glyphicon-camera"></i> ', $i->url, ['target' => '_blank']);