} | } | ||||
], | ], | ||||
[ | [ | ||||
'actions' => ['change-etablissement'], | |||||
'actions' => ['change-producer'], | |||||
'allow' => true, | 'allow' => true, | ||||
'roles' => ['@'], | 'roles' => ['@'], | ||||
'matchCallback' => function ($rule, $action) { | 'matchCallback' => function ($rule, $action) { |
'params' => [':date' => $dateStart] | 'params' => [':date' => $dateStart] | ||||
]) ; | ]) ; | ||||
foreach ($ordersArray as $order) { | |||||
$month = date('m/Y', strtotime($order->distribution->date)); | |||||
if (isset($data[$month])) { | |||||
$data[$month] += $order->amount; | |||||
if($ordersArray) { | |||||
foreach ($ordersArray as $order) { | |||||
$month = date('m/Y', strtotime($order->distribution->date)); | |||||
if (isset($data[$month])) { | |||||
$data[$month] += $order->amount; | |||||
} | |||||
} | } | ||||
} | } | ||||
{ | { | ||||
$dataProvider = new ActiveDataProvider([ | $dataProvider = new ActiveDataProvider([ | ||||
'query' => Subscription::find() | 'query' => Subscription::find() | ||||
->with(['user', 'producer', 'pointSale', 'productSubscription']) | |||||
->joinWith(['user']) | |||||
->where(['subscription.id_producer' => Producer::getId()]) | |||||
->orderBy('subscription.id_point_sale ASC, CASE `subscription`.`username` WHEN "" THEN `user`.`name` ELSE `subscription`.`username` END ASC'), | |||||
->with(['user', 'producer', 'pointSale', 'productSubscription', 'productSubscription.product']) | |||||
->joinWith(['user']) | |||||
->where(['subscription.id_producer' => Producer::getId()]) | |||||
->orderBy('subscription.id_point_sale ASC, CASE `subscription`.`username` WHEN "" THEN `user`.`name` ELSE `subscription`.`username` END ASC'), | |||||
'pagination' => [ | 'pagination' => [ | ||||
'pageSize' => 1000, | 'pageSize' => 1000, | ||||
], | ], |
*/ | */ | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use common\models\Producer; | |||||
use common\models\User; | |||||
use yii\widgets\ActiveForm; | |||||
use yii\helpers\ArrayHelper; | |||||
/* @var $this \yii\web\View */ | /* @var $this \yii\web\View */ | ||||
/* @var $content string */ | /* @var $content string */ | ||||
</li> | </li> | ||||
<!-- User Account: style can be found in dropdown.less --> | <!-- User Account: style can be found in dropdown.less --> | ||||
<li> | |||||
<li class="link-control-sidebar"> | |||||
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a> | <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a> | ||||
</li> | </li> | ||||
<?php if (User::isCurrentProducer() || User::isCurrentAdmin()): ?> | |||||
<li class="dropdown"> | |||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> | |||||
<span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span> | |||||
</a> | |||||
<?php if(User::isCurrentAdmin()): ?> | |||||
<ul class="dropdown-menu"> | |||||
<?php $producersArray = Producer::find()->orderBy('name ASC')->all(); ?> | |||||
<?php foreach($producersArray as $producer): ?> | |||||
<li><a href="<?= Yii::$app->urlManagerBackend->createUrl(['site/change-producer', 'id' => $producer->id]); ?>"><?= Html::encode($producer->name) ?></a></li> | |||||
<?php endforeach; ?> | |||||
</ul> | |||||
<?php endif; ?> | |||||
</li> | |||||
<?php endif; ?> | |||||
</ul> | </ul> | ||||
</div> | </div> | ||||
</nav> | </nav> |
</h3> | </h3> | ||||
</div> | </div> | ||||
<div class="panel-body"> | <div class="panel-body"> | ||||
<?php if(count($ordersArray)): ?> | |||||
<?php if(is_array($ordersArray) && count($ordersArray)): ?> | |||||
<table class="table table-condensed table-bordered"> | <table class="table table-condensed table-bordered"> | ||||
<thead> | <thead> | ||||
<tr> | <tr> |
$html = '' ; | $html = '' ; | ||||
foreach($model->productSubscription as $productSubscription) | foreach($model->productSubscription as $productSubscription) | ||||
{ | { | ||||
$html .= $productSubscription->quantity . ' x '.Html::encode($productSubscription->product->name).'<br />' ; | |||||
if(isset($productSubscription->product)) { | |||||
$html .= $productSubscription->quantity . ' x '.Html::encode($productSubscription->product->name).'<br />' ; | |||||
} | |||||
else { | |||||
$html .= 'Produit non défini<br />' ; | |||||
} | |||||
} | } | ||||
// aucun produit | // aucun produit |
.stats-products td.align-center { | .stats-products td.align-center { | ||||
text-align: center; | text-align: center; | ||||
} | } | ||||
/* line 3, ../sass/_adminlte.scss */ | |||||
.main-header .messages-menu, .main-header .notifications-menu, .main-header .tasks-menu, .main-header .user-menu, .main-header .link-control-sidebar { | |||||
display: none; | |||||
} |
.main-header { | |||||
.messages-menu, .notifications-menu, .tasks-menu, .user-menu, .link-control-sidebar { | |||||
display: none ; | |||||
} | |||||
} |
td.align-center { | td.align-center { | ||||
text-align: center ; | text-align: center ; | ||||
} | } | ||||
} | |||||
} | |||||
@import "_adminlte.scss" ; |