|
|
|
|
|
|
|
|
|
|
|
|
|
|
?> |
|
|
?> |
|
|
<div class="site-index"> |
|
|
<div class="site-index"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php if(Yii::$app->request->get('error_products_points_sale')): ?> |
|
|
<?php if(Yii::$app->request->get('error_products_points_sale')): ?> |
|
|
<div class="alert alert-danger">Vous devez saisir vos produits et vos points de vente |
|
|
|
|
|
avant d'initialiser vos jours de production.</div> |
|
|
|
|
|
|
|
|
<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 endif; ?> |
|
|
|
|
|
|
|
|
<div class="col-md-4"> |
|
|
|
|
|
<!-- commandes --> |
|
|
|
|
|
<div class=""> |
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<h3 class="panel-title"> |
|
|
|
|
|
Commandes |
|
|
|
|
|
<?= Html::a('Voir', ['order/index'], ['class' => 'btn btn-default btn-xs']) ; ?> |
|
|
|
|
|
</h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel-body"> |
|
|
|
|
|
<?php if(count($distributionsArray)): ?> |
|
|
|
|
|
<p>Prochaines distributions : </p> |
|
|
|
|
|
<table class="table table-bordered table-condensed"> |
|
|
|
|
|
<thead> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<th>Date</th> |
|
|
|
|
|
<th>Commandes</th> |
|
|
|
|
|
<th></th> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</thead> |
|
|
|
|
|
<tbody> |
|
|
|
|
|
<?php foreach($distributionsArray as $distribution): ?> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td><?= date('d/m/Y',strtotime($distribution['date'])); ?></td> |
|
|
|
|
|
<td><?= count($distribution->order); ?></td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<?= Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['order/index','date' => $distribution['date']], ['class' => 'btn btn-default btn-xs']) ; ?> |
|
|
|
|
|
<?php if(count($distribution->order)): ?><?= Html::a('<span class="glyphicon glyphicon-download-alt"></span>', ['order/report','date' => $distribution['date'],'global' => 1], ['class' => 'btn btn-default btn-xs']) ; ?><?php endif; ?> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</table> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<div class="alert alert-warning">Aucune production de programmée.</div> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<?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> |
|
|
</div> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
<!-- Clients --> |
|
|
|
|
|
<div class=""> |
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<h3 class="panel-title"> |
|
|
|
|
|
<?= $nbUsers; ?> client<?php if($nbUsers > 1): ?>s<?php endif; ?> |
|
|
|
|
|
<?= Html::a('Ajouter',['user/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?> |
|
|
|
|
|
<?= Html::a('Liste', ['user/index'], ['class' => 'btn btn-default btn-xs']) ; ?> |
|
|
|
|
|
</h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel-body"> |
|
|
|
|
|
<?php if($nbUsers): ?> |
|
|
|
|
|
<p>Dernières inscriptions :</p> |
|
|
|
|
|
<table class="table table-bordered table-condensed"> |
|
|
|
|
|
<thead> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<th>Prénom, nom</th> |
|
|
|
|
|
<th>Inscription</th> |
|
|
|
|
|
<th></th> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</thead> |
|
|
|
|
|
<tbody> |
|
|
|
|
|
<?php foreach($usersArray as $user): ?> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td><?= Html::encode($user['lastname'].' '.$user['name']) ?></td> |
|
|
|
|
|
<td><?= date('d/m/Y', $user['created_at']); ?></td> |
|
|
|
|
|
<td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['user/update','id' => $user['user_id']], ['class' => 'btn btn-default btn-xs']) ; ?></td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</table> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<div class="alert alert-warning">Aucun client.</div> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Clients crédit négatif --> |
|
|
|
|
|
<div class=""> |
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<h3 class="panel-title"> |
|
|
|
|
|
Clients au crédit pain négatif |
|
|
|
|
|
</h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel-body"> |
|
|
|
|
|
<?php if(count($usersNegativeCredit)): ?> |
|
|
|
|
|
<table class="table table-bordered table-condensed"> |
|
|
|
|
|
<thead> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<th>Prénom, nom</th> |
|
|
|
|
|
<th>Crédit pain</th> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</thead> |
|
|
|
|
|
<tbody> |
|
|
|
|
|
<?php foreach($usersNegativeCredit as $user): ?> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td><?= Html::encode($user['lastname'].' '.$user['name']) ?></td> |
|
|
|
|
|
<td><?= number_format($user['credit'],2) ?></td> |
|
|
|
|
|
<td><?= Html::a('<span class="glyphicon glyphicon-euro"></span>', ['user/credit','id' => $user['user_id']], ['class' => 'btn btn-default btn-xs']) ; ?></td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</table> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<div class="alert alert-warning">Aucun client.</div> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<?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> |
|
|
</div> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
<!-- Paramètres --> |
|
|
|
|
|
<div class=""> |
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<h3 class="panel-title"> |
|
|
|
|
|
Paramètres |
|
|
|
|
|
<?= Html::a('Configurer',['producer/update'],['class' => 'btn btn-default btn-xs']) ; ?> |
|
|
|
|
|
</h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel-body"> |
|
|
|
|
|
<table class="table table-bordered table-condensed"> |
|
|
|
|
|
<thead> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<th>Configuration</th> |
|
|
|
|
|
<th>Valeur</th> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</thead> |
|
|
|
|
|
<tbody> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>Producteur activé</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<?php if($producer->active): ?> |
|
|
|
|
|
<span class="label label-success">Active</span> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<span class="label label-danger">Hors-ligne</span> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>Producteur protégé par un code</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<?php if(strlen($producer->code)): ?> |
|
|
|
|
|
<span class="label label-success">Oui</span><br /> |
|
|
|
|
|
<strong><?= Html::encode($producer->code) ?></strong> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<span class="label label-danger">Non</span> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>Délai de commande</td> |
|
|
|
|
|
<td><?= $producer->order_delay ?> jour<?php if($producer->order_delay > 1): ?>s<?php endif; ?></td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>Heure limite de commande</td> |
|
|
|
|
|
<td><?= $producer->order_deadline ?>h</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>Système de Crédit activé</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<?php if($producer->credit): ?> |
|
|
|
|
|
<span class="label label-success">Oui</span><br /> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<span class="label label-danger">Non</span> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</table> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<?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', ['order/index'], ['class' => 'btn btn-default']); ?></span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- Mon abonnement --> |
|
|
|
|
|
<div class="" id="billing"> |
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<h3 class="panel-title"> |
|
|
|
|
|
Mon abonnement |
|
|
|
|
|
<?= Html::a('Voir',['producer/billing'],['class' => 'btn btn-default btn-xs']) ; ?> |
|
|
|
|
|
</h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel-body"> |
|
|
|
|
|
<div class="col-md-12"> |
|
|
|
|
|
<?php if(is_null($producer->free_price)): ?> |
|
|
|
|
|
<h2>Prix libre</h2> |
|
|
|
|
|
<p>Le modèle économique de <em>La boîte à pain</em> est basé sur un système de prix libre. <?= Html::a('En savoir plus',['producer/billing']); ?></p> |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
<h2><?= $producer->getFreePrice() ?> / mois <?= Html::a('Modifier',['producer/billing'],['class' => 'btn btn-xs btn-primary']) ?></h2> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
|
|
|
<div id="distributions"> |
|
|
|
|
|
<!-- distributions --> |
|
|
|
|
|
<?php if(count($distributionsArray)): ?> |
|
|
|
|
|
<?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>', ['order/index', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?> |
|
|
|
|
|
<?php if(count($distribution->order)): ?><?= Html::a('<span class="fa fa-download"></span>', ['order/report', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?><?php endif; ?> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
<?php endif; ?> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="col-md-8"> |
|
|
|
|
|
<!-- dernières commandes --> |
|
|
|
|
|
<div id="last-orders" class=""> |
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<h3 class="panel-title"> |
|
|
|
|
|
Dernières commandes clients |
|
|
|
|
|
</h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel-body"> |
|
|
|
|
|
<?php if(is_array($ordersArray) && count($ordersArray)): ?> |
|
|
|
|
|
|
|
|
<div class="clr"></div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- dernières commandes --> |
|
|
|
|
|
<?php if(is_array($ordersArray) && count($ordersArray)): ?> |
|
|
|
|
|
<div id="last-orders" class=""> |
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
|
|
<div class="panel-heading"> |
|
|
|
|
|
<h3 class="panel-title"> |
|
|
|
|
|
Commandes à venir |
|
|
|
|
|
</h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel-body"> |
|
|
<table class="table table-condensed table-bordered"> |
|
|
<table class="table table-condensed table-bordered"> |
|
|
<thead> |
|
|
<thead> |
|
|
<tr> |
|
|
<tr> |
|
|
|
|
|
|
|
|
<?php endforeach; ?> |
|
|
<?php endforeach; ?> |
|
|
</tbody> |
|
|
</tbody> |
|
|
</table> |
|
|
</table> |
|
|
<?php else: ?> |
|
|
|
|
|
<div class="alert alert-warning">Aucune commande</div> |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<?php endif; ?> |
|
|
</div> |
|
|
</div> |