|
|
|
|
|
|
|
|
?> |
|
|
?> |
|
|
|
|
|
|
|
|
<ul class="nav navbar-nav"> |
|
|
<ul class="nav navbar-nav"> |
|
|
|
|
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
$pastDistributionsArray = Distribution::find() |
|
|
|
|
|
->with('order') |
|
|
|
|
|
->where(['<', 'distribution.date', date('Y-m-d')]) |
|
|
|
|
|
->andWhere([ |
|
|
|
|
|
'distribution.id_producer' => Producer::getId(), |
|
|
|
|
|
'distribution.active' => 1 |
|
|
|
|
|
]) |
|
|
|
|
|
->orderBy('date DESC') |
|
|
|
|
|
->limit(3) |
|
|
|
|
|
->all(); |
|
|
|
|
|
|
|
|
|
|
|
$pastDistributionsArray = array_reverse($pastDistributionsArray) ; |
|
|
|
|
|
|
|
|
|
|
|
$incomingDistributionsArray = Distribution::find() |
|
|
|
|
|
->with('order') |
|
|
|
|
|
->where(['>=', 'distribution.date', date('Y-m-d')]) |
|
|
|
|
|
->andWhere([ |
|
|
|
|
|
'distribution.id_producer' => Producer::getId(), |
|
|
|
|
|
'distribution.active' => 1 |
|
|
|
|
|
]) |
|
|
|
|
|
->orderBy('date ASC') |
|
|
|
|
|
->limit(20) |
|
|
|
|
|
->all(); |
|
|
|
|
|
?> |
|
|
|
|
|
|
|
|
|
|
|
<li class="dropdown distributions-menu notifications-menu"> |
|
|
|
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
|
|
|
|
|
<i class="fa fa-calendar"></i> |
|
|
|
|
|
</a> |
|
|
|
|
|
<ul class="dropdown-menu"> |
|
|
|
|
|
|
|
|
|
|
|
<?php if(count($pastDistributionsArray)): ?> |
|
|
|
|
|
<li class="header">3 dernières distributions :</li> |
|
|
|
|
|
<li> |
|
|
|
|
|
<ul class="menu"> |
|
|
|
|
|
<?php foreach($pastDistributionsArray as $distribution): ?> |
|
|
|
|
|
<li> |
|
|
|
|
|
<a href="<?= Yii::$app->urlManagerBackend->createUrl(['distribution/index','date' => $distribution->date]) ; ?>"> |
|
|
|
|
|
<h5><?= strftime('%A %d %B', strtotime($distribution->date)) ?></h5> |
|
|
|
|
|
</a> |
|
|
|
|
|
</li> |
|
|
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
</ul> |
|
|
|
|
|
</li> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
|
|
|
<?php if(count($incomingDistributionsArray)): ?> |
|
|
|
|
|
<li class="header">Prochaines distributions :</li> |
|
|
|
|
|
<li> |
|
|
|
|
|
<ul class="menu"> |
|
|
|
|
|
<?php foreach($incomingDistributionsArray as $distribution): ?> |
|
|
|
|
|
<li> |
|
|
|
|
|
<a href="<?= Yii::$app->urlManagerBackend->createUrl(['distribution/index','date' => $distribution->date]) ; ?>"> |
|
|
|
|
|
<h5><?= strftime('%A %d %B', strtotime($distribution->date)) ?></h5> |
|
|
|
|
|
</a> |
|
|
|
|
|
</li> |
|
|
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
</ul> |
|
|
|
|
|
</li> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<li class="header"> |
|
|
|
|
|
Aucune distribution prévue.<br /> |
|
|
|
|
|
<a class="btn btn-default" href="<?= Yii::$app->urlManagerBackend->createUrl(['distribution/index']) ; ?>">Gérer mes distributions</a> |
|
|
|
|
|
</li> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</ul> |
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
|
<li class="dropdown users-menu notifications-menu"> |
|
|
<li class="dropdown users-menu notifications-menu"> |
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
|
|
<i class="fa fa-user-plus"></i> |
|
|
<i class="fa fa-user-plus"></i> |