Пример #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Situacao::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['like', 'status', $this->status]);
     return $dataProvider;
 }
echo $form->field($model, 'data')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'ajaxConversion' => true, 'options' => ['pluginOptions' => ['autoclose' => true]]]);
?>

        <?php 
echo $form->field($model, 'data_encer')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'ajaxConversion' => true, 'options' => ['pluginOptions' => ['autoclose' => true]]]);
?>

    <?php 
$rows = Modalidade::find()->all();
$data_modalidade = ArrayHelper::map($rows, 'id', 'descricao');
echo $form->field($model, 'modalidade_id')->radiolist($data_modalidade);
?>


    <?php 
$rows = Situacao::find()->all();
$data_situacao = ArrayHelper::map($rows, 'id', 'descricao');
echo $form->field($model, 'situacao_id')->radiolist($data_situacao);
?>



    <?php 
echo $form->field($model, 'status_id')->radioList(['1' => 'Ativo', '0' => 'Inativo']);
?>


    <?php 
$options = \yii\helpers\ArrayHelper::map($cargos, 'idcargo', 'descricao');
echo $form->field($model, 'permissions')->checkboxList($options, ['unselect' => NULL]);
?>
Пример #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSituacaoStatus()
 {
     return $this->hasOne(Situacao::className(), ['status' => 'situacao_status']);
 }
Пример #4
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\models\Situacao;
use app\models\Entregador;
use app\models\Cliente;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model app\models\Pedido */
/* @var $form yii\widgets\ActiveForm */
$stats = ArrayHelper::getColumn(Situacao::find()->all(), function ($element) {
    return $element['status'];
});
$statuses = array_combine($stats, $stats);
$entregadores = ArrayHelper::getColumn(Entregador::find()->all(), function ($element) {
    return $element['nome'];
});
$entregadores = array_combine($entregadores, $entregadores);
$clientes = ArrayHelper::getColumn(Cliente::find()->all(), function ($element) {
    return $element['nome'];
});
$clientes = array_combine($clientes, $clientes);
$tels = ArrayHelper::getColumn(Cliente::find()->all(), function ($element) {
    return $element['tel'];
});
$tels = array_combine($tels, $tels);
?>

<div class="pedido-form">
Пример #5
0
 /**
  * Finds the Situacao model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Situacao the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Situacao::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }