add frontend changes

This commit is contained in:
2015-10-30 09:28:58 +01:00
parent 4a04c9efa2
commit e34b150d74
41 changed files with 1083 additions and 254 deletions

View File

@@ -0,0 +1,41 @@
<?php
use yii\bootstrap\Html;
use kartik\widgets\ActiveForm;
?>
<h1><?php echo Yii::t('frontend/product','Customer cart')?></h1>
<div class="row">
<div class='col-md-12 '>
<div class="customer-cart">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>
<?php echo Yii::t('frontend/product', 'Product name')?>
</th>
<th>
<?php echo Yii::t('frontend/product', 'Count')?>
</th>
<th>
<?php echo Yii::t('frontend/product', 'Currency')?>
</th>
<th>
<?php echo Yii::t('frontend/product', 'Item Price')?>
</th>
<th>
<?php echo Yii::t('frontend/product', 'Total Price')?>
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class='col-md-3 '>
<?php $form = ActiveForm::begin([]); ?>
<?php echo Html::submitButton( Yii::t('frontend/product', "Paid") , [ 'id' => 'btn_pay_user_cart', 'class' => 'btn btn-primary btn-block', 'name' => 'payout_customer_cart' ] ) ?>
<?php ActiveForm::end(); ?>
</div>
</div>

View File

@@ -33,7 +33,9 @@ use common\models\Account;
<div class="col-md-12" >
<div class="ticket-form">
<?php $form = ActiveForm::begin(); ?>
<?php $form = ActiveForm::begin([
'id' => 'ticket_form',
]); ?>
<?= Html::activeHiddenInput($model, 'cart')?>
@@ -64,11 +66,18 @@ use common\models\Account;
<?= $form->field($model, 'comment')->textarea(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton( Yii::t('common/ticket', 'Create') , [ 'onclick' => ' $(\'#ticketcreate-cart\').val(\'\');','class' => 'btn btn-success' ]) ?>
<?= Html::submitButton( Yii::t('common/ticket', 'Create and add to cart') , [ 'onclick' => ' $(\'#ticketcreate-cart\').val(\'add\');', 'class' => 'btn btn-success' ]) ?>
</div>
<div class="row">
<div class='col-md-6'>
<?php echo Html::a(Yii::t("frontend/ticket","To cart"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_add_to_user_cart'] );?>
</div>
<div class='col-md-6'>
<?php
if ( $receptionForm->isCardWithCustomer() ){
echo Html::a(Yii::t("frontend/ticket","Write up"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_add_to_customer_cart'] );
}
?>
</div>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,43 @@
<?php
use yii\bootstrap\Html;
use kartik\widgets\ActiveForm;
?>
<h1><?php echo Yii::t('frontend/product','User Cart')?></h1>
<div class="row">
<div class='col-md-12 '>
<div class="user-cart">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>
<?php echo Yii::t('frontend/product', 'Product name')?>
</th>
<th>
<?php echo Yii::t('frontend/product', 'Count')?>
</th>
<th>
<?php echo Yii::t('frontend/product', 'Currency')?>
</th>
<th>
<?php echo Yii::t('frontend/product', 'Item Price')?>
</th>
<th>
<?php echo Yii::t('frontend/product', 'Total Price')?>
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class='row' >
<div class='col-md-3'>
<?php $form = ActiveForm::begin([]); ?>
<?php echo Html::submitButton(Yii::t('frontend/product', "Paid"),[ 'id' => 'btn_pay_user_cart', 'class' => 'btn btn-primary btn-block' , 'name' => 'payout_user_cart']) ?>
<?php ActiveForm::end(); ?>
</div>
</div>

View File

@@ -28,17 +28,13 @@ $options = [];
// $options['lookup_product_url'] = Url::toRoute(['product/lookup']);
$options['clear_cart_url'] = Url::toRoute(['product/clear-list']);
$options['types'] = TicketType::modelsToArray($ticketTypes);
$options['transfer_list'] = $userTransfers;
$options['user_cart'] = $model->userCart;
$options['customer_cart'] = $model->customerCart;
$this->registerJs ( 'new TicketSell( '. json_encode($options).');' );
?>
<div class="ticket-create">
<?php echo ReceptionWidget::widget( ['form' => $receptionForm, 'route' => ['customer/reception'] ] )?>
<div class="row">
<div class="col-md-6">
<h1><?= Html::encode($this->title) ?></h1>
@@ -47,13 +43,14 @@ $this->registerJs ( 'new TicketSell( '. json_encode($options).');' );
'discounts' => $discounts,
'ticketTypes' => $ticketTypes,
'accounts' => $accounts,
'receptionForm' => $receptionForm,
]) ?>
</div>
<div class="col-md-6">
<h1><?php echo Yii::t('frontend/ticket', 'Cart')?></h1>
<?php echo $this->render( "//common/_transfer_list" ) ?>
<?php echo Html::a(Yii::t('frontend/product', "Paid"),null,[ 'id' => 'btn_paid', 'class' => 'btn btn-primary' ]) ?>
<div class='col-md-6'>
<?php if ( $receptionForm->isCardWithCustomer() ){ ?>
<?php echo $this->render('_customer_cart' ) ?>
<?php }?>
<?php echo $this->render('_user_cart' ) ?>
</div>
</div>
</div>