public function run()
 {
     echo $this->form->field($this->model, $this->model->getCountryPropertyName())->dropDownList(ArrayHelper::map(Country::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), ['id' => 'location_country_id', 'prompt' => Yii::t('common/geo/country', 'Select country')]);
     if ($this->localized === $this->model->getCountryPropertyName()) {
         return;
     }
     echo $this->form->field($this->model, $this->model->getRegionPropertyName())->widget(DepDrop::className(), ['options' => ['id' => 'location_region_id', 'placeholder' => Yii::t('common/geo/region', 'Select region')], 'data' => ArrayHelper::map(Region::find()->where(['country_id' => $this->model->country_id])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), 'pluginOptions' => ['url' => Url::to(['/geo/region/list']), 'depends' => ['location_country_id']]]);
     if ($this->localized === $this->model->getRegionPropertyName()) {
         return;
     }
     echo $this->form->field($this->model, $this->model->getCityPropertyName())->widget(DepDrop::className(), ['options' => ['id' => 'location_city_id', 'cityholder' => Yii::t('common/geo/city', 'Select city')], 'data' => ArrayHelper::map(City::find()->where(['region_id' => $this->model->region_id])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), 'pluginOptions' => ['url' => Url::to(['/geo/city/list']), 'depends' => ['location_region_id']]]);
     if ($this->localized === $this->model->getCityPropertyName()) {
         return;
     }
     echo $this->form->field($this->model, 'address')->textInput();
 }
Ejemplo n.º 2
0
      <?php 
$id = null;
$person = [];
if (!$model->isNewRecord) {
    $id = ArrayHelper::getValue($model, 'userTo.assignment.itemName.rule_name');
    $user_id = ArrayHelper::getValue($model, 'userTo.id');
    $name = ArrayHelper::getValue($model, 'userTo.person.full_name');
    $person[$user_id] = $name;
}
?>
      <?php 
echo Html::dropDownList('rule_name', $id, ArrayHelper::map(AuthRule::find()->all(), 'name', 'name'), ['class' => 'form-control', 'id' => 'rule_name', 'prompt' => 'Pilih']);
?>
      </div>
      <?php 
echo $form->field($model, 'task_to')->label('Nama Karyawan')->widget(DepDrop::className(), ['data' => $person, 'pluginOptions' => ['depends' => ['rule_name'], 'url' => Url::to(['/user/api/search-person'])]]);
?>


    <?php 
echo $form->field($model, 'task_title')->textInput(['maxlength' => 255]);
?>

    <?php 
echo $form->field($model, 'task_detail')->widget(TinyMce::className(), ['options' => ['rows' => 6], 'clientOptions' => ['plugins' => [], 'toolbar' => "bold italic | alignleft aligncenter alignright alignjustify | bullist numlist "]]);
?>


 <?php 
echo $form->field($model, 'attachment')->fileInput(['class' => "filestyle"]);
?>
Ejemplo n.º 3
0
            <?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);
Ejemplo n.º 4
0
                <div class="col-xs-4"><span>ไปยังปลายทางที่จังหวัด</span>
                    <?php 
echo $form->field($model, 'target_province')->widget(Select2::classname(), ['data' => ArrayHelper::map(Province::find()->all(), 'PRV_CODE', 'PRV_DESC'), 'options' => ['placeholder' => 'เลือกจังหวัด ...', 'id' => 'target-province'], 'pluginOptions' => ['allowClear' => true]])->label(false);
?>
                </div>
            </div>
            <div class="row">

                <div class="col-xs-4"><span>ออกจากประเทศไทยที่จังหวัด</span>
                    <?php 
echo $form->field($model, 'out_province')->widget(Select2::classname(), ['data' => ArrayHelper::map(Province::find()->where(['BOR_FLAG' => 1])->all(), 'PRV_CODE', 'PRV_DESC'), 'options' => ['placeholder' => 'เลือกจังหวัด ...', 'id' => 'ddl-province-out'], 'pluginOptions' => ['allowClear' => true]])->label(false);
?>
                </div>
                <div class="col-xs-4"><span>ด่านพรมแดน</span>
                    <?php 
