|
|
@@ -41,6 +41,7 @@ use common\logic\Distribution\Distribution\Module\DistributionModule; |
|
|
|
use common\logic\Order\Order\Model\Order; |
|
|
|
use common\logic\Order\Order\Module\OrderModule; |
|
|
|
use common\logic\Producer\Producer\Module\ProducerModule; |
|
|
|
use common\logic\Setting\SettingModule; |
|
|
|
use common\logic\Subscription\Subscription\Module\SubscriptionModule; |
|
|
|
use common\logic\User\User\Module\UserModule; |
|
|
|
use yii\helpers\Html ; |
|
|
@@ -50,90 +51,129 @@ $userModule = UserModule::getInstance(); |
|
|
|
$orderModule = OrderModule::getInstance(); |
|
|
|
$subscriptionModule = SubscriptionModule::getInstance(); |
|
|
|
$producerModule = ProducerModule::getInstance(); |
|
|
|
$settingModule = SettingModule::getInstance(); |
|
|
|
$adminSettingBag = $settingModule->getAdminSettingBag(); |
|
|
|
|
|
|
|
$this->setTitle('Tableau de bord'); |
|
|
|
|
|
|
|
?> |
|
|
|
<div class="dashboard-index"> |
|
|
|
|
|
|
|
<?php if(Yii::$app->request->get('error_products_points_sale')): ?> |
|
|
|
<div class="alert alert-warning"> |
|
|
|
Vous devez ajouter <?php if(!$productsCount): ?> des produits<?php endif; ?> |
|
|
|
<?php if(!$productsCount && !$pointsSaleCount): ?> et<?php endif; ?> |
|
|
|
<?php if(!$pointsSaleCount): ?> un ou des points de vente <?php endif; ?> |
|
|
|
avant d'effectuer cette action. |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
<div <?php if($adminSettingBag->get('forumFlarumUrl')): ?>class="col-md-8"<?php endif; ?>> |
|
|
|
<?php if(Yii::$app->request->get('error_products_points_sale')): ?> |
|
|
|
<div class="alert alert-warning"> |
|
|
|
Vous devez ajouter <?php if(!$productsCount): ?> des produits<?php endif; ?> |
|
|
|
<?php if(!$productsCount && !$pointsSaleCount): ?> et<?php endif; ?> |
|
|
|
<?php if(!$pointsSaleCount): ?> un ou des points de vente <?php endif; ?> |
|
|
|
avant d'effectuer cette action. |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
<?php if(!$productsCount): ?> |
|
|
|
<div class="info-box"> |
|
|
|
<span class="info-box-icon bg-yellow"><i class="fa fa-clone"></i></span> |
|
|
|
<div class="info-box-content"> |
|
|
|
<span class="info-box-text"><br /><?= Html::a('Ajouter des produits', ['product/create'], ['class' => 'btn btn-default']); ?></span> |
|
|
|
<?php if(!$productsCount): ?> |
|
|
|
<div class="info-box"> |
|
|
|
<span class="info-box-icon bg-yellow"><i class="fa fa-clone"></i></span> |
|
|
|
<div class="info-box-content"> |
|
|
|
<span class="info-box-text"><br /><?= Html::a('Ajouter des produits', ['product/create'], ['class' => 'btn btn-default']); ?></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
<?php if(!$pointsSaleCount): ?> |
|
|
|
<div class="info-box"> |
|
|
|
<span class="info-box-icon bg-yellow"><i class="fa fa-map-marker"></i></span> |
|
|
|
<div class="info-box-content"> |
|
|
|
<span class="info-box-text"><br /><?= Html::a('Ajouter des points de vente', ['point-sale/create'], ['class' => 'btn btn-default']); ?></span> |
|
|
|
<?php if(!$pointsSaleCount): ?> |
|
|
|
<div class="info-box"> |
|
|
|
<span class="info-box-icon bg-yellow"><i class="fa fa-map-marker"></i></span> |
|
|
|
<div class="info-box-content"> |
|
|
|
<span class="info-box-text"><br /><?= Html::a('Ajouter des points de vente', ['point-sale/create'], ['class' => 'btn btn-default']); ?></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
<?php if($productsCount && $pointsSaleCount && !count($distributionsArray)): ?> |
|
|
|
<div class="info-box"> |
|
|
|
<span class="info-box-icon bg-yellow"><i class="fa fa-calendar"></i></span> |
|
|
|
<div class="info-box-content"> |
|
|
|
<span class="info-box-text"><br /><?= Html::a('Ajouter des jours de distribution', ['distribution/index'], ['class' => 'btn btn-default']); ?></span> |
|
|
|
<?php if($productsCount && $pointsSaleCount && !count($distributionsArray)): ?> |
|
|
|
<div class="info-box"> |
|
|
|
<span class="info-box-icon bg-yellow"><i class="fa fa-calendar"></i></span> |
|
|
|
<div class="info-box-content"> |
|
|
|
<span class="info-box-text"><br /><?= Html::a('Ajouter des jours de distribution', ['distribution/index'], ['class' => 'btn btn-default']); ?></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
<?php if(count($distributionsArray)): ?> |
|
|
|
<div id="distributions"> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
<h3 class="panel-title"> |
|
|
|
Prochaines distributions |
|
|
|
</h3> |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
<!-- distributions --> |
|
|
|
<?php foreach($distributionsArray as $distribution): ?> |
|
|
|
<div class="col-md-6 col-sm-12 col-xs-12"> |
|
|
|
<div class="info-box"> |
|
|
|
<span class="info-box-icon bg-green date"> |
|
|
|
<span class="day"><?= strftime('%A', strtotime($distribution->date)) ?></span> |
|
|
|
<span class="num"><?= date('d', strtotime($distribution->date)) ?></span> |
|
|
|
<span class="month"><?= strftime('%B', strtotime($distribution->date)) ?></span> |
|
|
|
</span> |
|
|
|
<div class="info-box-content"> |
|
|
|
<span class="info-box-text"> |
|
|
|
<?php if(count($distribution->order)): ?> |
|
|
|
<strong><?= count($distribution->order); ?></strong> COMMANDES |
|
|
|
<?php else: ?> |
|
|
|
AUCUNE COMMANDE |
|
|
|
<?php endif; ?> |
|
|
|
</span> |
|
|
|
<span class="info-box-number"></span> |
|
|
|
<div class="buttons"> |
|
|
|
<?= Html::a('<span class="fa fa-eye"></span>', ['distribution/index', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?> |
|
|
|
<?php if(count($distribution->order)): ?> |
|
|
|
<?php |
|
|
|
$exportsEnabledArray = $distributionModule->getExportManager()->getAllEnabled(); |
|
|
|
foreach($exportsEnabledArray as $name => $export) { |
|
|
|
echo Html::a('<span class="fa fa-download"></span>', ['distribution/export', 'name' => $name, 'date' => $distribution->date], ['class' => 'btn btn-default', 'title' => $export[0]]).' '; |
|
|
|
} |
|
|
|
?> |
|
|
|
<?php endif; ?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endforeach; ?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
<?php endif; ?> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php if(count($distributionsArray)): ?> |
|
|
|
<div id="distributions"> |
|
|
|
<?php if($adminSettingBag->get('forumFlarumUrl')): ?> |
|
|
|
<div class="col-md-4"> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
<h3 class="panel-title"> |
|
|
|
Prochaines distributions |
|
|
|
</h3> |
|
|
|
<h3 class="panel-title"> |
|
|
|
Derniers sujets sur le forum |
|
|
|
</h3> |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
<!-- distributions --> |
|
|
|
<?php foreach($distributionsArray as $distribution): ?> |
|
|
|
<div class="col-md-4 col-sm-12 col-xs-12"> |
|
|
|
<div class="info-box"> |
|
|
|
<span class="info-box-icon bg-green date"> |
|
|
|
<span class="day"><?= strftime('%A', strtotime($distribution->date)) ?></span> |
|
|
|
<span class="num"><?= date('d', strtotime($distribution->date)) ?></span> |
|
|
|
<span class="month"><?= strftime('%B', strtotime($distribution->date)) ?></span> |
|
|
|
</span> |
|
|
|
<div class="info-box-content"> |
|
|
|
<span class="info-box-text"> |
|
|
|
<?php if(count($distribution->order)): ?> |
|
|
|
<strong><?= count($distribution->order); ?></strong> COMMANDES |
|
|
|
<?php else: ?> |
|
|
|
AUCUNE COMMANDE |
|
|
|
<?php endif; ?> |
|
|
|
</span> |
|
|
|
<span class="info-box-number"></span> |
|
|
|
<div class="buttons"> |
|
|
|
<?= Html::a('<span class="fa fa-eye"></span>', ['distribution/index', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?> |
|
|
|
<?php if(count($distribution->order)): ?> |
|
|
|
<?php |
|
|
|
$exportsEnabledArray = $distributionModule->getExportManager()->getAllEnabled(); |
|
|
|
foreach($exportsEnabledArray as $name => $export) { |
|
|
|
echo Html::a('<span class="fa fa-download"></span>', ['distribution/export', 'name' => $name, 'date' => $distribution->date], ['class' => 'btn btn-default', 'title' => $export[0]]).' '; |
|
|
|
} |
|
|
|
?> |
|
|
|
<?php endif; ?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endforeach; ?> |
|
|
|
<?php //echo print_r($forumDiscussionsArray); ?> |
|
|
|
<?php if($forumDiscussionsArray && count($forumDiscussionsArray['data'])): ?> |
|
|
|
<table class="table"> |
|
|
|
<?php $forumDiscussionsLimitedArray = array_slice($forumDiscussionsArray['data'], 0, min(3, count($forumDiscussionsArray['data']))); ?> |
|
|
|
<?php foreach($forumDiscussionsLimitedArray as $forumDiscussion): ?> |
|
|
|
<tr> |
|
|
|
<?php //echo print_r($forumDiscussion); ?> |
|
|
|
<td><?= $forumDiscussion['attributes']['title']; ?></td> |
|
|
|
<td><?= date('d/m à H:i', strtotime($forumDiscussion['attributes']['lastPostedAt'])); ?></td> |
|
|
|
</tr> |
|
|
|
<?php endforeach; ?> |
|
|
|
</table> |
|
|
|
<?php else: ?> |
|
|
|
<p>Aucun sujet sur le forum.</p> |
|
|
|
<?php endif; ?> |
|
|
|
<p> |
|
|
|
<a href="<?= $settingModule->getAdminSettingBag()->get('forumFlarumUrl'); ?>" class="btn btn-default"> |
|
|
|
<span class="fa fa-comments"></span> |
|
|
|
Consulter le forum |
|
|
|
</a> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |