/** * @return \yii\db\ActiveQuery */ public function getTblorders() { return $this->hasMany(Tblorders::className(), ['status_id' => 'status_id']); }
/** * @return \yii\db\ActiveQuery */ public function getOrder() { return $this->hasOne(Tblorders::className(), ['order_id' => 'order_id']); }
/* @var $this yii\web\View */ /* @var $model app\models\Tbleditorspayment */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="tbleditorspayment-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'editor_id')->dropDownList(ArrayHelper::map(Tbleditors::find()->all(), 'editor_id', 'editor_name'), ['prompt' => 'Select Editor']); ?> <?php echo $form->field($model, 'order_id')->dropDownList(ArrayHelper::map(Tblorders::find()->all(), 'order_id', 'title'), ['prompt' => 'Select Order']); ?> <?php echo $form->field($model, 'amount')->textInput(); ?> <?php echo '<label>Date and Time Expected</label>'; echo DateTimePicker::widget(['name' => 'date_updated', 'value' => $model->date_updated, 'options' => ['required' => true], 'pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii', 'startDate' => '01-Mar-2014 12:00 AM', 'todayHighlight' => true]]); ?> <?php echo $form->field($model, 'status')->textInput(['maxlength' => true]); ?> <div class="form-group">
use kartik\datetime\DateTimePicker; use app\models\Tbleditors; use kartik\select2\Select2; /* @var $this yii\web\View */ /* @var $model app\models\Tblorderassignment */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="tblorderassignment-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'order_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Tblorders::find()->all(), 'order_id', 'title'), 'options' => ['placeholder' => 'Select one'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'editor_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Tbleditors::find()->all(), 'editor_id', 'editor_name'), 'options' => ['placeholder' => 'Select one'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo '<label>Deadline</label>'; echo DateTimePicker::widget(['name' => 'dead_line', 'value' => $model->dead_line, 'options' => ['required' => true], 'pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii', 'startDate' => '01-Mar-2014 12:00 AM', 'todayHighlight' => true]]); echo $form->field($model, 'amount')->textInput(); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>
/** * Finds the Tblorders model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Tblorders the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Tblorders::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }