Exemple #1
0
/* @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">
Exemple #2
0
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>
 /**
  * Lists all Tblorders models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Tblorders::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }