//use yii\widgets\ActiveForm; use yii\bootstrap\ActiveForm; use app\models\LibBedtype; use yii\helpers\ArrayHelper; use app\models\LibPttype; use app\models\LibAdmit; use app\models\LibDisc; use app\models\WorkloadDoctor; use yii\helpers\Url; //use yii\widgets\Pjax; //use yii\bootstrap\Modal; use kartik\popover\PopoverX; $lib_admit = ArrayHelper::map(LibAdmit::find()->all(), 'code', 'name'); $lib_pttype = ArrayHelper::map(LibPttype::find()->all(), 'code', 'name'); $lib_disc = ArrayHelper::map(LibDisc::find()->all(), 'code', 'name'); $lib_bedtype = ArrayHelper::map(LibBedtype::find()->all(), 'code', 'name'); $lib_doctor = ArrayHelper::map(WorkloadDoctor::find()->byWard()->all(), 'ref', 'Fullname'); $lib_item = $model->getItem(); $lib_tube = $model->getTube(); //print_r($lib_doctor); //print_r($lib_bedtype2); /* @var $this yii\web\View */ /* @var $model app\models\WorkloadEvent2 */ /* @var $form yii\widgets\ActiveForm */ ?> <?php function DateThai($strDate) { $strYear = date("Y", strtotime($strDate)) + 543;
} $i = 0; foreach ($patient as $v) { $i++; // echo $form->field($model, "[$v->hn]event_date", ['options' => ['value' => date("Y-m-d")]])->hiddenInput()->label(false); echo $form->field($model, "[{$v->hn}]event_date")->hiddenInput(['value' => date("Y-m-d")])->label(false); echo $form->field($model, "[{$v->hn}]event_period")->hiddenInput(['value' => '3'])->label(false); echo $form->field($model, "[{$v->hn}]hn")->hiddenInput(['value' => $v->hn])->label(false); echo $form->field($model, "[{$v->hn}]an")->hiddenInput(['value' => $v->an])->label(false); echo $form->field($model, "[{$v->hn}]ward")->hiddenInput(['value' => Yii::$app->session->get('user.ward')])->label(false); echo '<tr>'; echo '<td>'; if (isset($pv_data[$v->hn])) { $model->bed_type = $pv_data['bed_type'][$v->hn]; } echo $form->field($model, "[{$v->hn}]bed_type")->dropDownList(ArrayHelper::map(LibBedtype::find()->all(), 'code', 'name'))->label(false); echo '</td>'; echo '<td>'; if (isset($pv_data[$v->hn])) { $model->bed_no = $pv_data['bed_no'][$v->hn]; } echo $form->field($model, "[{$v->hn}]bed_no")->textInput()->label(false); echo '</td>'; echo '<td>'; echo $v->title . $v->name . '</br>' . $v->surname; echo '</td>'; echo '<td>'; if (isset($pv_data[$v->hn])) { $model->pt_type = $pv_data['pt_type'][$v->hn]; } echo $form->field($model, "[{$v->hn}]pt_type")->dropDownList(ArrayHelper::map(LibPttype::find()->all(), 'code', 'name'))->label(false);