Example #1
0
        </div>
        <div class="clearfix"></div>

        <div class="col-sm-4">
            <?php 
echo $form->field($model, 'category_id')->dropDownList(ArrayHelper::map(ProductCategories::find()->all(), 'id', 'name'))->hint('Category of the item');
?>
        </div>
        <div class="col-sm-4">
            <?php 
echo $form->field($model, 'warehouse_id')->dropDownList(ArrayHelper::map(Warehouse::find()->all(), 'id', 'name'))->hint('Warehouse Location');
?>
        </div>
        <div class="col-sm-4">
            <?php 
echo $form->field($model, 'status')->dropDownList(HelperComponents::getStatus())->hint('Serve as a tag if the product is available for purchase');
?>
        </div>
        <div class="clearfix"></div>
        <div class="col-sm-3">
            <?php 
echo $form->field($model, 'buy_price', ['addon' => ['prepend' => ['content' => '₱'], 'append' => ['content' => '.00']]])->textInput(['class' => 'text-align-right'])->hint('Buy price per item');
?>
        </div>
        <div class="col-sm-3">
            <?php 
echo $form->field($model, 'sell_price', ['addon' => ['prepend' => ['content' => '₱'], 'append' => ['content' => '.00']]])->textInput(['class' => 'text-align-right'])->hint('Selling price per item');
?>
        </div>
        <div class="col-md-3">
            <?php 
Example #2
0
echo $form->field($model, 'username')->textInput(['maxlength' => 500, 'autocomplete' => 'false']);
?>

    <?php 
$password_input = $form->field($model, 'password')->passwordInput(['maxlength' => 500, 'autocomplete' => 'false']);
?>
    <?php 
echo $model->isNewRecord ? $password_input : $password_input->hint('Please provide value to change password. Leave it blank to retain the old password.');
?>

    <?php 
echo $form->field($model, 'category_id')->dropDownList(UserAccounts::$user_categories);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(HelperComponents::getStatus());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        <?php 
echo Html::a('Cancel', ['index'], ['class' => 'btn btn-danger margin-10-left']);
?>
    </div>

    <?php 
ActiveForm::end();
?>