fitness-web/frontend/views/product/sale.php
2015-10-21 17:57:16 +02:00

91 lines
2.3 KiB
PHP

<?php
use frontend\components\ReceptionMenuWidget;
use frontend\components\ReceptionCardNumberWidget;
use yii\helpers\Html;
use common\models\Product;
use frontend\assets\ProductSellAsset;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Discount;
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $currencies common\models\Currency[] */
ProductSellAsset::register($this);
$options = [];
$options['lookup_product_url'] = Url::toRoute(['product/lookup']);
$options['clear_list_url'] = Url::toRoute(['product/clear-list']);
$options['sold_items'] = $userTransfers;
$options['discounts'] = Discount::modelsToArray($discounts);
$this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
?>
<style>
/*
.product-form input, .product-form select, .product-form textarea{
width: 100%;
}
*/
.product-count{
text-align: right;
}
.form-group{
margin-bottom: 3px;
}
.table-transfers thead th{
text-align: center;
}
.table-transfers tfoot .product-money,
.table-transfers tfoot .product-count,
.table-transfers tbody .product-money,
.table-transfers tbody .product-count,
.table-transfers tbody .sale-price
{
text-align: right;
}
.table-transfers tbody .product-name,
.table-transfers tbody .product-time
{
text-align: center;
}
</style>
<div class='row'>
<div class='col-md-3'>
<?php echo ReceptionMenuWidget::widget( [ 'customer' => $customer, 'card' => $card] ) ?>
</div>
<div class='col-md-4'>
<?php echo ReceptionCardNumberWidget::widget( [ 'customer' => $customer, 'card' =>$card, 'route' => ['product/sale'] ] )?>
</div>
</div>
<div class='row '>
<div class='col-md-6 product-form'>
<h1><?php echo Yii::t('frontend/product','Sell product')?></h1>
<?php echo $this->render('_sale_form' ,['model' =>$model , 'lookupModel' =>$lookupModel, 'currencies' => $currencies, 'accounts' => $accounts,'discounts' => $discounts ]) ?>
</div>
<div class='col-md-6'>
<?php echo $this->render('_customer_cart' ) ?>
<h1><?php echo Yii::t('frontend/product','Cart')?></h1>
<?php echo $this->render('_sold_items' ) ?>
<?php echo Html::a(Yii::t('frontend/product', "Paid"),null,[ 'id' => 'btn_paid', 'class' => 'btn btn-primary' ]) ?>
</div>
</div>