/** * the array of report ids reported by the current user in mentioned $month of the $year * where the keys(key+1) of the array represent the working day numbers of the user * @param type $year int * @param type $month int * @return type array */ public function listOfReportsIDbyCurrentUser($year, $month) { if ($month <= 9) { $month = '0' . $month; } $userID = Yii::$app->user->identity->id; $arrayID = yii\helpers\ArrayHelper::map(Reports::find()->where(['like', 'date', $year . "-" . $month])->andFilterWhere(['user_id' => $userID])->all(), 'id', 'id'); return array_values($arrayID); }
public function up() { $roles = yii\helpers\ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name'); $columns = ['section' => 'User', 'name' => 'defaultRole', 'title' => 'Default user role', 'value' => serialize('Registered'), 'value_type' => 'select', 'options' => serialize($roles), 'desc' => 'Assign newly registered users to specified role.']; Yii::$app->db->createCommand()->insert($this->table, $columns)->execute(); }
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; use kartik\select2\Select2; use kartik\widgets\FileInput; // /* @var $this yii\web\View */ /* @var $model lukisongroup\models\hrd\organisasi */ /* @var $form yii\widgets\ActiveForm */ $array = lukisongroup\hrd\models\Organisasi::find()->distinct()->all(); $dataparent = yii\helpers\ArrayHelper::map($array, 'id', 'title'); $datastatik = ["1" => "a", "2" => "b", "3" => "c"]; // $drop = ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM'); ?> <div class="organisasi-form"> <?php $form = ActiveForm::begin(['id' => 'creupdt', 'enableClientValidation' => true, 'options' => ['enctype' => 'multipart/form-data']]); ?> <!--$form->field($model, 'id')->textInput(['maxlength' => true]) ?>--> <?php echo $form->field($model, 'parent')->widget(Select2::classname(), ['data' => $dataparent, 'options' => ['placeholder' => 'pilih ...'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php
<?php use yii\grid\GridView; use yii\helpers\Html; use app\components\GridViewReservation; $roomsFilterData = yii\helpers\ArrayHelper::map(app\models\Room::find()->all(), 'id', function ($model, $defaultValue) { return sprintf('Floor: %d - Number: %d', $model->floor, $model->room_number); }); $sumPc = 0; $avgPc = 0; if (sizeof($dataProvider->getModels()) > 0) { foreach ($dataProvider->getModels() as $m) { $sumPc += $m->price_per_day; } $avgPc = $sumPc / sizeof($dataProvider->getModels()); } ?> <h2>Reservations</h2> <?php echo GridViewReservation::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showFooter' => true, 'columns' => ['id', ['header' => 'Room', 'filter' => Html::activeDropDownList($searchModel, 'room_id', $roomsFilterData, ['prompt' => '--- all']), 'content' => function ($model) { return $model->room->floor; }], ['header' => 'Customer', 'attribute' => 'customer.surname'], ['attribute' => 'price_per_day', 'footer' => Yii::$app->formatter->asCurrency($allAvgPc, 'CNY')], 'date_from', 'date_to']]);
/** * @return all Section */ public static function getStuSection() { $dataTmp = Section::find()->where(['is_status' => 0])->orderBy('section_name')->all(); $result = yii\helpers\ArrayHelper::map($dataTmp, 'section_id', 'section_name'); return $result; }
$this->params['breadcrumbs'][] = $this->title; ?> <div class="comment-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a(Yii::t('app', '创建评论', ['modelClass' => 'Comment']), ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'content:ntext', ['attribute' => 'status', 'label' => '评论状态', 'value' => function ($data) { if (!empty($data->status)) { return '审核通过'; } else { return '等待审核'; } }, 'filter' => [0 => '等待审核', 1 => '审核通过']], 'author_name', ['attribute' => 'post_id', 'label' => '文章ID', 'filter' => yii\helpers\ArrayHelper::map(app\models\Comment::find()->orderBy('id')->asArray()->all(), 'post_id', 'post_id')], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
<?php echo $this->render('/_alert', ['module' => Yii::$app->getModule('user')]); ?> <?php echo $this->render('_menu'); ?> <?php Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => "{items}\n{pager}", 'columns' => [['attribute' => 'username', 'value' => function ($model) { return $model->username == null ? '<span class="not-set">' . Yii::t('user', '(not set)') . '</span>' : $model->username; }, 'filter' => yii\helpers\ArrayHelper::map(common\models\user\User::find()->orderBy('username', 'ASC')->all(), 'username', 'username'), 'format' => 'html'], 'email:email', ['attribute' => 'registration_ip', 'value' => function ($model) { return $model->registration_ip == null ? '<span class="not-set">' . Yii::t('user', '(not set)') . '</span>' : $model->registration_ip; }, 'format' => 'html'], ['attribute' => 'created_at', 'value' => function ($model) { return Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$model->created_at]); }, 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'created_at', 'dateFormat' => 'php:Y-m-d', 'options' => ['class' => 'form-control']])], ['header' => Yii::t('user', 'Confirmation'), 'value' => function ($model) { if ($model->isConfirmed) { return '<div class="text-center"><span class="text-success">' . Yii::t('user', 'Confirmed') . '</span></div>'; } else { return Html::a(Yii::t('user', 'Confirm'), ['confirm', 'id' => $model->id], ['class' => 'btn btn-xs btn-success btn-block', 'data-method' => 'post', 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?')]); } }, 'format' => 'raw', 'visible' => Yii::$app->getModule('user')->enableConfirmation], ['header' => Yii::t('user', 'Block status'), 'value' => function ($model) { if ($model->isBlocked) { return Html::a(Yii::t('user', 'Unblock'), ['block', 'id' => $model->id], ['class' => 'btn btn-xs btn-success btn-block', 'data-method' => 'post', 'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?')]); } else { return Html::a(Yii::t('user', 'Block'), ['block', 'id' => $model->id], ['class' => 'btn btn-xs btn-danger btn-block', 'data-method' => 'post', 'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?')]); }
<div class="btn-group"> <?php echo Html::a('Создать', Url::to(['exercise/create']), ['class' => 'btn btn-primary']); ?> <?php echo Html::button('Управление категориями', ['value' => Url::to(['exercise-subject/index']), 'class' => 'btn btn-primary modalButton']); ?> </div> </p> <?php Pjax::begin(['enablePushState' => false]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => "\n{items}\n{pager}\n{summary}", 'options' => ['class' => 'table table-responsive'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', ['attribute' => 'subject_id', 'value' => 'subject.name', 'filter' => yii\helpers\ArrayHelper::map(\common\models\ExerciseSubject::find()->where(['teacher_id' => Yii::$app->user->identity->teacher->id])->distinct()->all(), 'name', 'name')], ['class' => 'yii\\grid\\ActionColumn', 'template' => '<div class="btn-group">{view} {update} {delete}</div>', 'buttons' => ['view' => function ($url, $model) { return Html::button('<span class="glyphicon glyphicon-eye-open"></span>', ['value' => $url, 'class' => 'btn btn-default modalButton']); }, 'update' => function ($url, $model) { return Html::a('<span class="glyphicon glyphicon glyphicon-pencil"></span>', $url, ['class' => 'btn btn-default', 'data-pjax' => 0]); }, 'delete' => function ($url, $model) { return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['class' => 'btn btn-default', 'data-method' => 'post', 'data-confirm' => 'Вы уверены что хотите это удалить?']); }]]]]); ?> <?php Pjax::end(); ?> <?php Modal::begin(['id' => 'modal', 'size' => 'modal-lg', 'clientOptions' => ['modal' => true, 'autoOpen' => false]]); echo "<div id='modalContent' style='overflow:hidden;'></div>"; Modal::end();
use yii\helpers\Html; use yii\widgets\ActiveForm; use app\modules\unicred\questionlist\models\Region; /* @var $this yii\web\View */ /* @var $model app\modules\unicred\models\Office */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="office-form"> <?php $form = ActiveForm::begin(); ?> <?php $regions = yii\helpers\ArrayHelper::map(app\modules\unicred\questionlist\models\Region::find()->all(), 'id', 'name'); ?> <?php echo $form->field($model, "region_id")->dropDownList($regions, [$model->region_id => ['selected' => 'selected']]); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php if (!Yii::$app->request->isAjax) { ?> <div class="form-group">
/** * @return student category */ public function getStuCategoryId() { $dataTmp = StuCategory::find()->where(['is_status' => 0])->orderBy('stu_category_name')->all(); $result = yii\helpers\ArrayHelper::map($dataTmp, 'stu_category_id', 'stu_category_name'); return $result; }
?> <?php echo $form->field($model, 'codigo_postal')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'zoom')->textInput(); ?> <?php echo $form->field($model, 'radius')->textInput(); ?> <?php $items = yii\helpers\ArrayHelper::map(\app\models\Provincias::find()->all(), 'id', 'nombre'); echo $form->field($model, 'provincia_id')->dropDownList($items, ['prompt' => 'seleccione Provincia']); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
$action = ['create']; } ?> <div class="box view-item <?php echo $model->isNewRecord ? 'box-success' : 'box-info'; ?> "> <div class="box-body"> <div class="region-form"> <?php $form = ActiveForm::begin(['id' => 'region-form', 'action' => $action, 'enableAjaxValidation' => true]); ?> <?php $listDataCountry = yii\helpers\ArrayHelper::map(common\models\Country::find()->where(['is_status' => 1])->all(), 'id', 'country'); ?> <?php echo $form->field($model, 'country_id')->dropDownList($listDataCountry, ['prompt' => '-- Select Country'])->label(false); ?> <?php echo $form->field($model, 'region', ['inputOptions' => ['placeholder' => 'Region Name', 'class' => 'form-control']])->textInput(['maxlength' => true])->label(false); ?> <?php echo $form->field($model, 'is_status')->dropDownList(['1' => 'Active', '0' => 'Not Active'], ['prompt' => '-- Status --'])->label(false); ?> <div class="form-group"> <?php
</div> <div class="col-md-6"> <?php echo $form->field($model, 'description')->textarea(['rows' => 4]); ?> <?php echo $form->field($model, 'link')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'icon')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'menu_group_id')->dropDownList(yii\helpers\ArrayHelper::map(\mdm\admin\models\Menu::find()->where("parent is null")->all(), 'id', 'name')); ?> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> </div> </div> <?php ActiveForm::end();
public function getTemplates() { return yii\helpers\ArrayHelper::map(EmailTemplates::find()->all(), 'id', 'title'); }
?> <?php echo $form->field($model, 'phone')->textInput(['maxlength' => 16]); ?> <?php echo Html::label("Дата рождения"); ?> <?php echo DatePicker::widget(['model' => $model, 'attribute' => 'birthday', 'language' => 'ru', 'options' => ['class' => 'form-control'], 'dateFormat' => 'yyyy-MM-dd']); ?> <?php //yii\jui\DatePicker::widget(['name' => 'attributeName', 'clientOptions' => ['defaultDate' => '2014-01-01']]) ?> <?php echo $form->field($model, 'department_id')->dropDownList(yii\helpers\ArrayHelper::map(app\models\Department::find()->all(), 'id', 'department_name'), ['prompt' => 'Выберите кафедру']); ?> <div class="form-group"> <?php echo Html::submitButton('Регистрация', ['class' => 'btn btn-success']); ?> </div> <?php ActiveForm::end(); ?> </div>
echo $form->field($model, 'agreed_podr_list', ['template' => "{label}<div class=\"col-sm-6\">{input}</div><div class=\"col-sm-2\" style=\"text-align: right;\"><button type=\"button\" id=\"add-agreed-podr-button-update\" class=\"btn btn-default btn-sm\"><span class=\"glyphicon glyphicon-plus\"></span></button></div>\n{hint}", 'labelOptions' => ['class' => 'col-sm-4 control-label'], 'inputOptions' => ['class' => 'form-control input-sm']])->textInput(); ?> <div class="hr-line-dashed"></div> <?php echo $form->field($model, 'transmitted_podr_list', ['template' => "{label}<div class=\"col-sm-6\">{input}</div><div class=\"col-sm-2\" style=\"text-align: right;\"><button type=\"button\" id=\"add-transmitted-podr-button-update\" class=\"btn btn-default btn-sm\"><span class=\"glyphicon glyphicon-plus\"></span></button></div>\n{hint}", 'labelOptions' => ['class' => 'col-sm-4 control-label'], 'inputOptions' => ['class' => 'form-control input-sm']])->textInput(); ?> <div class="hr-line-dashed"></div> <?php $this->registerJs('function format(state) {return state.text;}', View::POS_HEAD); $this->registerJs('function format_selection(state) {return "<b>"+state.text+"</b>";}', View::POS_HEAD); ?> <?php if ($show_states == 1) { $states_list = yii\helpers\ArrayHelper::map(\app\models\StatesNext::find()->where(['STATE_ID' => $model->state, 'DEL_TRACT_ID' => 0])->orderBy('ID ASC')->all(), 'NEXT_STATE_ID', 'state_name_state_colour'); $current_status = \app\models\States::findOne($model->state)->getState_name_state_colour(); $states_list = [$model->state => $current_status] + $states_list; ?> <?php echo $form->field($model, 'state', ['template' => "{label}<div class=\"col-sm-8\">{input}</div>\n{hint}", 'labelOptions' => ['class' => 'col-sm-4 control-label'], 'inputOptions' => ['class' => 'form-control input-sm']])->widget(\kartik\select2\Select2::classname(), ['options' => ['placeholder' => ''], 'hideSearch' => true, 'data' => $states_list, 'pluginOptions' => ['allowClear' => true, 'templateResult' => new JsExpression('format'), 'escapeMarkup' => new JsExpression("function(m) { return m; }"), 'templateSelection' => new JsExpression('format_selection')]]); } ?> </div> <div class="modal-footer"> <?php if (!$not_ajax) { ?> <button type="button" class="btn btn-default" id="issue-cancel-update-button">Отмена</button> <?php
<?php echo $form->field($model, 'invoice_id')->widget(\kartik\select2\Select2::className(), ['data' => \yii\helpers\ArrayHelper::map(\common\models\Location::find()->active()->all(), 'id', 'fullName'), 'options' => ['prompt' => '', 'id' => 'location-select']]); ?> <?php echo $form->field($model, 'tech_id')->dropDownList(yii\helpers\ArrayHelper::map(\common\models\Tech::find()->contact()->all(), 'contact_id', 'contact.name'), ['prompt' => '']); ?> <?php echo Html::a('<span class="glyphicon glyphicon-plus"></span> New Ticket', ['ticket/create', 'close' => true, 'Ticket' => ['invoice_id' => $model->invoice_id]], ['id' => 'new-ticket-btn', 'class' => 'btn btn-success btn-xs pull-right', 'target' => '_blank']); ?> <?php echo Html::button('<span class="glyphicon glyphicon-refresh"></span>', ['class' => 'btn btn-default btn-xs pull-right', 'title' => 'Refresh tickets for selected location', 'onclick' => '$("#location-select").trigger("depdrop.change")']); ?> <?php echo $form->field($model, 'ticketIds')->widget(\kartik\depdrop\DepDrop::className(), ['type' => \kartik\depdrop\DepDrop::TYPE_SELECT2, 'data' => yii\helpers\ArrayHelper::map(\common\models\Ticket::find()->location($model->invoice_id)->open()->all(), 'id', 'fullName'), 'options' => ['multiple' => true], 'select2Options' => ['pluginOptions' => ['allowClear' => true]], 'pluginOptions' => ['depends' => ['location-select'], 'url' => Url::to(['/location/ajax-tickets']), 'placeholder' => false], 'pluginEvents' => ['depdrop.change' => 'function(event, id, value, count) { console.log(event, id, value); $("#new-ticket-btn").attr("href", "/ticket/create?close=true" + (value == null ? "" : ("&Ticket%5Binvoice_id%5D=" + value))); }']]); ?> <?php echo $form->field($model, 'start_time')->widget(DateTimePicker::className(), ['pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii:00', 'startDate' => date('Y-m-d'), 'initialDate' => date('Y-m-d H:00:00', strtotime('+1 hour')), 'todayHighlight' => true, 'showMeridian' => true, 'minuteStep' => 15, 'autoclose' => true]]); ?> <?php echo $form->field($model, 'duration')->input('number', ['min' => 15, 'step' => 5]); ?> <?php echo $form->field($model, 'onSite')->checkbox([], false);
/* @var $this yii\web\View */ /* @var $model lukisongroup\models\hrd\Regulasi */ /* @var $form yii\widgets\ActiveForm */ $array = Seq::find()->all(); $arraygf = lukisongroup\models\hrd\Groupfunction::find()->all(); $arraydep = \lukisongroup\models\hrd\Dept::find()->all(); $arraysub = lukisongroup\models\hrd\Deptsub::find()->all(); $arraycorp = lukisongroup\models\hrd\Corp::find()->all(); $arrayjob = lukisongroup\models\hrd\Jobgrade::find()->all(); //data $datadep = yii\helpers\ArrayHelper::map($arraydep, 'DEP_ID', 'DEP_NM'); $datagf = yii\helpers\ArrayHelper::map($arraygf, 'GF_ID', 'GF_NM'); $datasqid = yii\helpers\ArrayHelper::map($array, 'SEQ_ID', 'SEQ_NM'); $datasub = yii\helpers\ArrayHelper::map($arraysub, 'DEP_SUB_ID', 'DEP_ID'); $datacorp = yii\helpers\ArrayHelper::map($arraycorp, 'CORP_ID', 'CORP_NM'); $datajob = yii\helpers\ArrayHelper::map($arrayjob, 'JOBGRADE_ID', 'JOBGRADE_NM'); $datastatus = ['0' => 'Tidak aktif', '1' => 'aktif']; ?> <!--<div class="regulasi-form">--> <?php $form = ActiveForm::begin(['id' => 'form', 'enableClientValidation' => true]); ?> <!--$form->field($model, 'ID')->textInput(['maxlength' => true]) ?>--> <?php echo $form->field($model, 'RGTR_TITEL')->textInput(['maxlength' => true]); ?>
<?php use yii\helpers\Html; use yii\grid\GridView; /* @var $this yii\web\View */ /* @var $searchModel app\models\AccordsSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Имя в прайсе'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="accords-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'identifier', ['attribute' => 'providers_id', 'label' => 'Поставщик', 'format' => 'html', 'filter' => yii\helpers\ArrayHelper::map(app\models\Providers::find()->all(), 'id', 'name'), 'value' => function ($model) { return app\models\Providers::findOne($model->providers_id)->name; }], ['attribute' => 'link_category', 'label' => 'Товар', 'format' => 'html', 'value' => function ($model) { return \app\components\Goods::getName($model->goods_id); }], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}']]]); ?> </div>
</div> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <h3 class="box-title" style="padding-bottom: 20px"> <i class="fa fa-th-list"></i> <?php echo Yii::t('app', 'List Category'); ?> <span class="pull-right"><a href="<?php echo \yii\helpers\Url::to(['/main-category/']); ?> " class="btn btn-info"> Main Category <i class="fa fa-arrow-right"></i></a></span> </h3> <div class="box view-item"> <div class="box-body"> <div class="category-index"> <?php yii\widgets\Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'category', ['attribute' => 'main_category_id', 'value' => 'mainCategory.main_category', 'filter' => yii\helpers\ArrayHelper::map(\common\models\MainCategory::find()->where(['is_status' => 1])->all(), 'id', 'main_category')], ['attribute' => 'is_status', 'class' => '\\pheme\\grid\\ToggleColumn', 'enableAjax' => false, 'filter' => ['1' => 'Active', '0' => 'Not Active']], ['class' => 'common\\components\\CustomActionColumn']]]); ?> <?php yii\widgets\Pjax::end(); ?> </div> </div> </div> </div> </div>
public static function getAllIndustriesByCategories() { $options = []; $parents = CsCategories::find()->all(); foreach ($parents as $key => $p) { $children = self::find()->where("category_id=:parent_id", [":parent_id" => $p->id])->all(); $children = self::find()->where("category_id=:parent_id", [":parent_id" => $p->id])->all(); $options[$p->name] = yii\helpers\ArrayHelper::map($children, 'id', 'tName'); /*$child_options = []; foreach($children as $child) { $child_options[$child->id] = $child->tName; } $options[$p->tName] = $child_options;*/ } return $options; }
use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model common\models\Jobs */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="jobs-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'company_id')->dropDownList(yii\helpers\ArrayHelper::map(\common\models\Company::allCompany(), 'id', 'name')); ?> <?php echo $form->field($model, 'zhiweiming')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'gongzuodiqu')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'zhiweixinzi')->textInput(['maxlength' => true]); ?> <?php
/** * @return get all Country */ public static function getAllCountry() { $dataTmp = self::find()->where(['is_status' => 0])->orderBy('country_name')->all(); $result = yii\helpers\ArrayHelper::map($dataTmp, 'country_id', 'country_name'); return $result; }
/* @var $model app\models\CategoryGoogle */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="category-google-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => 30]); ?> <?php $items = yii\helpers\ArrayHelper::map(\app\models\Category::find()->all(), 'id_categoria', 'nombre_categoria'); echo $form->field($model, 'parent_id')->dropDownList($items, ['prompt' => 'seleccione Categoria']); ?> <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']); ?> </div> <?php ActiveForm::end(); ?> </div>
/** * @return all batches */ public static function getStuBatches() { $dataTmp = Batches::find()->where(['is_status' => 0])->orderBy('batch_name')->all(); $result = yii\helpers\ArrayHelper::map($dataTmp, 'batch_id', 'batch_name'); return $result; }
<?php $items = yii\helpers\ArrayHelper::map(\app\models\Category::find()->all(), 'id_categoria', 'nombre_categoria'); echo Html::label('Categorias'); echo Html::dropDownList('lista-categorias', '', $items, ['class' => 'form-control', 'prompt' => 'Elija una categoria Superior', 'onchange' => 'cambiarChecklist($(this).val())']); ?> </div> </div> <?php \yii\widgets\Pjax::begin(); ?> <?php $items = yii\helpers\ArrayHelper::map(\app\models\CategoryGoogle::find()->all(), 'id', 'nombre'); $model->categoryGoogles = yii\helpers\ArrayHelper::getColumn($model->getCategoryGoogles(), 'id'); echo $form->field($model, 'categoryGoogles')->checkboxList($items, ['class' => '']); ?> <?php \yii\widgets\Pjax::end(); ?> <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 if ($showColorNumberSelection) { echo Html::beginForm(['default/showupdatecolorsizeimage', 'item_id' => $itemData['item_id']], 'post'); echo Html::activeDropDownList($itemModel, 'numberOfColors', $colorNumbers, ['onchange' => 'this.form.submit()', 'prompt' => '--Choose Number of Colors--']); echo Html::endForm(); ?> <br/> <?php if ($showColorSizeImageSelection) { $form = ActiveForm::begin(['method' => 'post', 'action' => 'index.php?r=item/default/insetitem&sub_cat_it=' . $itemModel->item_sub_category_id . '&item_name=' . $itemModel->item_name . '&item_mirrVal=' . $itemModel->item_mirrorval . '&item_no_of_colors=' . $itemModel->numberOfColors . '&item_id=' . $itemModel->item_id . '&item_hash=' . $itemModel->item_hashTag, 'options' => ['enctype' => 'multipart/form-data']]); for ($i = 0; $i < $colorNumbers[$itemModel->numberOfColors]; $i++) { echo '<label class="control-label">Enter Details of Item ' . ($i + 1) . '</label>'; ?> <br/> <?php echo Html::activeDropDownList($itemModel, 'itemColors[' . $i . ']', yii\helpers\ArrayHelper::map($colors, 'color_name', 'color_name'), ['prompt' => '--Choose color--']); ?> <table> <tr> <td> <?php echo $form->field($itemModel, 'itemImgFront[' . $i . ']')->fileInput(['accept' => 'image/*', 'style' => 'padding:0px;']); ?> </td> <td> <?php echo $form->field($itemModel, 'itemImgBack[' . $i . ']')->fileInput(['accept' => 'image/*']); ?> </td> <td>
<?php $this->params['breadcrumbs'][] = ['label' => 'แพทย์แผนไทย', 'url' => ['knott/index']]; $this->params['breadcrumbs'][] = 'รายงานอันดับการจ่ายยาสมุน'; $this->title = 'DHDC-รายงานแพทย์แผนไทย'; ?> <div class='well'> <form method="POST"> สถานบริการ: <?php $list = yii\helpers\ArrayHelper::map(frontend\models\ChospitalAmp::find()->all(), 'hoscode', 'hosname'); echo yii\helpers\Html::dropDownList('hospcode', $hospcode, $list, ['prompt' => 'ทุกสถานบริการ']); ?> ระหว่าง: <?php echo yii\jui\DatePicker::widget(['name' => 'date1', 'value' => $date1, 'language' => 'th', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'changeYear' => true]]); ?> ถึง: <?php echo yii\jui\DatePicker::widget(['name' => 'date2', 'value' => $date2, 'language' => 'th', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'changeYear' => true]]); ?> <button class='btn btn-danger'>ประมวลผล</button> </form> </div> <a href="#" id="btn_sql">ชุดคำสั่ง</a> <div id="sql" style="display: none"><?php echo $sql; ?> </div>
<!-- Country --> <?php $listDataCountry = yii\helpers\ArrayHelper::map(common\models\Country::find()->where(['is_status' => 1])->all(), 'id', 'country'); ?> <?php echo $form->field($model, 'country_id', ['inputOptions' => ['class' => 'form-control']])->dropDownList($listDataCountry, ['prompt' => Yii::t('app', '-- Select Country --'), 'onchange' => ' $.get("' . yii\helpers\Url::toRoute(['dependent/getregion']) . '", { id: $(this).val() }) .done(function(data){ $("#' . Html::getInputId($model, 'region_id') . '").html( data ); });']); ?> <!-- Region --> <?php $listDataRegion = yii\helpers\ArrayHelper::map(common\models\Region::find()->all(), 'id', 'region'); ?> <?php echo $form->field($model, 'region_id')->dropDownList($listDataRegion, ['prompt' => '-- Select Region --', 'onchange' => ' $.get("' . yii\helpers\Url::toRoute(['dependent/getcity']) . '", { id: $(this).val() }) .done(function(data){ $("#' . Html::getInputId($model, 'city_id') . '").html( data ); });']); ?> <!-- City --> <?php $listDataCity = \yii\helpers\ArrayHelper::map(\common\models\City::find()->all(), 'id', 'city');
/** * @return array */ public static function getList() { return yii\helpers\ArrayHelper::map(static::find()->asArray()->where(['status' => self::STATUS_ACTIVE])->all(), 'id', 'title'); }