/**
  * Finds the Tbleditors model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Tbleditors the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Tbleditors::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEditor()
 {
     return $this->hasOne(Tbleditors::className(), ['editor_id' => 'editor_id']);
 }
Beispiel #3
0
/* @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>

<?php 
ActiveForm::end();
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTbleditors()
 {
     return $this->hasMany(Tbleditors::className(), ['country_id' => 'country_id']);
 }
Beispiel #5
0
use yii\helpers\ArrayHelper;
use app\models\Tbleditors;
use app\models\Tblorders;
use kartik\datetime\DateTimePicker;
/* @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 
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTbleditors()
 {
     return $this->hasMany(Tbleditors::className(), ['education_level_id' => 'education_level_id']);
 }