private function linkToArea(Project $project, array $input) { if (isset($input['area'])) { $id = $input['area']['id']; $area = Area::find($id); $project->area()->associate($area)->save(); } return $project; }
public function update(array $input) { if (array_has($input, 'id')) { $id = $input['id']; $area = Area::find($id); $area->fill($input); $area->save(); return $area; } }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Area::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id]); $query->andFilterWhere(['like', 'name', $this->name]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Area::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, 'active' => $this->active]); $query->andFilterWhere(['like', 'name', $this->name]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Area::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $query->joinWith(['idResponsable']); $dataProvider->sort->attributes['responsable_name'] = ['asc' => ['users.first_name' => SORT_ASC], 'desc' => ['users.first_name' => SORT_DESC]]; /* $dataProvider->sort->attributes['father_area'] = [ 'asc' => ['areas.name' => SORT_ASC], 'desc' => ['areas.name' => SORT_DESC], ];*/ $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, 'area_id' => $this->area_id, 'id_responsable' => $this->id_responsable]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'users.first_name', $this->responsable_name]); return $dataProvider; }
public function getPlaces($id) { $area = Area::find($id); if ($area) { return $area->hasPlaces; } else { return $this->notFoundResponse(); } }
/** * Remove the specified resource from storage. * * @return \Illuminate\Http\Response */ public function postDestroy() { if ($this->request->ajax()) { $id = $this->request['id'] ?: ''; $data = Area::find($id); if ($data) { $data->delete(); } $response = array('url' => route('area.index')); return $response; } }
?> <?php echo $form->field($model, 'descripcion_pregunta')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'id_examen')->dropDownList(ArrayHelper::map(Examen::find()->where(['eliminado' => 0])->all(), 'id', 'nombre'), ['prompt' => 'seleccione el examen']); ?> <?php echo $form->field($model, 'file')->fileInput(); ?> <?php echo $form->field($model, 'id_area')->dropDownList(ArrayHelper::map(Area::find()->where(['eliminado' => 0])->all(), 'id', 'nombre'), ['prompt' => 'Seleccione el area']); ?> <?php echo $form->field($model, 'id_tipo')->radioList(ArrayHelper::map(\app\models\Tipo::find()->all(), 'id', 'nombre'))->label(false); ?> <div class="row"> <div class="panel panel-default"> <div class="panel-heading"> <h4><i class="glyphicon glyphicon-question-sign"></i> Respuestas</h4></div> <div class="panel-body"> <?php DynamicFormWidget::begin(['widgetContainer' => 'dynamicform_wrapper', 'widgetBody' => '.container-items', 'widgetItem' => '.item', 'limit' => 4, 'min' => 0, 'insertButton' => '.add-item', 'deleteButton' => '.remove-item', 'model' => $modelRespuestaExamen[0], 'formId' => 'dynamic-form', 'formFields' => ['nombre_opcion', 'descripcion_respuesta', 'puntos_otorgados', 'imgfile']]); ?>
<div class="discipline-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => 175]); ?> <?php echo $form->field($model, 'short_name')->textInput(['maxlength' => 20]); ?> <?php echo $form->field($model, 'area_id')->dropDownList(ArrayHelper::map(Area::find()->orderBy('name ASC')->all(), 'id', 'name')); ?> <?php echo $form->field($model, 'school_id')->dropDownList(ArrayHelper::map(School::find()->orderBy('name ASC')->all(), 'id', 'name')); ?> <?php echo $form->field($model, 'active')->checkbox([], false); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> <?php
public function actionTab($tab) { $searchModel = new RequestSearch(); $html = null; switch ($tab) { case 1: $query = Request::find()->where(['user_id' => Yii::$app->user->id]); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $query); $html = $this->renderPartial('GridViewMyRequest', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); break; case 2: $query = Request::find()->joinWith('usersRequests')->where(['users_request.user_id' => Yii::$app->user->id]); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $query); $html = $this->renderPartial('GridViewRequestAssigned', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); break; case 3: $area = Area::find()->where(['id_responsable' => Yii::$app->user->id])->one(); $query = Request::find()->joinWith('areasRequests')->where(['areas_request.area_id' => $area->id]); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $query); $html = $this->renderPartial('GridViewRequestForArea', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); break; case 4: $dataProvider = $searchModel->search(Yii::$app->request->queryParams, null); $html = $this->renderPartial('GridViewAllRequest', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); break; case 5: $query = Request::find()->where(['status' => 'Calendarizada']); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $query); $html = $this->renderPartial('GridViewRequestScheduled', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); break; } return JSON::encode($html); }
public function calificarIpp($respuesta = array()) { $categorias = \app\models\Area::find()->all(); }
/** * Lists all Area models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Area::find()->where(['eliminado' => 0])]); return $this->render('index', ['dataProvider' => $dataProvider]); }
</div> <div class="col-md-4"><?php echo $form->field($model, 'comunas_comuna_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Comunas::find()->all(), 'comuna_id', 'comuna_nombre'), 'language' => 'en', 'hideSearch' => false, 'options' => ['placeholder' => 'Seleccionar Comuna'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-md-4"><?php echo $form->field($model, 'estadoTaller_estado')->widget(Select2::classname(), ['data' => ArrayHelper::map(Estadotaller::find()->all(), 'estado', 'estado'), 'language' => 'en', 'hideSearch' => false, 'options' => ['placeholder' => 'Seleccionar Estado del Taller'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-md-4"><?php echo $form->field($model, 'area_area')->widget(Select2::classname(), ['data' => ArrayHelper::map(Area::find()->all(), 'area', 'area'), 'language' => 'en', 'hideSearch' => false, 'options' => ['placeholder' => 'A que área pertenece'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-md-4"><?php echo $form->field($model, 'fechaInicio')->widget(DatePicker::className(), ['inline' => false, 'language' => 'es', 'options' => ['placeholder' => 'AÑO - MES - DIA'], 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'startView' => 0]]); ?> </div> <div class="col-md-4"><?php echo $form->field($model, 'totalParticipantes')->textInput(['maxlength' => true]); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'lugarDireccion')->textInput(['maxlength' => true]);
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $area = Area::find($id); $area->delete(); return redirect()->back(); }
public function getPlacesByArea($id) { $area = Area::find($id); if ($area) { $places = $area->hasPlaces; $json_result = array(); foreach ($places as $place) { $place = $this->show($place['id']); array_push($json_result, $place); } return $json_result; } else { return $this->notFoundResponse(); } }
public function actionAgency() { exit; $old = new Buy6Old(); $offset = isset($_GET['offset']) ? $_GET['offset'] : '384036'; $rs = $old->find()->offset($offset)->limit(500)->orderBy('ID ASC')->all(); if ($rs) { foreach ($rs as $v) { $buy = new Buy6(); $buydata = new BuyData6(); if ($v->Vip == 1) { $buy->groupid = 7; } else { $buy->groupid = 6; } if (!empty($v->City)) { $areaid = Area::find()->select(['areaid'])->where('areaname = "' . $v->City . '"')->one(); } else { $areaid = Area::find()->select(['areaid'])->where('areaname = "' . $v->Province . '"')->one(); } if ($areaid['areaid']) { $buy->areaid = addslashes($areaid['areaid']); } $buy->itemid = $v->ID; $buy->typeid = 1; $buy->level = 0; $buy->title = $v->IntentDrug; $buy->username = $v->FromUserName; $buy->company = $v->Company; $buy->vip = $v->Vip; $buy->truename = $v->LinkMan; $buy->telephone = $v->Tel; $buy->mobile = $v->Pho; $buy->address = $v->ADDR; $buy->email = $v->EMail; $buy->qq = $v->QQ; $buy->totime = 0; $buy->addtime = strtotime($v->PostDTime); $buy->edittime = $buy->addtime; $buy->editdate = date('Y-m-d', $buy->addtime); $buy->adddate = date('Y-m-d', $buy->addtime); $buy->status = 3; $buy->zs_tousername = $v->ToUserName; $buy->drugid = $v->DrugID; $buy->zs_class_lv1 = $v->Class_LV1; $buy->zs_class_lv2 = $v->Class_LV2; $buy->zs_class_lV3 = $v->Class_LV3; $buy->zs_company = $v->Company; $buy->zs_status = $v->Status; $buy->zs_province = $v->Province; $buy->zs_city = $v->City; $buy->zs_postcode = $v->PostCode; $buy->zs_linkman = $v->LinkMan; $buy->zs_tel = $v->Tel; $buy->zs_pho = $v->Pho; $buy->zs_fax = $v->Fax; $buy->zs_qq = $v->QQ; $buy->zs_email = $v->EMail; $buy->zs_website = $v->WebSite; $buy->zs_address = $v->ADDR; $buy->zs_intentdrug = $v->IntentDrug; $buy->zs_durghistory = $v->DurgHistory; $buy->zs_dtime = $v->DTime; $buy->zs_postdtime = $v->PostDTime; $buy->zs_checked = $v->Checked; $buy->zs_jiam = $v->JiaM; $buy->zs_jiamtime = $v->JiaMTime; $buy->zs_state = $v->State; $buy->zs_refreshnum = $v->RefreshNum; $buy->zs_sitename = $v->SiteName; $buy->zs_letter = $v->Letter; $buy->zs_vip = $v->Vip; $buy->zs_channel = $v->Channel; $buy->history = $v->DurgHistory; $buy->is_zs = 1; $buydata->itemid = $v->ID; if ($v->Intro == null) { $v->Intro = ''; } $buydata->content = $v->Intro; $buy->save(false); $buydata->save(false); } $num = $offset + 500; return $this->render('agency', ['num' => $num]); } else { echo '0k!!!!!!!!!!'; } }
/* @var $model app\models\Category */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="category-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'category_id')->dropDownList(ArrayHelper::map(Category::find()->all(), 'id', 'name'), array('prompt' => '')); ?> <?php echo $form->field($model, 'id_area')->dropDownList(ArrayHelper::map(Area::find()->all(), 'id', 'name'), array('prompt' => '')); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'description')->textInput(['maxlength' => true, 'required' => true]); ?> <?php echo $form->field($model, 'service_level_agreement_asignment')->dropDownList(['1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5']); ?> <?php
<div class="request-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'email')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'area_id')->dropDownList(ArrayHelper::map(Area::find()->all(), 'id', 'name'), ['prompt' => '', 'onchange' => '$.get( "' . Url::toRoute('/category/lists') . '", { id: $(this).val() } ) .done(function( data ) { $( "#' . Html::getInputId($model, 'category_id') . '" ).html( data ); } );']); ?> <?php echo $form->field($model, 'category_id')->dropDownList(ArrayHelper::map(Category::find()->all(), 'id', 'name'), array('prompt' => "")); ?> <?php echo $form->field($model, 'subject')->textInput(['maxlength' => true]); ?> <?php