/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Firm::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(['id' => $this->id, 'address_id' => $this->address_id, 'svid_date' => $this->svid_date, 'rec_status_id' => $this->rec_status_id, 'user_id' => $this->user_id, 'dc' => $this->dc]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'full_name', $this->full_name])->andFilterWhere(['like', 'okpo', $this->okpo])->andFilterWhere(['like', 'director', $this->director])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'phone', $this->phone])->andFilterWhere(['like', 'bank_name', $this->bank_name])->andFilterWhere(['like', 'bank_mfo', $this->bank_mfo])->andFilterWhere(['like', 'bank_rs', $this->bank_rs])->andFilterWhere(['like', 'svid_num', $this->svid_num])->andFilterWhere(['like', 'svid_who_give', $this->svid_who_give])->andFilterWhere(['like', 'note', $this->note]); return $dataProvider; }
?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'email')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'phone')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'firm_id')->dropDownList(ArrayHelper::map(\app\models\Firm::find()->active()->orderBy('name asc')->all(), 'id', 'name'), ['prompt' => '']); ?> <?php echo $form->field($model, 'workplace_id')->dropDownList(ArrayHelper::map(\app\models\Workplace::find()->active()->all(), 'id', 'name'), ['prompt' => '']); ?> <?php echo $form->field($model, 'note')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'rec_status_id')->radioList(ArrayHelper::map(\app\models\RecStatus::find()->active()->all(), 'id', 'name'), ['class' => 'btn-group', 'data-toggle' => 'buttons', 'unselect' => null, 'item' => function ($index, $label, $name, $checked, $value) { return '<label class="btn btn-default' . ($checked ? ' active' : '') . '">' . Html::radio($name, $checked, ['value' => $value, 'class' => 'project-status-btn']) . $label . '</label>'; }]); ?>
public function showServiceFilteredOrdersToAdmin(Request $request) { $firmId = (int) $request->customer_firm; if (!$firmId) { return redirect('fatal_error')->with('alert-danger', 'Запрашиваемой организации не найдено'); } $firm = Firm::find($firmId); $orders = ServiceOrder::latest('created_at')->with('service_status', 'firm')->where('firm_id', $firmId)->get(); return view('orders.showServiceOrdersToAdmin', ['orders' => $orders, 'newOnly' => false, 'firm' => $firm->organisation_name]); }
public function checkGenitiveCase($firm_id, $order_id) { $firm = Firm::find($firm_id); if (!$firm) { abort(404); } $faceFioArr = explode(' ', $firm->face_fio); $lastName = isset($faceFioArr[0]) ? $faceFioArr[0] : ''; $name = isset($faceFioArr[1]) ? $faceFioArr[1] : ''; $secondName = isset($faceFioArr[2]) ? $faceFioArr[2] : ''; $petrovich = new Petrovich(); $petrovich->gender = $petrovich->detectGender($secondName); if ($petrovich->gender == Petrovich::FAIL_MIDDLEWARE) { $fio = $firm->face_fio; } else { $fio = $petrovich->lastname($lastName, Petrovich::CASE_GENITIVE) . ' ' . $petrovich->firstname($name, Petrovich::CASE_GENITIVE) . ' ' . $petrovich->middlename($secondName, Petrovich::CASE_GENITIVE); } return view('documents.showGenitiveCase', ['orderId' => $order_id, 'fio' => $fio, 'firm_id' => $firm_id, 'document' => Utils::getGenitiveCase($firm->base_document), 'position' => Utils::getGenitiveCase($firm->face_position)]); }
use yii\grid\GridView; /* @var $this yii\web\View */ /* @var $searchModel app\models\searches\VacancySearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Vacancies'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="vacancy-index"> <p class='pull-left'> <?php echo \Yii::$app->user->can('/vacancy/create') ? \yii\helpers\Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'Create new'), ['create'], ['class' => 'btn btn-success']) : ''; ?> </p> <div class="clearfix"></div> <?php \yii\widgets\Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'firm_id' => ['attribute' => 'firm_id', 'value' => 'firm.name', 'filter' => ArrayHelper::map(\app\models\Firm::find()->active()->orderBy('name')->all(), 'id', 'name')], 'profession_id' => ['attribute' => 'profession_id', 'value' => 'profession.name', 'filter' => ArrayHelper::map(\app\models\Profession::find()->active()->orderBy('name')->all(), 'id', 'name')], 'date', 'salary', ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'white-space: nowrap;']]], 'tableOptions' => ['class' => 'table table-striped table-hover']]); ?> <?php \yii\widgets\Pjax::end(); ?> </div>
</div> <div style="padding: 10px;"> <?php echo $form->field($model, 'svid_num')->textInput(['maxlength' => true]); ?> <?php //echo $form->field($model, 'svid_date')->textInput() ?> <?php echo $form->field($model, 'svid_date')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]); ?> <?php //echo $form->field($model, 'svid_who_give')->textInput(['maxlength' => true]) ?> <?php echo $form->field($model, 'svid_who_give')->widget(\yii\jui\AutoComplete::classname(), ['options' => ['class' => 'form-control'], 'clientOptions' => ['source' => \app\models\Firm::find()->select(['svid_who_give as value'])->active()->distinct()->orderBy('svid_who_give asc')->asArray()->all(), 'autoFocus' => true, 'minLength' => '1', 'delay' => '100']]); ?> </div> </div> <div class="panel panel-default"> <div class="panel-heading" style="margin-bottom: 20px;"> <h3 class="panel-title"><?php echo 'Прочее'; ?> </h3> </div> <div style="padding: 10px;"> <?php echo $form->field($model, 'note')->textarea(['rows' => 6]); ?>