echo $form->field($model, 'out_border_point')->widget(\kartik\depdrop\DepDrop::className(), ['options' => ['id' => 'ddl-borderpoint-out', 'placeholder' => 'ออก ณ ด่านพรมแดน...'], 'data' => [], 'pluginOptions' => ['depends' => ['ddl-province-out'], 'placeholder' => 'เลือก - ด่านพรมแดน...', 'url' => \yii\helpers\Url::to(['/dep-drop/get-border'])]])->label(false);
?>
                </div>
            </div>

            <?php 
// $form->field($model, 'request_chanel')->textInput()
?>

            <?php 
// $form->field($model, 'dlt_office')->textInput()
?>

            <?php 
// $form->field($model, 'dlt_br')->textInput()
?>
 /**
  * Renders the city part.
  */
 protected function city()
 {
     $this->parts['{city}'] = $this->form->field($this->model, $this->model->getCityPropertyName())->widget(DepDrop::className(), ['options' => ['id' => 'location_city_id', 'cityholder' => Yii::t('jlorente/location', 'Select city')], 'data' => ArrayHelper::map(City::find()->where(['region_id' => $this->model->region_id])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), 'pluginOptions' => ['url' => Url::to(["/{$this->module->id}/city/list"]), 'depends' => ['location_region_id']]]);
 }
Ejemplo n.º 6
0
    </div>
    <div class="row">
        <div class="col-md-3">
            <?php 
// $form->field($model, 'off_code')->textInput(['maxlength' => true])
?>
            <?php 
echo $form->field($model, 'off_code')->widget(Select2::classname(), ['data' => ArrayHelper::map(Province::find()->where(['BOR_FLAG' => 1])->all(), 'PRV_CODE', 'PRV_DESC'), 'options' => ['placeholder' => 'เลือกจังหวัด ...', 'id' => 'ddl-province-start'], 'pluginOptions' => ['allowClear' => true]])->label();
?>
        </div>
        <div class="col-md-3">
            <?php 
// $form->field($model, 'br_code')->textInput(['maxlength' => true])
?>
            <?php 
echo $form->field($model, 'br_code')->widget(\kartik\depdrop\DepDrop::className(), ['options' => ['id' => 'ddl-borderpoint', 'placeholder' => 'ประจำ ด่านพรมแดน ...'], 'data' => $border_start, 'pluginOptions' => ['depends' => ['ddl-province-start'], 'placeholder' => 'เลือก - ด่านพรมแดน...', 'url' => \yii\helpers\Url::to(['/dep-drop/get-border'])]])->label();
?>
        </div>
        <div class="col-md-3">
            <?php 
echo $form->field($model, 'emp_id')->textInput();
?>
        </div>
        <div class="col-md-3">
            <?php 
echo $form->field($model, 'org_code')->textInput(['maxlength' => true]);
?>
        </div>
    </div>

    <div class="panel panel-info">
