fitness-web/frontend/views/product/_sale_form.php
2015-10-05 07:37:17 +02:00

106 lines
2.8 KiB
PHP

<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model frontend\models\ProductSaleForm */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $currencies common\models\Currency[] */
function mkOptions($options){
// $o = $options;
$all = ['' => '-' ];
$o = $all + $options;
return $o;
}
$currencyOptions = mkOptions( ArrayHelper::map($currencies, 'id_currency', 'name') );
$accountOptions = mkOptions( ArrayHelper::map($accounts, 'id_account', 'name') );
$discountOptions = mkOptions( ArrayHelper::map($discounts, 'id_discount', 'name') );
?>
<?php ?>
<div class="row">
<div class="col-md-12">
<?php echo $this->render('_view')?>
</div>
</div>
<div class="row">
<?php $form = ActiveForm::begin([
'id' => 'filter_text_form',
'class' =>'form-inline',
'layout' => 'horizontal',
'fieldConfig' => [
'horizontalCssClasses' => [
'label' => 'col-sm-5',
'offset' => 'col-sm-offset-6',
'wrapper' => 'col-sm-7',
'error' => '',
'hint' => '',
],
],
] )?>
<div class='col-md-12'>
<?php echo $form->field($lookupModel,'filter_text')->textInput(['id'=>'filter_text']); ?>
</div>
<?php ActiveForm::end()?>
</div>
<?php $form = ActiveForm::begin(
[
'id' => 'product_form',
'class' =>'form-inline',
'layout' => 'horizontal',
'fieldConfig' => [
'horizontalCssClasses' => [
'label' => 'col-sm-5',
'offset' => 'col-sm-offset-6',
'wrapper' => 'col-sm-7',
'error' => '',
'hint' => '',
],
],
]
); ?>
<?php echo Html::activeHiddenInput($model, 'id_product') ?>
<div class="row">
<div class='col-md-12'>
<?php echo $form->field($model, 'count')->input("number") ?>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<?php echo $form->field($model,'id_currency')->dropDownList($currencyOptions) ?>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<?php echo $form->field($model,'id_account')->dropDownList($accountOptions) ?>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<?php echo $form->field($model,'id_discount')->dropDownList($discountOptions) ?>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<?php echo $form->field( $model,'comment' )->textarea() ?>
</div>
</div>
<div class="row">
<div class='col-md-5'>
<?php echo Html::a(Yii::t("frontend/product","Sell product"),null,['class' => 'btn btn-success', 'id' => 'btn_sell'] );?>
</div>
<div class='col-md-7'>
<?php echo Html::a(Yii::t("frontend/product","Sell product and add to total"),null,['class' => 'btn btn-success', 'id' => 'btn_sell_append'] );?>
</div>
</div>
<?php ActiveForm::end(); ?>