예제 #1
0
$form = ActiveForm::begin();
?>
    <?php 
$title = new Jobtitles();
?>
    <?php 
$jobaction = new Jobactions();
?>
      <?php 
$sublist = [['id' => 1, 'value' => 'ลาออก'], ['id' => 2, 'value' => 'ย้ายตำแหน่ง']];
?>
    <div class="row">
        <div class="col-lg-4">
    <label>ประเภทการร้องขอ</label>
    <?php 
echo $form->field($model, 'jobtitle')->dropDownList(ArrayHelper::map($title->find()->where(['type' => 1])->all(), 'recid', 'titlename'), ['id' => 'jobtitle', 'style' => 'width: 300px;'])->label(false);
?>
        </div>
          <div class="col-lg-4">
              <label>วัตถุประสงค์</label>
            <?php 
echo $form->field($model, 'jobaction')->dropDownList(ArrayHelper::map($jobaction->find()->all(), 'recid', 'actionname'), ['id' => 'jobaction', 'style' => 'width: 300px;'])->label(false);
?>
        </div>
          <div class="col-lg-4">
              <label>เนื่องจาก</label>
             <?php 
echo $form->field($model, 'comment')->dropDownList(ArrayHelper::map($sublist, 'id', 'value'), ['id' => 'typelist', 'style' => 'width: 300px;'])->label(false);
?>
        </div>
    </div>
예제 #2
0
/* @var $model backend\models\Reqreport */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="reqreport-form">

    <?php 
$form = ActiveForm::begin(['id' => 'form-report', 'options' => ['enctype' => 'multipart/form-data']]);
?>
     
    <?php 
$jtitle = new Jobtitles();
?>
    <label>ประเภทการร้องขอ</label>
    <?php 
echo $form->field($model, 'jobtitle')->dropDownList(ArrayHelper::map($jtitle->find()->where(['type' => 2])->all(), 'recid', 'titlename'))->label(false);
?>

    <label>หัวข้อเรื่อง</label>
    <?php 
echo $form->field($model, 'comment')->textInput()->label(false);
?>
<label>รูปแบบ</label>
    <?php 
echo $form->field($model, 'jobformat')->textInput(['maxlength' => true])->label(false);
?>
<label>เงื่อนไข</label>
    <?php 
echo $form->field($model, 'jobcondition')->textInput(['maxlength' => true])->label(false);
?>
<label>ไฟล์แนบ</label>