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

@@ -9,8 +9,9 @@ use frontend\components\HtmlHelper;
/* @var $form yii\widgets\ActiveForm */
?>
<h1><?php echo Yii::t('frontend/account','Select account!')?></h1>
<div class="account-form">
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'id_account')->dropDownList(HtmlHelper::mkAccountOptions($accounts)) ?>

View File

@@ -26,7 +26,6 @@ $this->params['breadcrumbs'][] = $this->title;
'accountName',
'userName',
'name',
'type',
'money',
'created_at:datetime',

View File

@@ -33,4 +33,8 @@ use yii\bootstrap\Html;
</div>
</div>
</div>
<?php echo Html::a(Yii::t('frontend/product', "Fizetve"),null,[ 'id' => 'btn_pay_customer_cart', 'class' => 'btn btn-primary' ]) ?>
<div class="row">
<div class='col-md-3 '>
<?php echo Html::a(Yii::t('frontend/product', "Paid"),null,[ 'id' => 'btn_pay_customer_cart', 'class' => 'btn btn-primary btn-block' , 'name' => 'payout_customer_cart']) ?>
</div>
</div>

View File

@@ -98,13 +98,10 @@ $discountOptions = mkOptions( ArrayHelper::map($discounts, 'id_discount', 'name'
</div>
</div>
<div class="row">
<div class='col-md-4'>
<?php echo Html::a(Yii::t("frontend/product","Sell product"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_sell'] );?>
</div>
<div class='col-md-4'>
<div class='col-md-6'>
<?php echo Html::a(Yii::t("frontend/product","To cart"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_sell_append'] );?>
</div>
<div class='col-md-4'>
<div class='col-md-6'>
<?php
if ( $receptionForm->isCardWithCustomer() ){
echo Html::a(Yii::t("frontend/product","Write up"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_add_to_customer_cart'] );

View File

@@ -1,5 +1,6 @@
<?php
use yii\bootstrap\Html;
use kartik\widgets\ActiveForm;
?>
@@ -33,8 +34,10 @@ use yii\bootstrap\Html;
</div>
</div>
</div>
<div class='row' >
<div class='col-md-3'>
<?php echo Html::a(Yii::t('frontend/product', "Paid"),null,[ 'id' => 'btn_pay_user_cart', 'class' => 'btn btn-primary btn-block' ]) ?>
<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

@@ -16,6 +16,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $this->render('_form', [
'model' => $model,
'receptionForm' => $receptionForm,
]) ?>
</div>

View File

@@ -33,6 +33,9 @@ $options['id_account'] = Account::readDefault();
$this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
$this->params['breadcrumbs'][] = Yii::t('frontend/product', 'Products') ;
$this->params['breadcrumbs'][] = Yii::t('frontend/product', 'Sale');
?>
<style>

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>

View File

@@ -0,0 +1,96 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
use yii\base\Widget;
?>
<div>
<div class="row">
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">Kiadva az adott időszakban</div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($searchModel->totalsCreatedAt['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
<dd class="text-right"><?php echo $acc['money'] ?></dd>
<?php
}
?>
<dt><?php echo Yii::t('frontend/transfer','Total') ?></dt>
<dd class="text-right"><?php echo $searchModel->totalsCreatedAt['total'] ?></dd>
</dl>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">Kiadva/nem fizetve az adott időszakban</div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($searchModel->totalsCreatedAtNotPaid['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
<dd class="text-right"><?php echo $acc['money'] ?></dd>
<?php
}
?>
<dt><?php echo Yii::t('frontend/transfer','Total') ?></dt>
<dd class="text-right"><?php echo $searchModel->totalsCreatedAtNotPaid['total'] ?></dd>
</dl>
</div>
</div>
</div>
<div class="col-md-4 ">
<div class="panel panel-info">
<div class="panel-heading">Kifizetve az adott időszakban</div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($searchModel->totalsPaidAt['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
<dd class="text-right"><?php echo $acc['money'] ?></dd>
<?php
}
?>
<dt><?php echo Yii::t('frontend/transfer','Total') ?></dt>
<dd class="text-right"><?php echo $searchModel->totalsPaidAt['total'] ?></dd>
</dl>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="panel panel-info">
<div class="panel-heading">Kiadva/fizetve az adott időszakban</div>
<div class="panel-body">
<dl class="dl-horizontal dl-totals">
<?php
foreach ($searchModel->totalsCreatedAtPaid['accounts'] as $acc ){
?>
<dt><?php echo $acc['label'] ?></dt>
<dd class="text-right"><?php echo $acc['money'] ?></dd>
<?php
}
?>
<dt><?php echo Yii::t('frontend/transfer','Total') ?></dt>
<dd class="text-right"><?php echo $searchModel->totalsCreatedAtPaid['total'] ?></dd>
</dl>
</div>
</div>
</div>
</div>
</div>

View File

@@ -2,12 +2,20 @@
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use frontend\components\HtmlHelper;
use common\models\Transfer;
use kartik\widgets\DateTimePicker;
/* @var $this yii\web\View */
/* @var $model common\models\TransferSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
$accountOptions = ['' =>'Mind']+ HtmlHelper::mkAccountOptions( $model->accounts );
?>
<div class="transfer-search">
<?php $form = ActiveForm::begin([
@@ -18,28 +26,41 @@ use yii\widgets\ActiveForm;
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
'format' => 'yyyy.mm.dd hh:ii'
]
]) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd hh:ii'
]
]) ?>
</div>
</div>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
</div>
<div class="col-md-4">
<?php //echo $form->field($model, 'type')->dropDownList( ['' =>'Mind']+ Transfer::types()) ?>
<?php echo $form->field($model, 'types')->checkboxList( Transfer::types()) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('frontend/transfer', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php
echo "types:";
print_r($model->types) ?>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,65 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Transfer */
?>
<?php
$formatter = Yii::$app->formatter;
?>
<div class="row">
<div class="col-md-12">
<div class='row row-transfer'>
<div class='col-md-4'>
<dl class="dl-horizontal dl-transfer">
<dt><?php echo $model->getAttributeLabel( 'id_transfer') ?></dt>
<dd><?php echo ( Html::getAttributeValue($model, 'id_transfer') ) ?></dd>
<dt><?php echo $model->getAttributeLabel( 'created_at') ?></dt>
<dd><?php echo $formatter->asDatetime( Html::getAttributeValue($model, 'created_at') ) ?></dd>
<dt><?php echo $model->getAttributeLabel( 'paid_at') ?></dt>
<dd><?php echo $formatter->asDatetime( Html::getAttributeValue($model, 'paid_at') ) ?></dd>
<dt><?php echo $model->getAttributeLabel( 'status') ?></dt>
<dd><?php echo Html::getAttributeValue($model, 'statusName') ?></dd>
</dl>
</div>
<div class='col-md-4'>
<dl class="dl-horizontal dl-transfer">
<dt><?php echo $model->getAttributeLabel( 'type') ?></dt>
<dd><?php echo Html::getAttributeValue($model, 'transferTypeName') ?></dd>
<dt><?php echo $model->getAttributeLabel( 'id_user') ?></dt>
<dd><?php echo Html::getAttributeValue($model, 'userName') ?></dd>
<dt><?php echo $model->getAttributeLabel( 'id_customer') ?></dt>
<dd><?php echo Html::getAttributeValue($model, 'customerName') ?></dd>
</dl>
</div>
<div class='col-md-3'>
<dl class="dl-horizontal dl-transfer">
<dt><?php echo $model->getAttributeLabel( 'item_price') ?></dt>
<dd class="text-right"><?php echo Html::getAttributeValue($model, 'item_price') ?></dd>
<dt><?php echo $model->getAttributeLabel( 'count') ?></dt>
<dd class="text-right"><?php echo Html::getAttributeValue($model, 'count') ?></dd>
<dt><?php echo $model->getAttributeLabel( 'id_discount') ?></dt>
<dd class="text-right"><?php echo Html::getAttributeValue($model, 'discountName') ?></dd>
<dt><?php echo $model->getAttributeLabel( 'money') ?></dt>
<dd class="text-right"><?php echo Html::getAttributeValue($model, 'signedMoney') ?></dd>
</dl>
</div>
</div>
</div>
</div>

View File

@@ -2,6 +2,8 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
use yii\base\Widget;
/* @var $this yii\web\View */
/* @var $searchModel common\models\TransferSearch */
@@ -10,39 +12,38 @@ use yii\grid\GridView;
$this->title = Yii::t('frontend/transfer', 'Transfers');
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
.dl-transfer{
margin-bottom: 0px;
}
.item-transfer{
border: 1px solid #b4b4b4;
margin-top: 12px;
padding-top: 6px;
padding-bottom: 6px;
}
</style>
<div class="transfer-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<?php echo $this->render('_index_stat', ['searchModel' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('frontend/transfer', 'Create Transfer'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id_transfer',
'id_discount',
'id_currency',
'id_object',
'status',
// 'type',
// 'item_price',
// 'count',
// 'money',
// 'money_currency',
// 'rate',
// 'id_user',
// 'comment',
// 'created_at',
// 'updated_at',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
<?php echo ListView::widget([
'dataProvider' => $dataProvider,
'itemView' => '_view' ,
'itemOptions' => ['class' => 'item-transfer']
] )
?>
</div>

View File

@@ -14,35 +14,43 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('frontend/transfer', 'Update'), ['update', 'id' => $model->id_transfer], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('frontend/transfer', 'Delete'), ['delete', 'id' => $model->id_transfer], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('frontend/transfer', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_transfer',
'id_discount',
'id_currency',
'id_object',
[
'attribute' => 'id_discount',
'value' => Html::getAttributeValue($model, 'discountName')
],
[
'attribute' => 'type',
'value' => $model->getTransferTypeName(),
'label' => 'Típus'
],
[
'attribute' => 'id_object',
'value' => $model->getObjectName(),
'label' => 'Megnevezés'
],
'status',
'type',
'item_price',
'count',
'money',
'money_currency',
'rate',
'id_user',
// 'money_currency',
// 'rate',
[
'attribute' => 'id_user',
'value' => $model->getUserName(),
// 'label' => 'Megnevezés'
],
'created_at:datetime',
'paid_at:datetime',
'comment',
'created_at',
'updated_at',
],
]) ?>