|
|
|
|
|
|
|
|
use common\helpers\GlobalParam; |
|
|
use common\helpers\GlobalParam; |
|
|
use common\helpers\Price; |
|
|
use common\helpers\Price; |
|
|
use domain\Order\Order\OrderModule; |
|
|
use domain\Order\Order\OrderModule; |
|
|
|
|
|
use domain\Subscription\Subscription\SubscriptionModule; |
|
|
use domain\User\User\UserModule; |
|
|
use domain\User\User\UserModule; |
|
|
use domain\User\UserProducer\UserProducerModule; |
|
|
use domain\User\UserProducer\UserProducerModule; |
|
|
use yii\helpers\Html; |
|
|
use yii\helpers\Html; |
|
|
|
|
|
|
|
|
$orderModule = OrderModule::getInstance(); |
|
|
$orderModule = OrderModule::getInstance(); |
|
|
$userModule = UserModule::getInstance(); |
|
|
$userModule = UserModule::getInstance(); |
|
|
$userProducerModule = UserProducerModule::getInstance(); |
|
|
$userProducerModule = UserProducerModule::getInstance(); |
|
|
|
|
|
$subscriptionModule = SubscriptionModule::getInstance(); |
|
|
$userProducer = $userProducerModule->findOneUserProducer($model); |
|
|
$userProducer = $userProducerModule->findOneUserProducer($model); |
|
|
$username = Html::encode($userModule->getSolver()->getUsername($model)); |
|
|
$username = Html::encode($userModule->getSolver()->getUsername($model)); |
|
|
|
|
|
$producer = GlobalParam::getCurrentProducer(); |
|
|
$this->setTitle($username.' (#'.$model->id.')') ; |
|
|
$this->setTitle($username.' (#'.$model->id.')') ; |
|
|
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; |
|
|
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; |
|
|
$this->addBreadcrumb(['label' => $username]) ; |
|
|
$this->addBreadcrumb(['label' => $username]) ; |
|
|
|
|
|
|
|
|
<strong>Points de vente</strong> |
|
|
<strong>Points de vente</strong> |
|
|
<span class="pull-right"> |
|
|
<span class="pull-right"> |
|
|
<?php foreach($model->userPointSale as $userPointSale): ?> |
|
|
<?php foreach($model->userPointSale as $userPointSale): ?> |
|
|
<span class="label label-default"><?= $userPointSale->pointSale->name; ?></span> |
|
|
|
|
|
|
|
|
<?php if($userPointSale->pointSale->id_producer == $producer->id): ?> |
|
|
|
|
|
<span class="label label-default"><?= $userPointSale->pointSale->name; ?></span> |
|
|
|
|
|
<?php endif; ?> |
|
|
<?php endforeach; ?> |
|
|
<?php endforeach; ?> |
|
|
</span> |
|
|
</span> |
|
|
</li> |
|
|
</li> |
|
|
|
|
|
|
|
|
</h3> |
|
|
</h3> |
|
|
</div> |
|
|
</div> |
|
|
<div class="panel-body"> |
|
|
<div class="panel-body"> |
|
|
|
|
|
|
|
|
<?php $countOrders = $orderModule->getRepository()->countOrdersByUser($model); ?> |
|
|
<?php $countOrders = $orderModule->getRepository()->countOrdersByUser($model); ?> |
|
|
<?php if($countOrders): ?> |
|
|
<?php if($countOrders): ?> |
|
|
<ul class="list-group list-group-unbordered"> |
|
|
<ul class="list-group list-group-unbordered"> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<?php $hasSubscription = $subscriptionsArray && count($subscriptionsArray); ?> |
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<h3 class="panel-title"> |
|
|
|
|
|
<i class="glyphicon glyphicon-repeat"></i> |
|
|
|
|
|
Abonnements |
|
|
|
|
|
<?php if($hasSubscription): ?> |
|
|
|
|
|
<a class="btn btn-default btn-xs" href="<?= Yii::$app->urlManager->createUrl(['subscription/index','SubscriptionSearch[id_user]' => $model->id]) ?>"> |
|
|
|
|
|
<span class="glyphicon glyphicon-eye-open"></span> |
|
|
|
|
|
Voir |
|
|
|
|
|
</a> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<a class="btn btn-default btn-xs" href="<?= Yii::$app->urlManager->createUrl(['subscription/create']) ?>"> |
|
|
|
|
|
<span class="glyphicon glyphicon-plus"></span> |
|
|
|
|
|
Créer |
|
|
|
|
|
</a> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel-body"> |
|
|
|
|
|
<?php if($hasSubscription): ?> |
|
|
|
|
|
<ul class="list-group list-group-unbordered"> |
|
|
|
|
|
<?php foreach($subscriptionsArray as $subscription): ?> |
|
|
|
|
|
<li class="list-group-item"> |
|
|
|
|
|
<span class="pull-right"> |
|
|
|
|
|
<?= $subscriptionModule->getSolver()->getProductsListAsHtml($subscription) ?> |
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
|
|
<strong><?= $subscriptionModule->getSolver()->getDaysAsHtml($subscription) ?></strong> |
|
|
|
|
|
(<?= strtolower($subscriptionModule->getSolver()->getWeekFrequencyAsString($subscription)) ?>)<br /> |
|
|
|
|
|
<?= Html::encode($subscription->pointSale->name); ?><br /> |
|
|
|
|
|
<?= $subscriptionModule->getSolver()->getPeriodAsHtml($subscription) ?> |
|
|
|
|
|
|
|
|
|
|
|
<div class="clr"></div> |
|
|
|
|
|
</li> |
|
|
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
</ul> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<div class="alert alert-info"> |
|
|
|
|
|
Aucun abonnement |
|
|
|
|
|
</div> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<?php if(isset($pointSaleBillingArray) && $pointSaleBillingArray && count($pointSaleBillingArray) > 0): ?> |
|
|
<?php if(isset($pointSaleBillingArray) && $pointSaleBillingArray && count($pointSaleBillingArray) > 0): ?> |
|
|
<div class="panel panel-default"> |
|
|
<div class="panel panel-default"> |
|
|
<div class="panel-heading"> |
|
|
<div class="panel-heading"> |