use amnah\yii2\user\models\User; /* @var $this yii\web\View */ /* @var $model app\models\SolicitationSearch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="solicitation-search"> <?php $form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']); ?> <div class="row"> <div class="col-sm-3"> <?php echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(User::find()->where(['role_id' => 2])->orderBy("username ASC")->all(), 'id', 'username'), ['prompt' => '-- Selecione --', 'onchange' => 'this.form.submit()']); ?> </div> </div> <p class="small">Selecione o seu nome para exibir as suas solicitações</p> <!-- <div class="form-group"> <?php echo Html::submitButton('Filtrar', ['class' => 'btn btn-primary']); ?> </div> --> <?php ActiveForm::end(); ?>
private function checkUserInstallation() { if (User::find()->count() < 1) { // Set this action controller as unique on the system. // This way we enforce the system DB configuration Yii::$app->catchAll = ['installation/site/user']; Yii::$app->urlManager->enablePrettyUrl = TRUE; return FALSE; } return TRUE; }
<div class="report-search"> <?php $form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']); ?> <div class="row"> <div class="col-md-4"> <?php echo '<label class="control-label">Período</label>'; echo DatePicker::widget(['model' => $model, 'attribute' => 'start_date', 'attribute2' => 'end_date', 'language' => 'pt', 'type' => DatePicker::TYPE_RANGE, 'separator' => 'até', 'options' => ['placeholder' => ''], 'pluginOptions' => ['autoclose' => true, 'todayHighlight' => true, 'format' => 'yyyy-mm-dd']]); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(User::find()->where(['role_id' => 2])->orderBy("username ASC")->all(), 'id', 'username'), ['prompt' => 'Todos']); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'location_id')->dropDownList(ArrayHelper::map(Location::find()->where(['is_active' => 1])->orderBy("fullname ASC")->all(), 'id', 'fullname'), ['prompt' => 'Todos']); ?> </div> </div> <div class="row"> <div class="col-md-4"> <?php echo $form->field($model, 'typeperson_id')->dropDownList(ArrayHelper::map(Typeperson::find()->orderBy("name ASC")->all(), 'id', 'name'), ['prompt' => 'Todos']); ?> </div> <div class="col-md-4">
/* @var $this yii\web\View */ /* @var $searchModel app\models\ReportSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <div class="row"> <h2>Personalizado</h2> <hr/> <div class="col-xs-6 col-md-3"> <?php echo $this->render('_menu'); ?> </div> <div class="col-xs-12 col-sm-6 col-md-9"> <?php echo $this->render('_search', ['model' => $searchModel]); ?> <hr/> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-condensed'], 'emptyText' => '</br><p class="text-danger">Nenhuma solicitação encontrada!</p>', 'summary' => "<p class=\"text-primary \">Quantidade de solicitações encontradas: <span class=\"badge\">{totalCount}</span></p><hr/>", 'columns' => [['attribute' => 'id', 'enableSorting' => true, 'contentOptions' => ['style' => 'width: 5%;text-align:left']], ['attribute' => 'created', 'enableSorting' => true, 'contentOptions' => ['style' => 'width: 4%;text-align:center'], 'format' => ['date', 'php:d/m/Y']], ['attribute' => 'user_id', 'enableSorting' => true, 'value' => function ($model) { return $model->user->username; }, 'filter' => ArrayHelper::map(User::find()->orderBy('username')->asArray()->all(), 'id', 'username'), 'contentOptions' => ['style' => 'width: 14%;text-align:center']], ['attribute' => 'status_id', 'format' => 'raw', 'enableSorting' => true, 'value' => function ($model) { return '<span style="color:' . $model->status->color . '"><i class="fa fa-circle"></i> ' . $model->status->name . '</span>'; }, 'filter' => ArrayHelper::map(Status::find()->orderBy('name')->asArray()->all(), 'id', 'name'), 'contentOptions' => ['style' => 'width: 14%;text-align:left']], ['attribute' => 'analyst_id', 'format' => 'raw', 'enableSorting' => true, 'value' => function ($model) { return $model->analyst ? $model->analyst->username : '******'; }, 'contentOptions' => ['style' => 'width: 8%;text-align:left']]]]); ?> </div> </div>
public function checkAbonnement($abonnementType, $company_id) { $maxEmployees = $abonnementType->restrictions; $countEmployee = User::find()->where(['company_id' => $company_id, 'role_id' => 5])->count(); //controleer of max employees is overschreden if ($maxEmployees != 0) { if ($countEmployee >= $maxEmployees) { throw new ForbiddenHttpException('<div class="panel-body"> <div class="panel panel-primary"> <div class="text-center"> <h4> <br>Uw huidige abonnement (' . $abonnementType->name . ') biedt u de mogelijkheid om maximaal ' . $maxEmployees . ' werknemers aan te maken!<br><br> U heeft er reeds ' . $countEmployee . ' aangemaakt. <br><br> <a href="http://werkmetspoor.nl/index.php/contact/" class="btn btn-danger" role="button">Neem contact met ons op over u abonnement</a> <br><br> </h4> <a href="https://rail4people-jaccos.c9.io/www/index.php/user-cv">terug</a> <br><br> </div> </div> </div> '); } } }
echo Html::encode($this->title); ?> </h2> <?php //echo $this->render('_search', ['model' => $searchModel]); echo Collapse::widget(['items' => [['label' => 'Outras opções de filtro', 'content' => $this->render('_search', ['model' => $searchModel])]]]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-striped table-hover'], 'emptyText' => '</br><p class="text-danger">Nenhuma solicitação encontrada!</p>', 'summary' => "<p class=\"text-primary \">Existem {totalCount} solicitações no sistema </p>", 'filterModel' => $searchModel, 'rowOptions' => function ($model) { if ($model->status_id == 98) { return ['class' => 'text-muted']; } }, 'columns' => [['attribute' => 'id', 'enableSorting' => true, 'contentOptions' => ['style' => 'width: 5%;text-align:left']], ['attribute' => 'created', 'enableSorting' => true, 'contentOptions' => ['style' => 'width: 4%;text-align:center'], 'format' => ['date', 'php:d/m/Y']], ['attribute' => 'location_id', 'enableSorting' => true, 'value' => function ($model) { return $model->location->nickname; }, 'filter' => ArrayHelper::map(Location::find()->orderBy('nickname')->asArray()->all(), 'id', 'nickname'), 'contentOptions' => ['style' => 'width: 4%;text-align:left']], ['attribute' => 'user_id', 'enableSorting' => true, 'value' => function ($model) { return $model->user->username; }, 'filter' => ArrayHelper::map(User::find()->orderBy('username')->asArray()->all(), 'id', 'username'), 'contentOptions' => ['style' => 'width: 14%;text-align:center']], ['attribute' => 'cpf_cnpj', 'contentOptions' => ['style' => 'width: 4%;text-align:right']], ['attribute' => 'typeperson_id', 'enableSorting' => true, 'value' => function ($model) { return $model->typeperson->name; }, 'filter' => ArrayHelper::map(Typeperson::find()->orderBy('name')->asArray()->all(), 'id', 'name'), 'contentOptions' => ['style' => 'width: 15%;text-align:left']], ['attribute' => 'typesolicitation_id', 'enableSorting' => true, 'value' => function ($model) { return $model->typesolicitation->name; }, 'filter' => ArrayHelper::map(Typesolicitation::find()->orderBy('name')->asArray()->all(), 'id', 'name'), 'contentOptions' => ['style' => 'width: 15%;text-align:left']], ['attribute' => 'status_id', 'format' => 'raw', 'enableSorting' => true, 'value' => function ($model) { //return $model->status->name; return '<span style="color:' . $model->status->color . '"><i class="fa fa-circle"></i> ' . $model->status->name . '</span>'; }, 'filter' => ArrayHelper::map(Status::find()->orderBy('name')->asArray()->all(), 'id', 'name'), 'contentOptions' => ['style' => 'width: 14%;text-align:left']], ['attribute' => 'analyst_id', 'format' => 'raw', 'enableSorting' => true, 'value' => function ($model) { return $model->analyst ? $model->analyst->username : '******'; }, 'contentOptions' => ['style' => 'width: 8%;text-align:left']], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'width: 6%;text-align:right'], 'template' => '{view} {update}']]]); ?> </div>