Ejemplo n.º 7
0
echo $form->field($sale, 'type_id', ['template' => '{input}'])->dropDownList(Sale::getTypeList(), ['prompt' => '- ' . @$origin['type'] . ' -', 'class' => 'form-control', 'data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('type_id')]);
?>
            </div>
            <div class="col-md-2">
                <?php 
echo $form->field($sale, 'region_id', ['template' => '{input}'])->dropDownList(Region::getList(), ['class' => 'form-control', 'id' => 'region_id_' . $form->id, 'prompt' => '- ' . @$origin['region'] . ' -', 'data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('region_id')]);
?>
            </div>
            <div class="col-md-2">
                <?php 
if ($sale->region_id) {
    $district_list = District::getList($sale->region_id);
} else {
    $district_list = [];
}
echo $form->field($sale, 'district_id', ['template' => '{input}'])->widget(DepDrop::className(), ['data' => $district_list, 'options' => ['id' => 'district_id_' . $form->id, 'prompt' => '- ' . @$origin['district'] . ' -', 'data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('district_id'), 'data-value' => @$origin['district']], 'pluginOptions' => ['depends' => ['region_id_' . $form->id], 'placeholder' => false, 'url' => Url::to(['/district/list'])]]);
?>
            </div>
            <div class="col-md-2">
                <?php 
echo $form->field($sale, 'gps', ['template' => '{input}'])->textInput(['data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('gps')]);
?>
            </div>
            <div class="col-md-1">
                <?php 
echo $form->field($sale, 'price', ['template' => '{input}'])->textInput(['data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('price')]);
?>
            </div>
            <div class="col-md-2">
                <?php 
echo $form->field($sale, 'vat', ['template' => '{input}'])->dropDownList(Sale::getVatList(), ['prompt' => '- ' . @$origin['vat'] . ' -', 'class' => 'form-control', 'data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('vat')]);
Ejemplo n.º 8
0
?>
        <?php 
echo $form->field($note, 'ticket_id')->widget(DepDrop::className(), ['type' => DepDrop::TYPE_SELECT2, 'data' => $openTickets, 'select2Options' => ['pluginOptions' => ['allowClear' => true]], 'pluginOptions' => ['depends' => ['location-select'], 'url' => Url::to(['/location/ajax-tickets']), 'placeholder' => ''], 'pluginEvents' => ['depdrop.change' => 'function(event, id, value, count) { $(count == 0 ? "#new-ticket-tab" : "#existing-ticket-tab").find("a[data-toggle=tab]").click(); }']]);
?>
        <?php 
$this->endBlock();
?>

        <?php 
$this->beginBlock('new-ticket');
?>
        <?php 
echo $form->field($ticket, 'title')->textInput();
?>
        <?php 
echo $form->field($ticket, 'bill_type_id')->widget(DepDrop::className(), ['data' => $ticket::$BILL_TYPE_SELECT, 'options' => ['prompt' => '', 'options' => [$ticket::BILL_PROACTIVE => ['disabled' => !($ticket->invoice && $ticket->invoice->location->proactive)]]], 'pluginOptions' => ['depends' => ['location-select'], 'url' => Url::to(['/ticket/ajax-bill-type']), 'placeholder' => '']]);
?>
        <?php 
$this->endBlock();
?>


        <?php 
echo TabsX::widget(['encodeLabels' => false, 'items' => [['label' => 'Log Work', 'content' => $this->blocks['main']]]]);
?>

        <?php 
echo TabsX::widget(['encodeLabels' => false, 'items' => [['label' => 'Existing Ticket', 'content' => $this->blocks['existing-ticket'], 'headerOptions' => ['id' => 'existing-ticket-tab']], ['label' => 'New Ticket', 'content' => $this->blocks['new-ticket'], 'headerOptions' => ['id' => 'new-ticket-tab'], 'active' => count($openTickets) == 0]]]);
?>
        <hr/>
Ejemplo n.º 9
0
?>
          <?php 
echo $form->field($model, 'last_name')->textInput(['maxlength' => 255]);
?>
          <?php 
echo $form->field($model, 'gender')->radioList(['0' => 'Pria', '1' => 'Wanita']);
?>
          <?php 
echo $form->field($model, 'birth_date')->widget(DatePicker::className(), ['options' => ['class' => 'form-control'], 'dateFormat' => 'dd MMMM yyyy', 'clientOptions' => ['changeMonth' => true, 'changeYear' => true]]);
?>
          <?php 
echo $form->field($model, 'divisi')->label('Divisi')->dropDownList(ArrayHelper::map($authRule, 'name', 'name'), ['prompt' => 'Pilih']);
?>

          <?php 
echo $form->field($model, 'jabatan')->label('Jabatan')->widget(DepDrop::className(), ['pluginOptions' => ['depends' => ['signupform-divisi'], 'placeholder' => 'Tidak Ada', 'url' => Url::to(['/user/api/search-role'])]]);
?>
        </div>

        <div class="col-lg-6">
        <?php 
echo $form->field($model, 'username');
?>

        <?php 
echo $form->field($model, 'email');
?>

        <?php 
echo $form->field($model, 'password')->passwordInput();
?>
Ejemplo n.º 10
0
                            <h3 class="box-title"><?php 
echo Yii::t('app', 'Location');
?>
</h3>
                        </div>
                        <div class="box-body">

                            <div class="row">
                                <div class="col-md-6">
                                    <?php 
echo $form->field($model, 'region_id')->dropDownList(Region::getList(), ['id' => 'region_id', 'prompt' => '']);
?>
                                </div>
                                <div class="col-md-6">
                                    <?php 
echo $form->field($model, 'district_id')->widget(DepDrop::className(), ['data' => District::getList($model->region_id), 'options' => ['id' => 'district_id'], 'pluginOptions' => ['depends' => ['region_id'], 'placeholder' => false, 'url' => Url::to(['/district/list'])]]);
?>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-6">
                                    <?php 
echo $form->field($model, 'address', ['template' => "{label}\n<div class=\"input-group\">{input}\n<span class=\"input-group-btn\"><button class=\"btn btn-default\" type=\"button\"><span class=\"glyphicon glyphicon-refresh\" aria-hidden=\"true\"></span></button></span></div>\n{hint}\n{error}"])->textInput(['maxlength' => true]);
?>
                                </div>
                                <div class="col-md-6">
                                    <?php 
echo $form->field($model, 'gps', ['template' => "{label}\n<div class=\"input-group\">{input}\n<span class=\"input-group-btn\"><button class=\"btn btn-default\" type=\"button\"><span class=\"glyphicon glyphicon-refresh\" aria-hidden=\"true\"></span></button></span></div>\n{hint}\n{error}"])->textInput(['maxlength' => true]);
?>
                                    <?php 
Ejemplo n.º 11
-1
    <?php 
$ruleItemOptions = null;
$itemNameOptions = null;
$status = !$model->isNewRecord && !$modelUser->isNewRecord;
if ($status) {
    $ruleItemOptions = [$ruleName => ['Selected' => true]];
    $itemNameOptions = [$itemName => $itemName];
}
?>
    <?php 
echo $form->field($modelAuthRule, 'name')->label('Divisi')->dropDownList(ArrayHelper::map($authRule, 'name', 'name'), ['prompt' => 'Pilih', 'options' => $ruleItemOptions]);
?>

    <?php 
echo $form->field($modelAuthItem, 'name')->label('Jabatan')->widget(DepDrop::className(), ['data' => $status ? $itemNameOptions : ArrayHelper::map($authItem, 'name', 'name'), 'type' => DepDrop::TYPE_SELECT2, 'pluginOptions' => ['depends' => ['authrule-name'], 'placeholder' => 'Tidak Ada', 'url' => Url::to(['/user/api/search-role'])]]);
Panel::end();
?>
</div>

<div class="col-lg-12" style="margin-left:1%">
<hr/>
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord && $modelUser->isNewRecord ? Yii::t('app', '<i class="fa fa-save"></i> Simpan') : Yii::t('app', '<i class="fa fa-edit"></i> Update'), ['class' => $model->isNewRecord && $modelUser->isNewRecord ? 'btn btn-lg btn-success' : 'btn btn-lg btn-primary']);
?>
        <?php 
echo Html::resetButton('<i class="fa fa-refresh"></i> ' . Yii::t('app', 'Batal'), ['class' => 'btn btn-lg btn-default']);
?>
        <?php 
echo Html::a('<i class="fa fa-arrow-left"></i> ' . Yii::t('app', 'Kembali'), ['index'], ['class' => 'btn btn-lg btn-warning']);