return [ | return [ | ||||
'id' => 'app-backend', | 'id' => 'app-backend', | ||||
'name' => 'La boîte à pain', | |||||
'basePath' => dirname(__DIR__), | 'basePath' => dirname(__DIR__), | ||||
'controllerNamespace' => 'backend\controllers', | 'controllerNamespace' => 'backend\controllers', | ||||
'defaultRoute' => 'site/index', | 'defaultRoute' => 'site/index', | ||||
'errorAction' => 'site/error', | 'errorAction' => 'site/error', | ||||
], | ], | ||||
'urlManager' => $common_config_main['components']['urlManagerBackend'], | 'urlManager' => $common_config_main['components']['urlManagerBackend'], | ||||
'assetManager' => [ | |||||
'bundles' => [ | |||||
'dmstr\web\AdminLteAsset' => [ | |||||
'skin' => 'skin-black', | |||||
], | |||||
], | |||||
], | |||||
'view' => [ | |||||
'class' => 'common\components\MyView', | |||||
], | |||||
], | ], | ||||
'params' => $params, | 'params' => $params, | ||||
]; | ]; |
namespace backend\controllers; | namespace backend\controllers; | ||||
use common\models\Producer ; | |||||
class BackendController extends \common\controllers\CommonController | class BackendController extends \common\controllers\CommonController | ||||
{ | { | ||||
} | } | ||||
?> | ?> |
*/ | */ | ||||
$arrayOrders = Order::searchAll([ | $arrayOrders = Order::searchAll([ | ||||
'distribution.date' => $date | |||||
'distribution.date' => $date, | |||||
'distribution.id_producer' => $producer['id'] | |||||
], [ | |||||
'conditions' => 'date_delete IS NULL' | |||||
]) ; | ]) ; | ||||
$configCredit = Producer::getConfig('credit', $producer['id']) ; | |||||
foreach($arrayOrders as $order) { | foreach($arrayOrders as $order) { | ||||
if($order->payment_auto && Producer::getConfig('credit', $order->distribution->id_producer)) { | |||||
if($order->payment_auto && $configCredit) { | |||||
if ($order->getAmount(Order::AMOUNT_REMAINING) > 0) { | if ($order->getAmount(Order::AMOUNT_REMAINING) > 0) { | ||||
$order->saveCreditHistory( | $order->saveCreditHistory( | ||||
$arrayOrders = Order::searchAll([ | $arrayOrders = Order::searchAll([ | ||||
'distribution.date' => $date, | 'distribution.date' => $date, | ||||
'distribution.id_producer' => $producer['id'] | 'distribution.id_producer' => $producer['id'] | ||||
], [ | |||||
'conditions' => 'date_delete IS NULL' | |||||
]) ; | ]) ; | ||||
$user = User::searchOne([ | $user = User::searchOne([ |
use common\models\Product ; | use common\models\Product ; | ||||
use common\models\User ; | use common\models\User ; | ||||
use common\models\ProductDistribution ; | use common\models\ProductDistribution ; | ||||
use common\models\Distribution ; | |||||
class OrderController extends BackendController | class OrderController extends BackendController | ||||
{ | { | ||||
*/ | */ | ||||
public function actionIndex($date = '', $returnData = false) | public function actionIndex($date = '', $returnData = false) | ||||
{ | { | ||||
if (!Product::count() && !PointSale::count()) { | |||||
if (!Product::searchCount() || !PointSale::searchCount()) { | |||||
$this->redirect(['site/index', 'error_products_points_sale' => 1]); | $this->redirect(['site/index', 'error_products_points_sale' => 1]); | ||||
} | } | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function actionIndex() | public function actionIndex() | ||||
{ | |||||
$dataProvider = new ActiveDataProvider([ | |||||
'query' => PointSale::find()->where(['id_producer' => Producer::getId()]) | |||||
]); | |||||
{ | |||||
$searchModel = new PointSaleSearch() ; | |||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); | |||||
return $this->render('index', [ | return $this->render('index', [ | ||||
'searchModel' => $searchModel, | |||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, | ||||
]); | ]); | ||||
} | } | ||||
$model->processRestrictedAccess(); | $model->processRestrictedAccess(); | ||||
return $this->redirect(['index']); | return $this->redirect(['index']); | ||||
} else { | } else { | ||||
return $this->render('update', array_merge($this->initForm(), [ | |||||
return $this->render('create', array_merge($this->initForm(), [ | |||||
'model' => $model, | 'model' => $model, | ||||
])); | ])); | ||||
} | } |
*/ | */ | ||||
public function actionIndex() | public function actionIndex() | ||||
{ | { | ||||
$dataProvider = new ActiveDataProvider([ | |||||
'query' => Product::find() | |||||
->where(['id_producer' => Producer::getId()]) | |||||
->orderBy('order ASC'), | |||||
'pagination' => [ | |||||
'pageSize' => 1000, | |||||
], | |||||
]); | |||||
$searchModel = new ProductSearch() ; | |||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); | |||||
return $this->render('index', [ | return $this->render('index', [ | ||||
'searchModel' => $searchModel, | |||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, | ||||
]); | ]); | ||||
} | } | ||||
$productDistribution->active = 0; | $productDistribution->active = 0; | ||||
$productDistribution->save(); | $productDistribution->save(); | ||||
} | } | ||||
Yii::$app->getSession()->setFlash('success', 'Produit <strong>'.Html::encode($model->name).'</strong> ajouté'); | |||||
return $this->redirect(['index']); | return $this->redirect(['index']); | ||||
} else { | } else { | ||||
$model->save(); | $model->save(); | ||||
} | } | ||||
Yii::$app->getSession()->setFlash('success', 'Produit <strong>'.Html::encode($model->name).'</strong> modifié'); | |||||
return $this->redirect(['index']); | return $this->redirect(['index']); | ||||
} else { | } else { | ||||
return $this->render('update', [ | return $this->render('update', [ | ||||
*/ | */ | ||||
public function actionDelete($id) | public function actionDelete($id) | ||||
{ | { | ||||
$this->findModel($id)->delete(); | |||||
$model = $this->findModel($id) ; | |||||
$model->delete(); | |||||
ProductDistribution::deleteAll(['id_product' => $id]) ; | ProductDistribution::deleteAll(['id_product' => $id]) ; | ||||
Yii::$app->getSession()->setFlash('success', 'Produit <strong>'.Html::encode($model->name).'</strong> supprimé'); | |||||
return $this->redirect(['index']); | return $this->redirect(['index']); | ||||
} | } | ||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'actions' => ['change-etablissement'], | |||||
'actions' => ['change-producer'], | |||||
'allow' => true, | 'allow' => true, | ||||
'roles' => ['@'], | 'roles' => ['@'], | ||||
'matchCallback' => function ($rule, $action) { | 'matchCallback' => function ($rule, $action) { | ||||
'verbs' => [ | 'verbs' => [ | ||||
'class' => VerbFilter::className(), | 'class' => VerbFilter::className(), | ||||
'actions' => [ | 'actions' => [ | ||||
'logout' => ['post'], | |||||
], | ], | ||||
], | ], | ||||
]; | ]; | ||||
public function actionIndex() | public function actionIndex() | ||||
{ | { | ||||
// commandes | // commandes | ||||
$distributions = Distribution::find() | |||||
$distributionsArray = Distribution::find() | |||||
->with('order') | ->with('order') | ||||
->where(['>=', 'distribution.date', date('Y-m-d')]) | ->where(['>=', 'distribution.date', date('Y-m-d')]) | ||||
->andWhere([ | ->andWhere([ | ||||
'distribution.active' => 1 | 'distribution.active' => 1 | ||||
]) | ]) | ||||
->orderBy('date ASC') | ->orderBy('date ASC') | ||||
->limit(5) | |||||
->limit(3) | |||||
->all(); | ->all(); | ||||
// dernières commandes | // dernières commandes | ||||
->all(); | ->all(); | ||||
// paramètres | // paramètres | ||||
$producer = Producer::get(); | |||||
$producer = Producer::getCurrent(); | |||||
$productsCount = Product::searchCount() ; | |||||
$pointsSaleCount = PointSale::searchCount() ; | |||||
return $this->render('index', [ | return $this->render('index', [ | ||||
'distributionsArray' => $distributions, | |||||
'distributionsArray' => $distributionsArray, | |||||
'ordersArray' => $ordersArray, | 'ordersArray' => $ordersArray, | ||||
'usersArray' => $usersArray, | 'usersArray' => $usersArray, | ||||
'nbUsers' => $nbUsers, | 'nbUsers' => $nbUsers, | ||||
'usersNegativeCredit' => $usersNegativeCredit, | 'usersNegativeCredit' => $usersNegativeCredit, | ||||
'producer' => $producer, | 'producer' => $producer, | ||||
'productsCount' => $productsCount, | |||||
'pointsSaleCount' => $pointsSaleCount | |||||
]); | ]); | ||||
} | } | ||||
'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; | |||||
} | |||||
} | } | ||||
} | } | ||||
* @param integer $year | * @param integer $year | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function actionProducts($year = 0) | |||||
public function actionProducts($year = 0, $section = 1) | |||||
{ | { | ||||
if(!$year) $year = date('Y') ; | if(!$year) $year = date('Y') ; | ||||
$dataProducts[self::TOTALS]['orders'][$product['name']] = 0 ; | $dataProducts[self::TOTALS]['orders'][$product['name']] = 0 ; | ||||
} | } | ||||
if(!in_array($section, [1, 2, 3, 4])) { | |||||
$section = 1 ; | |||||
} | |||||
$iStart = (3 * ($section - 1)) + 1 ; | |||||
$iEnd = 3 * $section ; | |||||
$empty = true ; | $empty = true ; | ||||
for($i = 1; $i <= 12; $i++) { | |||||
for($i = $iStart; $i <= $iEnd; $i++) { | |||||
// Maximums | // Maximums | ||||
$resMaximums = Yii::$app->db->createCommand("SELECT product.name, SUM(IF(product_distribution.active, product_distribution.quantity_max,0)) AS total | $resMaximums = Yii::$app->db->createCommand("SELECT product.name, SUM(IF(product_distribution.active, product_distribution.quantity_max,0)) AS total | ||||
FROM distribution, product_distribution, product | FROM distribution, product_distribution, product | ||||
'monthArray' => $monthArray, | 'monthArray' => $monthArray, | ||||
'productsArray' => $productsArray, | 'productsArray' => $productsArray, | ||||
'dataProducts' => $dataProducts, | 'dataProducts' => $dataProducts, | ||||
'empty' => $empty | |||||
'empty' => $empty, | |||||
'section' => $section, | |||||
'iStart' => $iStart, | |||||
'iEnd' => $iEnd, | |||||
]); | ]); | ||||
} | } | ||||
*/ | */ | ||||
public function actionIndex() | public function actionIndex() | ||||
{ | { | ||||
$dataProvider = new ActiveDataProvider([ | |||||
'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'), | |||||
'pagination' => [ | |||||
'pageSize' => 1000, | |||||
], | |||||
]); | |||||
if (!Product::searchCount() || !PointSale::searchCount()) { | |||||
$this->redirect(['site/index', 'error_products_points_sale' => 1]); | |||||
} | |||||
$searchModel = new SubscriptionSearch ; | |||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); | |||||
return $this->render('index', [ | return $this->render('index', [ | ||||
'searchModel' => $searchModel, | |||||
'dataProvider' => $dataProvider | 'dataProvider' => $dataProvider | ||||
]); | ]); | ||||
} | } | ||||
if ($model->load(Yii::$app->request->post()) && $model->validate() | if ($model->load(Yii::$app->request->post()) && $model->validate() | ||||
&& $model->save()) | && $model->save()) | ||||
{ | { | ||||
$this->redirect(['subscription/index']); | |||||
Yii::$app->getSession()->setFlash('success', 'Abonnement ajouté'); | |||||
return $this->redirect(['subscription/index']); | |||||
} | } | ||||
return $this->render('create', [ | return $this->render('create', [ | ||||
$model->date_end = null; | $model->date_end = null; | ||||
} | } | ||||
if ($model->save()) { | if ($model->save()) { | ||||
$this->redirect(['subscription/index']); | |||||
Yii::$app->getSession()->setFlash('success', 'Abonnement modifié'); | |||||
return $this->redirect(['subscription/index']); | |||||
} | } | ||||
} | } | ||||
{ | { | ||||
ProductSubscription::deleteAll(['id_subscription' => $id]); | ProductSubscription::deleteAll(['id_subscription' => $id]); | ||||
Subscription::findOne($id)->delete(); | Subscription::findOne($id)->delete(); | ||||
$this->redirect(['subscription/index']); | |||||
Yii::$app->getSession()->setFlash('success', 'Abonnement supprimé'); | |||||
return $this->redirect(['subscription/index']); | |||||
} | } | ||||
} | } |
*/ | */ | ||||
public function actionIndex( | public function actionIndex( | ||||
$idPointSale = 0, $sectionInactiveUsers = false) | $idPointSale = 0, $sectionInactiveUsers = false) | ||||
{ | |||||
$params = Yii::$app->request->queryParams; | |||||
if($idPointSale) { | |||||
$params['id_point_sale'] = $idPointSale ; | |||||
} | |||||
if($sectionInactiveUsers) { | |||||
$params['inactive'] = true ; | |||||
} | |||||
$query = User::findBy($params); | |||||
$dataProvider = new ActiveDataProvider([ | |||||
'query' => $query, | |||||
'sort' => ['attributes' => ['lastname','name']], | |||||
]); | |||||
{ | |||||
$searchModel = new UserSearch ; | |||||
$dataProvider = $searchModel->search([ | |||||
'UserSearch' => array_merge( | |||||
[ | |||||
'id_point_sale' => $idPointSale, | |||||
'inactive' => (int) $sectionInactiveUsers | |||||
], | |||||
isset(Yii::$app->request->queryParams['UserSearch']) ? | |||||
Yii::$app->request->queryParams['UserSearch'] : | |||||
[] | |||||
) | |||||
]) ; | |||||
$producer = Producer::searchOne([ | $producer = Producer::searchOne([ | ||||
'id' => Producer::getId() | 'id' => Producer::getId() | ||||
$pointsSaleArray = PointSale::searchAll() ; | $pointsSaleArray = PointSale::searchAll() ; | ||||
return $this->render('index', [ | return $this->render('index', [ | ||||
'searchModel' => $searchModel, | |||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, | ||||
'producer' => $producer, | 'producer' => $producer, | ||||
'idPointSaleActive' => $idPointSale, | 'idPointSaleActive' => $idPointSale, | ||||
])->all() ; | ])->all() ; | ||||
$usersArray = []; | $usersArray = []; | ||||
foreach ($usersArray as $user) { | |||||
foreach ($users as $user) { | |||||
if (isset($user['email']) && strlen($user['email'])) | if (isset($user['email']) && strlen($user['email'])) | ||||
$usersArray[] = $user['email']; | $usersArray[] = $user['email']; | ||||
} | } | ||||
$pointSale = null ; | $pointSale = null ; | ||||
if($idPointSale) { | if($idPointSale) { | ||||
$pointSale = PointSale::findOne(['id' => $idPointSale, 'id_producer' => Producer::getId()]) ; | |||||
$pointSale = PointSale::findOne(['id' => $idPointSale]) ; | |||||
} | } | ||||
return $this->render('emails', [ | return $this->render('emails', [ | ||||
{ | { | ||||
$user = User::findOne($id); | $user = User::findOne($id); | ||||
$orders = Order::searchAll([ | |||||
$ordersArray = Order::searchAll([ | |||||
'id_user' => $id | 'id_user' => $id | ||||
], ['orderby' => 'distribution.date DESC']) ; | ], ['orderby' => 'distribution.date DESC']) ; | ||||
return $this->render('commandes', [ | |||||
return $this->render('orders', [ | |||||
'ordersArray' => $ordersArray, | 'ordersArray' => $ordersArray, | ||||
'user' => $user | 'user' => $user | ||||
]); | ]); |
public $id_producer ; | public $id_producer ; | ||||
public $type ; | public $type ; | ||||
public $amount ; | public $amount ; | ||||
public $means_payment ; | |||||
public $mean_payment ; | |||||
public $comment ; | public $comment ; | ||||
public $send_mail ; | public $send_mail ; | ||||
[['id_user', 'id_user_action', 'id_producer'], 'integer'], | [['id_user', 'id_user_action', 'id_producer'], 'integer'], | ||||
[['date','send_mail'], 'safe'], | [['date','send_mail'], 'safe'], | ||||
[['amount'], 'double'], | [['amount'], 'double'], | ||||
[['type', 'means_payment', 'comment'], 'string', 'max' => 255], | |||||
[['type', 'mean_payment', 'comment'], 'string', 'max' => 255], | |||||
]; | ]; | ||||
} | } | ||||
'amount' => 'Montant', | 'amount' => 'Montant', | ||||
'type' => 'Type', | 'type' => 'Type', | ||||
'id_producer' => 'Producteur', | 'id_producer' => 'Producteur', | ||||
'means_payment' => 'Moyen de paiement', | |||||
'mean_payment' => 'Moyen de paiement', | |||||
'comment' => 'Commentaire', | 'comment' => 'Commentaire', | ||||
'send_mail' => 'Prévenir l\'utilisateur', | 'send_mail' => 'Prévenir l\'utilisateur', | ||||
]; | ]; | ||||
$creditHistory->type = $this->type ; | $creditHistory->type = $this->type ; | ||||
$creditHistory->comment = $this->comment ; | $creditHistory->comment = $this->comment ; | ||||
$creditHistory->amount = $this->amount ; | $creditHistory->amount = $this->amount ; | ||||
$creditHistory->means_payment = $this->means_payment ; | |||||
$creditHistory->mean_payment = $this->mean_payment ; | |||||
$creditHistory->save(); | $creditHistory->save(); | ||||
// on prévient l'utilisateur que son compte vient d'être crédité | // on prévient l'utilisateur que son compte vient d'être crédité | ||||
if($this->send_mail) { | if($this->send_mail) { | ||||
$user = User::findOne($this->id_user) ; | $user = User::findOne($this->id_user) ; | ||||
$producer = Producer::get() ; | |||||
$producer = Producer::getCurrent() ; | |||||
$userProducer = UserProducer::searchOne([ | $userProducer = UserProducer::searchOne([ | ||||
'id_user' => $this->id_user | 'id_user' => $this->id_user | ||||
]); | ]); |
use yii\helpers\Html ; | use yii\helpers\Html ; | ||||
/* | |||||
* To change this license header, choose License Headers in Project Properties. | |||||
* To change this template file, choose Tools | Templates | |||||
* and open the template in the editor. | |||||
*/ | |||||
$this->title = 'Communiquer' ; | |||||
$this->setTitle('Communiquer') ; | |||||
$this->addBreadcrumb('Communiquer') ; | |||||
?> | ?> | ||||
<h1><?= Html::encode($this->title) ; ?></h1> | |||||
<p>Imprimez ce petit encart pour expliquer à vos clients comment passer leurs commandes.</p> | <p>Imprimez ce petit encart pour expliquer à vos clients comment passer leurs commandes.</p> | ||||
<?php echo $this->render('instructions', ['producer' => $producer]) ; ?> | <?php echo $this->render('instructions', ['producer' => $producer]) ; ?> | ||||
<p><?php echo Html::a('<span class="glyphicon glyphicon-download-alt"></span> Télécharger', ['communicate/instructions'], ['class'=>'btn btn-primary']) ?></p> | <p><?php echo Html::a('<span class="glyphicon glyphicon-download-alt"></span> Télécharger', ['communicate/instructions'], ['class'=>'btn btn-primary']) ?></p> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$this->setTitle('Ajouter un développement') ; | |||||
$this->addBreadcrumb(['label' => 'Développement', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb('Ajouter') ; | |||||
/* @var $this yii\web\View */ | |||||
/* @var $model common\models\Developpement */ | |||||
$this->title = 'Ajouter un développement'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Développement', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
?> | ?> | ||||
<div class="development-create"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="development-create"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
]) ?> | ]) ?> | ||||
</div> | </div> |
use common\models\User; | use common\models\User; | ||||
use common\helpers\Url; | use common\helpers\Url; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $dataProvider yii\data\ActiveDataProvider */ | |||||
$this->setTitle('Développement') ; | |||||
$this->addButton(['label' => '+', 'url' => ['development/create'], 'class' => 'btn btn-primary']) ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
$this->title = 'Développement'; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
?> | ?> | ||||
<div class="development-index"> | |||||
<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1> | |||||
<div class="development-index"> | |||||
<div class="well"> | <div class="well"> | ||||
Cette page liste les besoins recencés auprès des producteurs utilisant la plateforme. N'hésitez pas à me <a href="<?= Url::frontend('site/contact') ?>">contacter</a> pour la faire évoluer. Les remontées de bugs sont également bienvenues.<br /> | |||||
Cette page liste les besoins recencés auprès des producteurs utilisant la plateforme. N'hésitez pas à me <a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/contact']) ; ?>">contacter</a> pour la faire évoluer. Les remontées de bugs sont également bienvenues.<br /> | |||||
Afin d'orienter de manière pertinente le développement de la plateforme, je vous invite à définir la priorité des évolutions qui vous intéressent. | Afin d'orienter de manière pertinente le développement de la plateforme, je vous invite à définir la priorité des évolutions qui vous intéressent. | ||||
</div> | </div> | ||||
<?php | |||||
foreach (Yii::$app->session->getAllFlashes() as $key => $message) { | |||||
echo '<div class="alert alert-' . $key . '">' . $message . '</div>'; | |||||
} | |||||
?> | |||||
<ul id="tab-status-developments" class="nav nav-tabs" role="tablist"> | <ul id="tab-status-developments" class="nav nav-tabs" role="tablist"> | ||||
<li role="presentation" class="<?php if($status == Development::STATUS_OPEN): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['development/index','status' => Development::STATUS_OPEN]); ?>" id="" aria-controls="" role="tab">Ouvert</a></li> | <li role="presentation" class="<?php if($status == Development::STATUS_OPEN): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['development/index','status' => Development::STATUS_OPEN]); ?>" id="" aria-controls="" role="tab">Ouvert</a></li> | ||||
<li role="presentation" class="<?php if($status == Development::STATUS_CLOSED): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['development/index','status' => Development::STATUS_CLOSED]); ?>" id="" aria-controls="" role="tab">Fermé</a></li> | <li role="presentation" class="<?php if($status == Development::STATUS_CLOSED): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['development/index','status' => Development::STATUS_CLOSED]); ?>" id="" aria-controls="" role="tab">Fermé</a></li> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $model common\models\Developpement */ | |||||
$this->setTitle('Modifier un développement') ; | |||||
$this->addBreadcrumb(['label' => 'Développement', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => '#'.$model->id, 'url' => ['update', 'id' => $model->id]]) ; | |||||
$this->addBreadcrumb('Modifier') ; | |||||
$this->title = 'Modifier un développement'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Développement', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = ['label' => '#'.$model->id, 'url' => ['update', 'id' => $model->id]]; | |||||
$this->params['breadcrumbs'][] = 'Modifier'; | |||||
?> | ?> | ||||
<div class="development-update"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="development-update"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
]) ?> | ]) ?> | ||||
</div> | </div> |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
use yii\widgets\Breadcrumbs; | |||||
use dmstr\widgets\Alert; | |||||
?> | |||||
<div class="content-wrapper"> | |||||
<section class="content-header"> | |||||
<?php if (isset($this->blocks['content-header'])) { ?> | |||||
<h1><?= $this->blocks['content-header'] ?></h1> | |||||
<?php } else { ?> | |||||
<h1> | |||||
<?php | |||||
if ($this->title !== null) { | |||||
echo $this->title; | |||||
} else { | |||||
echo \yii\helpers\Inflector::camel2words( | |||||
\yii\helpers\Inflector::id2camel($this->context->module->id) | |||||
); | |||||
echo ($this->context->module->id !== \Yii::$app->id) ? '<small>Module</small>' : ''; | |||||
} ?> | |||||
<?php | |||||
if(count($this->buttons)) { | |||||
foreach($this->buttons as $button) { | |||||
echo '<a href="'.Yii::$app->urlManagerBackend->createUrl($button['url']).'" class="'.$button['class'].'">'.$button['label'].'</a>' ; | |||||
} | |||||
} | |||||
?> | |||||
</h1> | |||||
<?php } ?> | |||||
<?= | |||||
Breadcrumbs::widget( | |||||
[ | |||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | |||||
] | |||||
) ?> | |||||
</section> | |||||
<section class="content"> | |||||
<?= Alert::widget() ?> | |||||
<?= $content ?> | |||||
<div class="clr"></div> | |||||
</section> | |||||
</div> | |||||
<footer class="main-footer"> | |||||
<div class="pull-right hidden-xs"> | |||||
<b>Version</b> 2.0 | |||||
</div> | |||||
<strong>Copyright © 2014-2015 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights | |||||
reserved. | |||||
</footer> | |||||
<!-- Control Sidebar --> | |||||
<aside class="control-sidebar control-sidebar-dark"> | |||||
<!-- Create the tabs --> | |||||
<ul class="nav nav-tabs nav-justified control-sidebar-tabs"> | |||||
<li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li> | |||||
<li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li> | |||||
</ul> | |||||
<!-- Tab panes --> | |||||
<div class="tab-content"> | |||||
<!-- Home tab content --> | |||||
<div class="tab-pane" id="control-sidebar-home-tab"> | |||||
<h3 class="control-sidebar-heading">Recent Activity</h3> | |||||
<ul class='control-sidebar-menu'> | |||||
<li> | |||||
<a href='javascript::;'> | |||||
<i class="menu-icon fa fa-birthday-cake bg-red"></i> | |||||
<div class="menu-info"> | |||||
<h4 class="control-sidebar-subheading">Langdon's Birthday</h4> | |||||
<p>Will be 23 on April 24th</p> | |||||
</div> | |||||
</a> | |||||
</li> | |||||
<li> | |||||
<a href='javascript::;'> | |||||
<i class="menu-icon fa fa-user bg-yellow"></i> | |||||
<div class="menu-info"> | |||||
<h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4> | |||||
<p>New phone +1(800)555-1234</p> | |||||
</div> | |||||
</a> | |||||
</li> | |||||
<li> | |||||
<a href='javascript::;'> | |||||
<i class="menu-icon fa fa-envelope-o bg-light-blue"></i> | |||||
<div class="menu-info"> | |||||
<h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4> | |||||
<p>nora@example.com</p> | |||||
</div> | |||||
</a> | |||||
</li> | |||||
<li> | |||||
<a href='javascript::;'> | |||||
<i class="menu-icon fa fa-file-code-o bg-green"></i> | |||||
<div class="menu-info"> | |||||
<h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4> | |||||
<p>Execution time 5 seconds</p> | |||||
</div> | |||||
</a> | |||||
</li> | |||||
</ul> | |||||
<!-- /.control-sidebar-menu --> | |||||
<h3 class="control-sidebar-heading">Tasks Progress</h3> | |||||
<ul class='control-sidebar-menu'> | |||||
<li> | |||||
<a href='javascript::;'> | |||||
<h4 class="control-sidebar-subheading"> | |||||
Custom Template Design | |||||
<span class="label label-danger pull-right">70%</span> | |||||
</h4> | |||||
<div class="progress progress-xxs"> | |||||
<div class="progress-bar progress-bar-danger" style="width: 70%"></div> | |||||
</div> | |||||
</a> | |||||
</li> | |||||
<li> | |||||
<a href='javascript::;'> | |||||
<h4 class="control-sidebar-subheading"> | |||||
Update Resume | |||||
<span class="label label-success pull-right">95%</span> | |||||
</h4> | |||||
<div class="progress progress-xxs"> | |||||
<div class="progress-bar progress-bar-success" style="width: 95%"></div> | |||||
</div> | |||||
</a> | |||||
</li> | |||||
<li> | |||||
<a href='javascript::;'> | |||||
<h4 class="control-sidebar-subheading"> | |||||
Laravel Integration | |||||
<span class="label label-waring pull-right">50%</span> | |||||
</h4> | |||||
<div class="progress progress-xxs"> | |||||
<div class="progress-bar progress-bar-warning" style="width: 50%"></div> | |||||
</div> | |||||
</a> | |||||
</li> | |||||
<li> | |||||
<a href='javascript::;'> | |||||
<h4 class="control-sidebar-subheading"> | |||||
Back End Framework | |||||
<span class="label label-primary pull-right">68%</span> | |||||
</h4> | |||||
<div class="progress progress-xxs"> | |||||
<div class="progress-bar progress-bar-primary" style="width: 68%"></div> | |||||
</div> | |||||
</a> | |||||
</li> | |||||
</ul> | |||||
<!-- /.control-sidebar-menu --> | |||||
</div> | |||||
<!-- /.tab-pane --> | |||||
<!-- Settings tab content --> | |||||
<div class="tab-pane" id="control-sidebar-settings-tab"> | |||||
<form method="post"> | |||||
<h3 class="control-sidebar-heading">General Settings</h3> | |||||
<div class="form-group"> | |||||
<label class="control-sidebar-subheading"> | |||||
Report panel usage | |||||
<input type="checkbox" class="pull-right" checked/> | |||||
</label> | |||||
<p> | |||||
Some information about this general settings option | |||||
</p> | |||||
</div> | |||||
<!-- /.form-group --> | |||||
<div class="form-group"> | |||||
<label class="control-sidebar-subheading"> | |||||
Allow mail redirect | |||||
<input type="checkbox" class="pull-right" checked/> | |||||
</label> | |||||
<p> | |||||
Other sets of options are available | |||||
</p> | |||||
</div> | |||||
<!-- /.form-group --> | |||||
<div class="form-group"> | |||||
<label class="control-sidebar-subheading"> | |||||
Expose author name in posts | |||||
<input type="checkbox" class="pull-right" checked/> | |||||
</label> | |||||
<p> | |||||
Allow the user to show his name in blog posts | |||||
</p> | |||||
</div> | |||||
<!-- /.form-group --> | |||||
<h3 class="control-sidebar-heading">Chat Settings</h3> | |||||
<div class="form-group"> | |||||
<label class="control-sidebar-subheading"> | |||||
Show me as online | |||||
<input type="checkbox" class="pull-right" checked/> | |||||
</label> | |||||
</div> | |||||
<!-- /.form-group --> | |||||
<div class="form-group"> | |||||
<label class="control-sidebar-subheading"> | |||||
Turn off notifications | |||||
<input type="checkbox" class="pull-right"/> | |||||
</label> | |||||
</div> | |||||
<!-- /.form-group --> | |||||
<div class="form-group"> | |||||
<label class="control-sidebar-subheading"> | |||||
Delete chat history | |||||
<a href="javascript::;" class="text-red pull-right"><i class="fa fa-trash-o"></i></a> | |||||
</label> | |||||
</div> | |||||
<!-- /.form-group --> | |||||
</form> | |||||
</div> | |||||
<!-- /.tab-pane --> | |||||
</div> | |||||
</aside><!-- /.control-sidebar --> | |||||
<!-- Add the sidebar's background. This div must be placed | |||||
immediately after the control sidebar --> | |||||
<div class='control-sidebar-bg'></div> |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
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 $content string */ | |||||
?> | |||||
<header class="main-header"> | |||||
<?= Html::a('<span class="logo-mini"><img src="'.Yii::$app->urlManagerBackend->getBaseUrl().'/img/laboulange3.png" /></span><span class="logo-lg"><img src="'.Yii::$app->urlManagerBackend->getBaseUrl().'/img/laboulange3.png" /></span>', Yii::$app->homeUrl, ['class' => 'logo']) ?> | |||||
<nav class="navbar navbar-static-top" role="navigation"> | |||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button"> | |||||
<span class="sr-only">Toggle navigation</span> | |||||
</a> | |||||
<div class="navbar-custom-menu"> | |||||
<?php | |||||
$usersArray = User::findBy(['id_producer' => Producer::getId()]) | |||||
->andWhere('CAST(FROM_UNIXTIME(user.created_at) AS date) > \''.date("Y-m-d", strtotime("-7 days")).'\'') | |||||
->orderBy('created_at DESC') | |||||
->all(); | |||||
?> | |||||
<ul class="nav navbar-nav"> | |||||
<li class="dropdown users-menu notifications-menu"> | |||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> | |||||
<i class="fa fa-user-plus"></i> | |||||
<?php if(count($usersArray)): ?><span class="label label-success"><?= count($usersArray) ?></span> | |||||
<?php else: ?><span class="label label-warning">0</span><?php endif; ?> | |||||
</a> | |||||
<ul class="dropdown-menu"> | |||||
<li class="header">Inscriptions des 7 derniers jours</li> | |||||
<li> | |||||
<ul class="menu"> | |||||
<?php foreach($usersArray as $user): ?> | |||||
<li> | |||||
<a href="<?= Yii::$app->urlManagerBackend->createUrl(['user/update','id' => $user['user_id']]) ; ?>"> | |||||
<h5><?= Html::encode($user['name'].' '.$user['lastname']) ; ?> <small><i class="fa fa-clock-o"></i> <?= date('d/m/Y à H:i',$user['created_at']); ?></small></h5> | |||||
</a> | |||||
</li> | |||||
<?php endforeach; ?> | |||||
</ul> | |||||
</li> | |||||
</ul> | |||||
</li> | |||||
<?php | |||||
$usersNegativeCreditArray = User::findBy(['id_producer' => Producer::getId()]) | |||||
->andWhere('user_producer.credit < 0') | |||||
->orderBy('lastname, name ASC') | |||||
->all(); | |||||
?> | |||||
<li class="dropdown users-negative-credit-menu notifications-menu"> | |||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> | |||||
<i class="fa fa-euro"></i> | |||||
<?php if(count($usersNegativeCreditArray)): ?><span class="label label-warning"><?= count($usersNegativeCreditArray) ?></span> | |||||
<?php else: ?><span class="label label-success">0</span><?php endif; ?> | |||||
</a> | |||||
<ul class="dropdown-menu"> | |||||
<li class="header">Utilisateurs au crédit négatif</li> | |||||
<li> | |||||
<ul class="menu"> | |||||
<?php foreach($usersNegativeCreditArray as $user): ?> | |||||
<li> | |||||
<a href="<?= Yii::$app->urlManagerBackend->createUrl(['user/credit','id' => $user['user_id']]) ; ?>"> | |||||
<h5><?= Html::encode($user['name'].' '.$user['lastname']) ; ?> <small><i class="fa fa-euro"></i> <?= Price::format($user['credit']); ?></small></h5> | |||||
</a> | |||||
</li> | |||||
<?php endforeach; ?> | |||||
</ul> | |||||
</li> | |||||
</ul> | |||||
</li> | |||||
<?php if (User::isCurrentProducer() || User::isCurrentAdmin()): ?> | |||||
<li class="dropdown"> | |||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> | |||||
<i class="fa fa-home"></i> | |||||
<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; ?> | |||||
<!-- User Account: style can be found in dropdown.less --> | |||||
<li class="dropdown user user-menu"> | |||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> | |||||
<i class="fa fa-user"></i> | |||||
<span class="hidden-xs"><?= Html::encode(User::getCurrent()->name.' '.User::getCurrent()->lastname) ; ?></span> | |||||
</a> | |||||
<ul class="dropdown-menu"> | |||||
<li><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['user/update']); ?>"><i class="fa fa-user"></i> Profil</a></li> | |||||
<li><a href="<?= Yii::$app->urlManagerBackend->createUrl(['site/logout']); ?>"><i class="fa fa-sign-out"></i> Déconnexion</a></li> | |||||
</ul> | |||||
</li> | |||||
<!-- User Account: style can be found in dropdown.less --> | |||||
<li class="link-control-sidebar"> | |||||
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a> | |||||
</li> | |||||
</ul> | |||||
</div> | |||||
</nav> | |||||
</header> |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
?> | |||||
<aside class="main-sidebar"> | |||||
<section class="sidebar"> | |||||
<?= dmstr\widgets\Menu::widget( | |||||
[ | |||||
'options' => ['class' => 'sidebar-menu tree', 'data-widget'=> 'tree'], | |||||
'items' => [ | |||||
['label' => 'Tableau de bord','icon' => 'dashboard','url' => ['/site/index'], 'visible' => User::isCurrentProducer()], | |||||
['label' => 'Distributions','icon' => 'calendar','url' => ['/order/index'], 'visible' => User::isCurrentProducer()], | |||||
['label' => 'Abonnements','icon' => 'repeat','url' => ['/subscription/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'subscription'], | |||||
['label' => 'Produits','icon' => 'clone','url' => ['/product/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'product'], | |||||
['label' => 'Points de vente','icon' => 'map-marker','url' => ['/point-sale/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'point-sale'], | |||||
['label' => 'Utilisateurs','icon' => 'users','url' => ['/user/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'user'], | |||||
['label' => 'Paramètres','icon' => 'cog','url' => ['/producer/update'], 'visible' => User::isCurrentProducer()], | |||||
['label' => 'Communiquer','icon' => 'bullhorn','url' => ['/communicate/index'], 'visible' => User::isCurrentProducer()], | |||||
[ | |||||
'label' => 'Statistiques', | |||||
'icon' => 'line-chart', | |||||
'url' => '#', | |||||
'items' => [ | |||||
['label' => 'Chiffre d\'affaire','icon' => 'line-chart','url' => ['/stats/index'], 'visible' => User::isCurrentProducer()], | |||||
['label' => 'Produits','icon' => 'table','url' => ['/stats/products'], 'visible' => User::isCurrentProducer()], | |||||
], | |||||
], | |||||
['label' => 'Développement','icon' => 'wrench','url' => ['/development/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'development'], | |||||
['label' => 'Mon abonnement','icon' => 'euro','url' => ['/producer/billing'], 'visible' => User::isCurrentProducer()], | |||||
['label' => 'Administration', 'options' => ['class' => 'header'], 'visible' => User::isCurrentAdmin()], | |||||
['label' => 'Producteurs','icon' => 'th-list','url' => ['/producer-admin/index'], 'visible' => User::isCurrentAdmin()], | |||||
['label' => 'Outils', 'options' => ['class' => 'header'], 'visible' => User::isCurrentAdmin()], | |||||
['label' => 'Gii', 'icon' => 'file-code-o', 'url' => ['/gii'], 'visible' => User::isCurrentAdmin()], | |||||
['label' => 'Debug', 'icon' => 'dashboard', 'url' => ['/debug'], 'visible' => User::isCurrentAdmin()], | |||||
['label' => 'Login', 'url' => ['site/login'], 'visible' => !User::isCurrentConnected()], | |||||
/*[ | |||||
'label' => 'Some tools', | |||||
'icon' => 'share', | |||||
'url' => '#', | |||||
'items' => [ | |||||
['label' => 'Gii', 'icon' => 'file-code-o', 'url' => ['/gii'],], | |||||
['label' => 'Debug', 'icon' => 'dashboard', 'url' => ['/debug'],], | |||||
[ | |||||
'label' => 'Level One', | |||||
'icon' => 'circle-o', | |||||
'url' => '#', | |||||
'items' => [ | |||||
['label' => 'Level Two', 'icon' => 'circle-o', 'url' => '#',], | |||||
[ | |||||
'label' => 'Level Two', | |||||
'icon' => 'circle-o', | |||||
'url' => '#', | |||||
'items' => [ | |||||
['label' => 'Level Three', 'icon' => 'circle-o', 'url' => '#',], | |||||
['label' => 'Level Three', 'icon' => 'circle-o', 'url' => '#',], | |||||
], | |||||
], | |||||
], | |||||
], | |||||
], | |||||
],*/ | |||||
], | |||||
] | |||||
) ?> | |||||
</section> | |||||
</aside> |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
use backend\assets\AppAsset; | |||||
use yii\helpers\Html; | |||||
/* @var $this \yii\web\View */ | |||||
/* @var $content string */ | |||||
if (class_exists('backend\assets\AppAsset')) { | |||||
backend\assets\AppAsset::register($this); | |||||
} else { | |||||
app\assets\AppAsset::register($this); | |||||
} | |||||
dmstr\web\AdminLteAsset::register($this); | |||||
?> | |||||
<?php $this->beginPage() ?> | |||||
<!DOCTYPE html> | |||||
<html lang="<?= Yii::$app->language ?>"> | |||||
<head> | |||||
<meta charset="<?= Yii::$app->charset ?>"/> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<?= Html::csrfMetaTags() ?> | |||||
<title><?= Html::encode($this->title) ?></title> | |||||
<?php $this->head() ?> | |||||
</head> | |||||
<body class="login-page"> | |||||
<?php $this->beginBody() ?> | |||||
<?= $content ?> | |||||
<?php $this->endBody() ?> | |||||
</body> | |||||
</html> | |||||
<?php $this->endPage() ?> |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
use yii\helpers\Html; | |||||
use yii\bootstrap\Nav; | |||||
use yii\bootstrap\NavBar; | |||||
use yii\widgets\Breadcrumbs; | |||||
use common\models\Producer; | |||||
use common\models\User; | |||||
use yii\widgets\ActiveForm; | |||||
use yii\helpers\ArrayHelper; | |||||
use common\helpers\Url; | |||||
/* @var $this \yii\web\View */ | |||||
/* @var $content string */ | |||||
\common\assets\CommonAsset::register($this); | |||||
\backend\assets\AppAsset::register($this); | |||||
$producer = null ; | |||||
if(!Yii::$app->user->isGuest) { | |||||
$producer = Producer::findOne(Producer::getId()) ; | |||||
} | |||||
?> | |||||
<?php $this->beginPage() ?> | |||||
<!DOCTYPE html> | |||||
<html lang="<?= Yii::$app->language ?>"> | |||||
<head> | |||||
<meta charset="<?= Yii::$app->charset ?>"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<meta name="baseurl" content="<?= Yii::$app->urlManagerBackend->baseUrl ; ?>"> | |||||
<meta name="baseurl-absolute" content="<?= Yii::$app->urlManagerBackend->getHostInfo().Yii::$app->urlManagerBackend->baseUrl; ?>"> | |||||
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon3.png" /> | |||||
<?= Html::csrfMetaTags() ?> | |||||
<title><?= Html::encode($this->title) ?> - La boîte à pain</title> | |||||
<?php $this->head() ?> | |||||
</head> | |||||
<body> | |||||
<?php $this->beginBody() ?> | |||||
<div class="wrap"> | |||||
<?php | |||||
NavBar::begin([ | |||||
'brandLabel' => '<img class="logo" src="' . Yii::$app->urlManager->getBaseUrl() . '/img/laboulange3.png" />', | |||||
'brandUrl' => Yii::$app->homeUrl, | |||||
'innerContainerOptions' => ['class' => 'container-fluid'], | |||||
'options' => [ | |||||
'class' => 'navbar-inverse navbar-fixed-top nav-header', | |||||
], | |||||
]); | |||||
$menuItems = [ | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-home"></span> Tableau de bord', | |||||
'url' => ['/site/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes', | |||||
'url' => ['/order/index'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
'items' => [ | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-calendar"></span> Toutes les commandes', | |||||
'url' => ['/order/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-repeat"></span> Abonnements', | |||||
'url' => ['/subscription/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
] | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-grain"></span> Produits', | |||||
'url' => ['/product/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente', | |||||
'url' => ['/point-sale/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-user"></span> Clients', | |||||
'url' => ['/user/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-plus"></span>', | |||||
'url' => ['/producer/update'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
'items' => [ | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres', | |||||
'url' => ['/producer/update'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-bullhorn"></span> Communiquer', | |||||
'url' => ['/communicate/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-euro"></span> Mon abonnement', | |||||
'url' => ['/producer/billing'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-stats"></span> Statistiques', | |||||
'url' => ['/stats/index'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-stats"></span> Statistiques produits', | |||||
'url' => ['/stats/products'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-wrench"></span> Développement', | |||||
'url' => ['/development/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
], | |||||
] | |||||
]; | |||||
if (Yii::$app->user->isGuest) { | |||||
$menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']]; | |||||
} else { | |||||
if (Yii::$app->user->identity->status == USER::STATUS_ADMIN) { | |||||
$menuItems[] = [ | |||||
'label' => '<span class="glyphicon glyphicon-asterisk"></span>', | |||||
'url' => '#', | |||||
'items' => [ | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-th-list"></span> Producteurs', | |||||
'url' => ['producer-admin/index'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-euro"></span> Facturation', | |||||
'url' => ['producer-admin/billing'], | |||||
'visible' => false, | |||||
], | |||||
] | |||||
]; | |||||
} | |||||
$menuItems[] = [ | |||||
'label' => '<span class="glyphicon glyphicon-off"></span>', | |||||
'url' => ['/site/logout'], | |||||
'linkOptions' => ['data-method' => 'post', 'title' => 'Déconnexion'] | |||||
]; | |||||
$menuItems[] = [ | |||||
'label' => '<span class="retour-site">Retour sur le site</span>', | |||||
'url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index','slug_producer' => $producer->slug]), | |||||
]; | |||||
} | |||||
echo Nav::widget([ | |||||
'options' => ['class' => 'navbar-nav navbar-right'], | |||||
'items' => $menuItems, | |||||
'encodeLabels' => false | |||||
]); | |||||
NavBar::end(); | |||||
?> | |||||
<div class="container-fluid container-body"> | |||||
<?php if (YII_ENV == 'dev' || YII_ENV == 'demo'): ?> | |||||
<div id="env-dev"><?php if (YII_ENV == 'dev'): ?>Dév.<?php elseif (YII_ENV == 'demo'): ?>Démo<?php endif; ?></div> | |||||
<?php endif; ?> | |||||
<?php if (!Yii::$app->user->isGuest): ?> | |||||
<div class="name-producer"> | |||||
<?php if (User::getCurrentStatus() == User::STATUS_PRODUCER): ?> | |||||
<span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span> | |||||
<?php elseif (User::getCurrentStatus() == User::STATUS_ADMIN): ?> | |||||
<?php $form = ActiveForm::begin(['id' => 'select-producer']); ?> | |||||
<?= | |||||
Html::dropDownList('select_producer', Producer::getId(), ArrayHelper::map(Producer::find()->orderBy('name ASC')->all(), 'id', function($model, $defaultValue) { | |||||
return $model->name; | |||||
})); | |||||
?> | |||||
<?php ActiveForm::end(); ?> | |||||
<?php endif; ?> | |||||
<?php | |||||
$producer = Producer::findOne(Producer::getId()); | |||||
if (!$producer->active): | |||||
?> | |||||
<span class="label label-danger" data-toggle="tooltip" data-placement="bottom" data-original-title="Activez votre établissement quand vous le souhaitez afin de la rendre visible à vos clients."> | |||||
<?= Html::a('Hors-ligne', ['producer/update']); ?> | |||||
</span> | |||||
<?php endif; ?> | |||||
<div class="clr"></div> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php if (YII_ENV == 'demo'): ?> | |||||
<div id="block-demo"> | |||||
<div class="container-fluid"> | |||||
<span class="glyphicon glyphicon-eye-open"></span> <strong>Espace de démonstration</strong> : | |||||
Testez la plateforme sans avoir à vous inscrire. Les données sont réinitialisées quotidiennement • <?= Html::a('Retour', Url::env('prod', 'frontend')) ?> | |||||
</div> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?= | |||||
Breadcrumbs::widget([ | |||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | |||||
]) | |||||
?> | |||||
<?= $content ?> | |||||
</div> | |||||
</div> | |||||
<div id="alerts-fixed"></div> | |||||
<footer class="footer"> | |||||
<div class="container-fluid"> | |||||
<p class="pull-left"> | |||||
<a href="<?php echo Url::frontend('site/contact'); ?>">Contact</a> • | |||||
<a href="<?php echo Url::frontend('site/mentions'); ?>">Mentions légales</a> • | |||||
<a href="<?php echo Url::frontend('site/cgv'); ?>">CGS</a> | |||||
<a id="code-source" href="https://framagit.org/guillaume-bourgeois/laboiteapain">Code source <img src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/logo-framagit.png" alt="Hébergé par Framasoft" /> <img src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/logo-gitlab.png" alt="Propulsé par Gitlab" /></a> | |||||
</p> | |||||
<p class="pull-right"><?= Yii::powered() ?></p> | |||||
</div> | |||||
</footer> | |||||
<?php $this->endBody() ?> | |||||
<!-- analytics --> | |||||
<script> | |||||
(function (i, s, o, g, r, a, m) { | |||||
i['GoogleAnalyticsObject'] = r; | |||||
i[r] = i[r] || function () { | |||||
(i[r].q = i[r].q || []).push(arguments) | |||||
}, i[r].l = 1 * new Date(); | |||||
a = s.createElement(o), | |||||
m = s.getElementsByTagName(o)[0]; | |||||
a.async = 1; | |||||
a.src = g; | |||||
m.parentNode.insertBefore(a, m) | |||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); | |||||
ga('create', 'UA-86917043-1', 'auto'); | |||||
ga('send', 'pageview'); | |||||
</script> | |||||
</body> | |||||
</html> | |||||
<?php $this->endPage() ?> |
*/ | */ | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\bootstrap\Nav; | |||||
use yii\bootstrap\NavBar; | |||||
use yii\widgets\Breadcrumbs; | |||||
use common\models\Producer; | |||||
use common\models\User; | |||||
use yii\widgets\ActiveForm; | |||||
use yii\helpers\ArrayHelper; | |||||
use common\helpers\Url; | |||||
/* @var $this \yii\web\View */ | /* @var $this \yii\web\View */ | ||||
/* @var $content string */ | /* @var $content string */ | ||||
\common\assets\CommonAsset::register($this); | |||||
\backend\assets\AppAsset::register($this); | |||||
$producer = null ; | |||||
if(!Yii::$app->user->isGuest) { | |||||
$producer = Producer::findOne(Producer::getId()) ; | |||||
} | |||||
?> | |||||
<?php $this->beginPage() ?> | |||||
<!DOCTYPE html> | |||||
<html lang="<?= Yii::$app->language ?>"> | |||||
if (Yii::$app->controller->action->id === 'login') { | |||||
/** | |||||
* Do not use this code in your template. Remove it. | |||||
* Instead, use the code $this->layout = '//main-login'; in your controller. | |||||
*/ | |||||
echo $this->render( | |||||
'main-login', | |||||
['content' => $content] | |||||
); | |||||
} else { | |||||
\dmstr\web\AdminLteAsset::register($this); | |||||
\backend\assets\AppAsset::register($this); | |||||
$directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist'); | |||||
?> | |||||
<?php $this->beginPage() ?> | |||||
<!DOCTYPE html> | |||||
<html lang="<?= Yii::$app->language ?>"> | |||||
<head> | <head> | ||||
<meta charset="<?= Yii::$app->charset ?>"> | |||||
<meta charset="<?= Yii::$app->charset ?>"/> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | <meta name="viewport" content="width=device-width, initial-scale=1"> | ||||
<meta name="baseurl" content="<?= Yii::$app->urlManagerBackend->baseUrl ; ?>"> | <meta name="baseurl" content="<?= Yii::$app->urlManagerBackend->baseUrl ; ?>"> | ||||
<meta name="baseurl-absolute" content="<?= Yii::$app->urlManagerBackend->getHostInfo().Yii::$app->urlManagerBackend->baseUrl; ?>"> | <meta name="baseurl-absolute" content="<?= Yii::$app->urlManagerBackend->getHostInfo().Yii::$app->urlManagerBackend->baseUrl; ?>"> | ||||
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon3.png" /> | |||||
<?= Html::csrfMetaTags() ?> | <?= Html::csrfMetaTags() ?> | ||||
<title><?= Html::encode($this->title) ?> - La boîte à pain</title> | |||||
<?php $this->head() ?> | |||||
<title><?= Html::encode($this->title) ?></title> | |||||
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManagerBackend->getBaseUrl(); ?>/img/favicon3.png" /> | |||||
<?php $this->head() ?> | |||||
</head> | </head> | ||||
<body> | |||||
<?php $this->beginBody() ?> | |||||
<div class="wrap"> | |||||
<?php | |||||
NavBar::begin([ | |||||
'brandLabel' => '<img class="logo" src="' . Yii::$app->urlManager->getBaseUrl() . '/img/laboulange3.png" />', | |||||
'brandUrl' => Yii::$app->homeUrl, | |||||
'innerContainerOptions' => ['class' => 'container-fluid'], | |||||
'options' => [ | |||||
'class' => 'navbar-inverse navbar-fixed-top nav-header', | |||||
], | |||||
]); | |||||
$menuItems = [ | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-home"></span> Tableau de bord', | |||||
'url' => ['/site/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes', | |||||
'url' => ['/order/index'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
'items' => [ | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-calendar"></span> Toutes les commandes', | |||||
'url' => ['/order/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-repeat"></span> Abonnements', | |||||
'url' => ['/subscription/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
] | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-grain"></span> Produits', | |||||
'url' => ['/product/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente', | |||||
'url' => ['/point-sale/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-user"></span> Clients', | |||||
'url' => ['/user/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-plus"></span>', | |||||
'url' => ['/producer/update'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
'items' => [ | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres', | |||||
'url' => ['/producer/update'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-bullhorn"></span> Communiquer', | |||||
'url' => ['/communicate/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-euro"></span> Mon abonnement', | |||||
'url' => ['/producer/billing'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-stats"></span> Statistiques', | |||||
'url' => ['/stats/index'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-stats"></span> Statistiques produits', | |||||
'url' => ['/stats/products'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-wrench"></span> Développement', | |||||
'url' => ['/development/index'], | |||||
'visible' => !Yii::$app->user->isGuest | |||||
], | |||||
], | |||||
] | |||||
]; | |||||
if (Yii::$app->user->isGuest) { | |||||
$menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']]; | |||||
} else { | |||||
if (Yii::$app->user->identity->status == USER::STATUS_ADMIN) { | |||||
$menuItems[] = [ | |||||
'label' => '<span class="glyphicon glyphicon-asterisk"></span>', | |||||
'url' => '#', | |||||
'items' => [ | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-th-list"></span> Producteurs', | |||||
'url' => ['producer-admin/index'], | |||||
'visible' => !Yii::$app->user->isGuest, | |||||
], | |||||
[ | |||||
'label' => '<span class="glyphicon glyphicon-euro"></span> Facturation', | |||||
'url' => ['producer-admin/billing'], | |||||
'visible' => false, | |||||
], | |||||
] | |||||
]; | |||||
} | |||||
$menuItems[] = [ | |||||
'label' => '<span class="glyphicon glyphicon-off"></span>', | |||||
'url' => ['/site/logout'], | |||||
'linkOptions' => ['data-method' => 'post', 'title' => 'Déconnexion'] | |||||
]; | |||||
$menuItems[] = [ | |||||
'label' => '<span class="retour-site">Retour sur le site</span>', | |||||
'url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index','slug_producer' => $producer->slug]), | |||||
]; | |||||
} | |||||
echo Nav::widget([ | |||||
'options' => ['class' => 'navbar-nav navbar-right'], | |||||
'items' => $menuItems, | |||||
'encodeLabels' => false | |||||
]); | |||||
NavBar::end(); | |||||
?> | |||||
<div class="container-fluid container-body"> | |||||
<?php if (YII_ENV == 'dev' || YII_ENV == 'demo'): ?> | |||||
<div id="env-dev"><?php if (YII_ENV == 'dev'): ?>Dév.<?php elseif (YII_ENV == 'demo'): ?>Démo<?php endif; ?></div> | |||||
<?php endif; ?> | |||||
<?php if (!Yii::$app->user->isGuest): ?> | |||||
<div class="name-producer"> | |||||
<?php if (User::getCurrentStatus() == User::STATUS_PRODUCER): ?> | |||||
<span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span> | |||||
<?php elseif (User::getCurrentStatus() == User::STATUS_ADMIN): ?> | |||||
<?php $form = ActiveForm::begin(['id' => 'select-producer']); ?> | |||||
<?= | |||||
Html::dropDownList('select_producer', Producer::getId(), ArrayHelper::map(Producer::find()->orderBy('name ASC')->all(), 'id', function($model, $defaultValue) { | |||||
return $model->name; | |||||
})); | |||||
?> | |||||
<?php ActiveForm::end(); ?> | |||||
<?php endif; ?> | |||||
<?php | |||||
$producer = Producer::findOne(Producer::getId()); | |||||
if (!$producer->active): | |||||
?> | |||||
<span class="label label-danger" data-toggle="tooltip" data-placement="bottom" data-original-title="Activez votre établissement quand vous le souhaitez afin de la rendre visible à vos clients."> | |||||
<?= Html::a('Hors-ligne', ['producer/update']); ?> | |||||
</span> | |||||
<?php endif; ?> | |||||
<div class="clr"></div> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php if (YII_ENV == 'demo'): ?> | |||||
<div id="block-demo"> | |||||
<div class="container-fluid"> | |||||
<span class="glyphicon glyphicon-eye-open"></span> <strong>Espace de démonstration</strong> : | |||||
Testez la plateforme sans avoir à vous inscrire. Les données sont réinitialisées quotidiennement • <?= Html::a('Retour', Url::env('prod', 'frontend')) ?> | |||||
</div> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?= | |||||
Breadcrumbs::widget([ | |||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | |||||
]) | |||||
?> | |||||
<?= $content ?> | |||||
</div> | |||||
</div> | |||||
<div id="alerts-fixed"></div> | |||||
<footer class="footer"> | |||||
<div class="container-fluid"> | |||||
<p class="pull-left"> | |||||
<a href="<?php echo Url::frontend('site/contact'); ?>">Contact</a> • | |||||
<a href="<?php echo Url::frontend('site/mentions'); ?>">Mentions légales</a> • | |||||
<a href="<?php echo Url::frontend('site/cgv'); ?>">CGS</a> | |||||
<a id="code-source" href="https://framagit.org/guillaume-bourgeois/laboiteapain">Code source <img src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/logo-framagit.png" alt="Hébergé par Framasoft" /> <img src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/logo-gitlab.png" alt="Propulsé par Gitlab" /></a> | |||||
</p> | |||||
<p class="pull-right"><?= Yii::powered() ?></p> | |||||
</div> | |||||
</footer> | |||||
<?php $this->endBody() ?> | |||||
<!-- analytics --> | |||||
<script> | |||||
(function (i, s, o, g, r, a, m) { | |||||
i['GoogleAnalyticsObject'] = r; | |||||
i[r] = i[r] || function () { | |||||
(i[r].q = i[r].q || []).push(arguments) | |||||
}, i[r].l = 1 * new Date(); | |||||
a = s.createElement(o), | |||||
m = s.getElementsByTagName(o)[0]; | |||||
a.async = 1; | |||||
a.src = g; | |||||
m.parentNode.insertBefore(a, m) | |||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); | |||||
ga('create', 'UA-86917043-1', 'auto'); | |||||
ga('send', 'pageview'); | |||||
</script> | |||||
<body class="hold-transition <?= \dmstr\helpers\AdminLteHelper::skinClass() ?> sidebar-mini"> | |||||
<?php $this->beginBody() ?> | |||||
<div class="wrapper"> | |||||
<?= $this->render( | |||||
'header.php', | |||||
['directoryAsset' => $directoryAsset] | |||||
) ?> | |||||
<?= $this->render( | |||||
'left.php', | |||||
['directoryAsset' => $directoryAsset] | |||||
) | |||||
?> | |||||
<?= $this->render( | |||||
'content.php', | |||||
['content' => $content, 'directoryAsset' => $directoryAsset] | |||||
) ?> | |||||
</div> | |||||
<?php $this->endBody() ?> | |||||
<!-- analytics --> | |||||
<script> | |||||
(function (i, s, o, g, r, a, m) { | |||||
i['GoogleAnalyticsObject'] = r; | |||||
i[r] = i[r] || function () { | |||||
(i[r].q = i[r].q || []).push(arguments) | |||||
}, i[r].l = 1 * new Date(); | |||||
a = s.createElement(o), | |||||
m = s.getElementsByTagName(o)[0]; | |||||
a.async = 1; | |||||
a.src = g; | |||||
m.parentNode.insertBefore(a, m) | |||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); | |||||
ga('create', 'UA-86917043-1', 'auto'); | |||||
ga('send', 'pageview'); | |||||
</script> | |||||
</body> | </body> | ||||
</html> | |||||
<?php $this->endPage() ?> | |||||
</html> | |||||
<?php $this->endPage() ?> | |||||
<?php } ?> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $model backend\models\PointVente */ | |||||
$this->setTitle('Ajouter un point de vente') ; | |||||
$this->addBreadcrumb(['label' => 'Points de vente', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb('Ajouter') ; | |||||
$this->title = 'Ajouter un point de vente'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Points de vente', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = 'Ajouter'; | |||||
?> | ?> | ||||
<div class="point-sale-create"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="point-sale-create"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
'users' => $users, | 'users' => $users, | ||||
]) ?> | ]) ?> | ||||
</div> | </div> |
use yii\grid\GridView; | use yii\grid\GridView; | ||||
use common\models\PointVenteUser ; | use common\models\PointVenteUser ; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $dataProvider yii\data\ActiveDataProvider */ | |||||
$this->setTitle('Points de vente') ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
$this->addButton(['label' => '+', 'url' => 'point-sale/create', 'class' => 'btn btn-primary']) ; | |||||
$this->title = 'Points de vente'; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
?> | ?> | ||||
<div class="point-sale-index"> | |||||
<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1> | |||||
<div class="point-sale-index"> | |||||
<?= GridView::widget([ | <?= GridView::widget([ | ||||
'filterModel' => $searchModel, | |||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, | ||||
'columns' => [ | 'columns' => [ | ||||
'name', | 'name', | ||||
[ | [ | ||||
'attribute' => 'point_production', | 'attribute' => 'point_production', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'filter' => [0 => 'Non',1 => 'Oui'], | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
if($model->point_production) | if($model->point_production) | ||||
{ | { | ||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'delivery', | |||||
'label' => 'Livraison', | 'label' => 'Livraison', | ||||
'filter' => [ | |||||
'monday' => 'Lundi', | |||||
'tuesday' => 'Mardi', | |||||
'wednesday' => 'Mercredi', | |||||
'thursday' => 'Jeudi', | |||||
'friday' => 'Vendredi', | |||||
'saterday' => 'Samedi', | |||||
'sunday' => 'Dimanche', | |||||
], | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
return $model->getStrDeliveryDays() ; | return $model->getStrDeliveryDays() ; | ||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'acces_restreint', | |||||
'attribute' => 'access_type', | |||||
'label' => 'Accès', | |||||
'filter' => [ | |||||
'open' => 'Ouvert', | |||||
'code' => 'Code', | |||||
'restricted_access' => 'Accès restreint' | |||||
], | |||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) { | 'value' => function($model) { | ||||
$count = UserPointSale::find()->where(['id_point_sale' => $model->id])->count(); | $count = UserPointSale::find()->where(['id_point_sale' => $model->id])->count(); | ||||
[ | [ | ||||
'class' => 'yii\grid\ActionColumn', | 'class' => 'yii\grid\ActionColumn', | ||||
'template' => '{update} {delete}', | 'template' => '{update} {delete}', | ||||
'headerOptions' => ['class' => 'actions'], | |||||
'headerOptions' => ['class' => 'column-actions'], | |||||
'contentOptions' => ['class' => 'column-actions'], | |||||
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', $url, [ | |||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | 'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | ||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span> Suprimer', $url, [ | |||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | 'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | ||||
]); | ]); | ||||
} | } | ||||
], | ], | ||||
], | ], | ||||
]); ?> | ]); ?> | ||||
</div> | </div> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $model backend\models\PointVente */ | |||||
$this->setTitle('Modifier un point de vente') ; | |||||
$this->addBreadcrumb(['label' => 'Points de vente', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => Html::encode($model->name), 'url' => ['update', 'id' => $model->id]]) ; | |||||
$this->addBreadcrumb('Modifier') ; | |||||
$this->title = 'Modifier un point de vente'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Points de vente', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = ['label' => Html::encode($model->name), 'url' => ['update', 'id' => $model->id]]; | |||||
$this->params['breadcrumbs'][] = 'Modifier'; | |||||
?> | ?> | ||||
<div class="point-sale-update"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="point-sale-update"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
'users' => $users | 'users' => $users | ||||
]) ?> | ]) ?> | ||||
</div> | </div> |
use common\models\User ; | use common\models\User ; | ||||
use common\models\Producer ; | use common\models\Producer ; | ||||
$this->title = 'Producteurs'; | |||||
$this->params['breadcrumbs'][] = 'Administration' ; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
$this->setTitle('Producteurs') ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
?> | ?> | ||||
<h1>Producteurs</h1> | |||||
<?= GridView::widget([ | <?= GridView::widget([ | ||||
'dataProvider' => $dataProviderProducer, | 'dataProvider' => $dataProviderProducer, | ||||
'columns' => [ | 'columns' => [ |
use common\models\Producer ; | use common\models\Producer ; | ||||
use yii\bootstrap\ActiveForm; | use yii\bootstrap\ActiveForm; | ||||
$this->title = 'Mon abonnement'; | |||||
$this->params['breadcrumbs'][] = 'Administration' ; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
$this->setTitle('Mon abonnement') ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
?> | ?> | ||||
<h1>Mon abonnement</h1> | |||||
<p class=""> | |||||
<div class="well"> | |||||
Vous seuls savez ce que vous apporte cet outil et dans quelle mesure vous souhaitez le soutenir.<br /> | Vous seuls savez ce que vous apporte cet outil et dans quelle mesure vous souhaitez le soutenir.<br /> | ||||
C'est pourquoi le modèle économique est basé sur un prix libre facturé mensuellement.<br /> | C'est pourquoi le modèle économique est basé sur un prix libre facturé mensuellement.<br /> | ||||
</p> | |||||
</div> | |||||
<div id="free-price" class=""> | <div id="free-price" class=""> | ||||
use yii\widgets\ActiveForm; | use yii\widgets\ActiveForm; | ||||
use common\helpers\Url ; | use common\helpers\Url ; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $model common\models\User */ | |||||
$this->setTitle('Paramètres') ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
$this->title = 'Paramètres'; | |||||
$this->params['breadcrumbs'][] = 'Paramètres'; | |||||
?> | ?> | ||||
<div class="user-update"> | <div class="user-update"> | ||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="user-form"> | <div class="user-form"> | ||||
<?php $form = ActiveForm::begin(); ?> | <?php $form = ActiveForm::begin(); ?> | ||||
<div class=""> | <div class=""> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$this->setTitle('Ajouter un produit') ; | |||||
$this->addBreadcrumb(['label' => 'Produits', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb('Ajouter') ; | |||||
/* @var $this yii\web\View */ | |||||
/* @var $model app\models\Produit */ | |||||
$this->title = 'Ajouter un produit'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Produits', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = 'Ajouter'; | |||||
?> | ?> | ||||
<div class="product-create"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="product-create"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
]) ?> | ]) ?> | ||||
</div> | </div> |
use yii\grid\GridView; | use yii\grid\GridView; | ||||
use common\helpers\Url ; | use common\helpers\Url ; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $dataProvider yii\data\ActiveDataProvider */ | |||||
$this->setTitle('Produits') ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
$this->addButton(['label' => '+', 'url' => 'product/create', 'class' => 'btn btn-primary']) ; | |||||
$this->title = 'Produits'; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
?> | ?> | ||||
<div class="product-index"> | |||||
<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1> | |||||
<div class="product-index"> | |||||
<?= GridView::widget([ | <?= GridView::widget([ | ||||
'filterModel' => $searchModel, | |||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, | ||||
'columns' => [ | 'columns' => [ | ||||
[ | [ | ||||
'attribute' => 'order', | 'attribute' => 'order', | ||||
'headerOptions' => ['class' => 'order'], | 'headerOptions' => ['class' => 'order'], | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'filter' => '', | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
return '<a class="btn-order btn btn-default" href="javascript:void(0);"><span class="glyphicon glyphicon-resize-vertical"></span></a>' ; | return '<a class="btn-order btn btn-default" href="javascript:void(0);"><span class="glyphicon glyphicon-resize-vertical"></span></a>' ; | ||||
} | } | ||||
'attribute' => 'photo', | 'attribute' => 'photo', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'headerOptions' => ['class' => 'td-photo'], | 'headerOptions' => ['class' => 'td-photo'], | ||||
'filter' => '', | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
if(strlen($model->photo)) { | if(strlen($model->photo)) { | ||||
$url = Yii::$app->urlManagerProducer->getBaseUrl() ; | $url = Yii::$app->urlManagerProducer->getBaseUrl() ; | ||||
'headerOptions' => ['class' => 'active'], | 'headerOptions' => ['class' => 'active'], | ||||
'contentOptions' => ['class' => 'center'], | 'contentOptions' => ['class' => 'center'], | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'filter' => [0 => 'Non', 1 => 'Oui'], | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
if($model->active) | if($model->active) | ||||
{ | { | ||||
[ | [ | ||||
'class' => 'yii\grid\ActionColumn', | 'class' => 'yii\grid\ActionColumn', | ||||
'template' => '{update} {delete}', | 'template' => '{update} {delete}', | ||||
'headerOptions' => ['class' => 'actions'], | |||||
'headerOptions' => ['class' => 'column-actions'], | |||||
'contentOptions' => ['class' => 'column-actions'], | |||||
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', $url, [ | |||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | 'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | ||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span> Suprimer', $url, [ | |||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | 'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | ||||
]); | ]); | ||||
} | } | ||||
], | ], | ||||
], | ], | ||||
]); ?> | ]); ?> | ||||
</div> | </div> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $model app\models\Produit */ | |||||
$this->title = 'Modifier un produit'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Produits', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['update', 'id' => $model->id]]; | |||||
$this->params['breadcrumbs'][] = 'Modifier'; | |||||
?> | |||||
<div class="product-update"> | |||||
$this->setTitle('Modifier un produit') ; | |||||
$this->addBreadcrumb(['label' => 'Produits', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => $model->name, 'url' => ['update', 'id' => $model->id]]) ; | |||||
$this->addBreadcrumb('Modifier') ; | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
?> | |||||
<div class="product-update"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
]) ?> | ]) ?> | ||||
</div> | </div> |
$this->title = $name; | $this->title = $name; | ||||
?> | ?> | ||||
<div class="site-error"> | |||||
<section class="content"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="error-page"> | |||||
<h2 class="headline text-info"><i class="fa fa-warning text-yellow"></i></h2> | |||||
<div class="alert alert-danger"> | |||||
<?= nl2br(Html::encode($message)) ?> | |||||
</div> | |||||
<div class="error-content"> | |||||
<h3><?= $name ?></h3> | |||||
<p> | |||||
<?= nl2br(Html::encode($message)) ?> | |||||
</p> | |||||
<p> | |||||
The above error occurred while the Web server was processing your request. | |||||
Please contact us if you think this is a server error. Thank you. | |||||
Meanwhile, you may <a href='<?= Yii::$app->homeUrl ?>'>return to dashboard</a> or try using the search | |||||
form. | |||||
</p> | |||||
<p> | |||||
The above error occurred while the Web server was processing your request. | |||||
</p> | |||||
<p> | |||||
Please contact us if you think this is a server error. Thank you. | |||||
</p> | |||||
<form class='search-form'> | |||||
<div class='input-group'> | |||||
<input type="text" name="search" class='form-control' placeholder="Search"/> | |||||
<div class="input-group-btn"> | |||||
<button type="submit" name="submit" class="btn btn-primary"><i class="fa fa-search"></i> | |||||
</button> | |||||
</div> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</section> |
?> | ?> | ||||
<div class="site-index"> | <div class="site-index"> | ||||
<?php if(!$producer->getFreePrice()): ?> | |||||
<div class="callout callout-info"> | |||||
<h4>Abonnement à prix libre</h4> | |||||
<p><i>La boîte à pain</i> fonctionne avec système d'abonnement à prix libre pour en | |||||
assurer la plus grande diffusion possible. Ceci correspond également à l'unique source de revenus | |||||
nécessaire à la maintenance et au développement de la plateforme.<br /> | |||||
Si cet outil est important dans votre activité, nous vous encourageons à nous soutenir en vous abonnant. | |||||
</p> | |||||
<p><?= Html::a('> Définir le montant de mon abonnement', ['producer/billing'], ['class' => 'btn btn-default']); ?></p> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?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(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> |
termes. | termes. | ||||
*/ | */ | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\bootstrap\ActiveForm; | use yii\bootstrap\ActiveForm; | ||||
/* @var $form yii\bootstrap\ActiveForm */ | /* @var $form yii\bootstrap\ActiveForm */ | ||||
/* @var $model \common\models\LoginForm */ | /* @var $model \common\models\LoginForm */ | ||||
$this->title = 'Connexion'; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
$this->title = 'Sign In'; | |||||
$fieldOptions1 = [ | |||||
'options' => ['class' => 'form-group has-feedback'], | |||||
'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>" | |||||
]; | |||||
$fieldOptions2 = [ | |||||
'options' => ['class' => 'form-group has-feedback'], | |||||
'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>" | |||||
]; | |||||
?> | ?> | ||||
<div class="site-login"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="row"> | |||||
<div class="col-lg-5"> | |||||
<?php if(YII_ENV == 'demo') : ?> | |||||
<div class="alert alert-warning"> | |||||
Identifiant : <strong>producteur@laboiteapain.net</strong><br /> | |||||
Mot de passe : <strong>laboiteapain</strong> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?> | |||||
<?= $form->field($model, 'email') ?> | |||||
<?= $form->field($model, 'password')->passwordInput() ?> | |||||
<div class="login-box"> | |||||
<div class="login-logo"> | |||||
<img src="<?= Yii::$app->urlManagerBackend->getBaseUrl(); ?>/img/laboulange4.png" /> | |||||
La boîte à pain | |||||
</div> | |||||
<!-- /.login-logo --> | |||||
<div class="login-box-body"> | |||||
<?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?> | |||||
<?= $form | |||||
->field($model, 'email', $fieldOptions1) | |||||
->label(false) | |||||
->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?> | |||||
<?= $form | |||||
->field($model, 'password', $fieldOptions2) | |||||
->label(false) | |||||
->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?> | |||||
<div class="row"> | |||||
<div class="col-xs-8"> | |||||
<?= $form->field($model, 'rememberMe')->checkbox() ?> | <?= $form->field($model, 'rememberMe')->checkbox() ?> | ||||
<div class="form-group"> | |||||
<?= Html::submitButton('Connexion', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?> | |||||
</div> | |||||
<?php ActiveForm::end(); ?> | |||||
</div> | |||||
<!-- /.col --> | |||||
<div class="col-xs-4"> | |||||
<?= Html::submitButton('Connexion', ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?> | |||||
</div> | |||||
<!-- /.col --> | |||||
</div> | </div> | ||||
<?php ActiveForm::end(); ?> | |||||
<a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/request-password-reset']) ; ?>">J'ai oublié mon mot de passe</a><br> | |||||
</div> | </div> | ||||
</div> | |||||
<!-- /.login-box-body --> | |||||
</div><!-- /.login-box --> |
termes. | termes. | ||||
*/ | */ | ||||
$this->title = 'Statistiques' ; | |||||
use dosamigos\chartjs\ChartJs; | use dosamigos\chartjs\ChartJs; | ||||
$this->params['breadcrumbs'][] = 'Statistiques'; | |||||
$this->setTitle('Statistiques <small>Chiffre d\'affaire</small>') ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
?> | ?> | ||||
<h1>Statistiques</h1> | |||||
<?= ChartJs::widget([ | <?= ChartJs::widget([ | ||||
'type' => 'line', | 'type' => 'line', | ||||
'options' => [ | 'options' => [ |
*/ | */ | ||||
use \backend\controllers\StatsController ; | use \backend\controllers\StatsController ; | ||||
use yii\helpers\Html; | |||||
$this->title = 'Statistiques produits' ; | |||||
$this->params['breadcrumbs'][] = 'Statistiques produits'; | |||||
$this->setTitle('Statistiques <small>Produits '.$year.'</small>', 'Statistiques produits '.$year) ; | |||||
$this->addBreadcrumb('Statistiques produits '.$year) ; | |||||
$this->addButton(['label' => '< '.($year - 1), 'url' => ['stats/products','year' => $year - 1], 'class' => 'btn btn-default']) ; | |||||
$this->addButton(['label' => ($year + 1).' >', 'url' => ['stats/products','year' => $year + 1], 'class' => 'btn btn-default']) ; | |||||
$theMonth = 1 ; | |||||
?> | ?> | ||||
<div class="stats-products"> | <div class="stats-products"> | ||||
<h1>Statistiques produits <?= $year ?> | |||||
<div id="nav-year"> | |||||
<a class="btn btn-default" href="<?= Yii::$app->urlManager->createUrl(['stats/products','year' => $year - 1]); ?>">< <?= ($year - 1) ?></a> | |||||
<a class="btn btn-default" href="<?= Yii::$app->urlManager->createUrl(['stats/products','year' => $year + 1]); ?>"><?= ($year + 1) ?> ></a> | |||||
</div> | |||||
</h1> | |||||
<?php if($empty): ?> | |||||
<div class="alert alert-warning">Aucune statistique disponible pour cette période</div> | |||||
<?php else: ?> | |||||
<table id="table-stats-products" class="table table-bordered table-hover header-fixed"> | <table id="table-stats-products" class="table table-bordered table-hover header-fixed"> | ||||
<thead> | <thead> | ||||
<tr class="mois"> | <tr class="mois"> | ||||
<th></th> | <th></th> | ||||
<?php foreach($monthArray as $month): ?> | |||||
<th colspan="2"><?= $month; ?></th> | |||||
<?php endforeach; ?> | |||||
<?php foreach($monthArray as $key => $month): | |||||
if(($key + 1) >= $iStart && ($key + 1) <= $iEnd): | |||||
?> | |||||
<th colspan="2"> | |||||
<?php if($section != 1 && $key + 1 == $iStart): echo Html::a('<', ['stats/products', 'year' => $year, 'section' => $section - 1], ['class' => 'btn btn-default']) ; ?><?php endif; ?> | |||||
<?= $month; ?> | |||||
<?php if($key + 1 == $iEnd && $section != 4): echo Html::a('>', ['stats/products', 'year' => $year, 'section' => $section + 1], ['class' => 'btn btn-default']) ; ?><?php endif; ?> | |||||
</th> | |||||
<?php | |||||
endif; | |||||
endforeach; | |||||
?> | |||||
<th colspan="2">Totaux</th> | |||||
</tr> | </tr> | ||||
<tr class="sub-head"> | <tr class="sub-head"> | ||||
<th></th> | <th></th> | ||||
<?php for($i=1; $i<=13; $i++): ?> | |||||
<?php for($i=$iStart; $i<=$iEnd + 1; $i++): ?> | |||||
<th>Maximum</th> | <th>Maximum</th> | ||||
<th>Commandés</th> | <th>Commandés</th> | ||||
<?php endfor; ?> | <?php endfor; ?> | ||||
<tr> | <tr> | ||||
<td class="name"><?= Html::encode($currentProduct['name']) ?></td> | <td class="name"><?= Html::encode($currentProduct['name']) ?></td> | ||||
<?php foreach($dataProducts as $month => $productsMonthArray): | <?php foreach($dataProducts as $month => $productsMonthArray): | ||||
$findMax = false ; | $findMax = false ; | ||||
$findOrders = false ; | $findOrders = false ; | ||||
?> | ?> | ||||
<!-- max --> | <!-- max --> | ||||
<?php | <?php | ||||
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($currentProduct['name']).' / '.$monthArray[$month - 1] .' '. $year.' / Maximum"' ; | |||||
$tooltip = 'data-toggle="tooltip" data-placement="top" title="'.Html::encode($currentProduct['name']).' / '.$monthArray[$month - 1] .' '. $year.' / Maximum"' ; | |||||
foreach($productsMonthArray['max'] as $product): | foreach($productsMonthArray['max'] as $product): | ||||
?> | ?> | ||||
<?php if($product['name'] == $currentProduct['name']): | <?php if($product['name'] == $currentProduct['name']): | ||||
$findMax = true ; | $findMax = true ; | ||||
?> | ?> | ||||
<td class="align-center"> | <td class="align-center"> | ||||
<div <?= $tooltip; ?>><?= $product['total'] ?></div> | |||||
<div <?= $tooltip; ?>><?= (int) $product['total'] ?></div> | |||||
</td> | </td> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
<!-- commandes --> | <!-- commandes --> | ||||
<?php | <?php | ||||
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($currentProduct['name']).' / '. $monthArray[$month - 1] . ' '. $year .' / Commandés"' ; | |||||
$tooltip = 'data-toggle="tooltip" data-placement="top" title="'.Html::encode($currentProduct['name']).' / '. $monthArray[$month - 1] . ' '. $year .' / Commandés"' ; | |||||
foreach($productsMonthArray['orders'] as $product): | foreach($productsMonthArray['orders'] as $product): | ||||
?> | ?> | ||||
<?php if($product['name'] == $currentProduct['name']): | <?php if($product['name'] == $currentProduct['name']): | ||||
$findOrders = true ; | $findOrders = true ; | ||||
?> | ?> | ||||
<td class="align-center"> | <td class="align-center"> | ||||
<div <?= $tooltip ?> ><?= $product['total'] ?></div> | |||||
<div <?= $tooltip ?> ><?= (int) $product['total'] ?></div> | |||||
</td> | </td> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
<?php else: ?> | <?php else: ?> | ||||
<!-- totaux max --> | <!-- totaux max --> | ||||
<?php | <?php | ||||
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($currentProduct['name']).' / Total '. $year .' / Maximums"' ; | |||||
$tooltip = 'data-toggle="tooltip" data-placement="top" title="'.Html::encode($currentProduct['name']).' / Total '. $year .' / Maximums"' ; | |||||
foreach($dataProducts[StatsController::TOTALS]['max'] as $productName => $totalMax): | foreach($dataProducts[StatsController::TOTALS]['max'] as $productName => $totalMax): | ||||
?> | ?> | ||||
<?php if($productName == $currentProduct['name']): ?> | |||||
<?php | |||||
if($productName == $currentProduct['name']): | |||||
$findMax = true ; | |||||
?> | |||||
<td class="align-center"> | <td class="align-center"> | ||||
<div <?= $tooltip ?> ><?= $totalMax ?></div> | |||||
<div <?= $tooltip ?> ><?= (int) $totalMax ?></div> | |||||
</td> | </td> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
<?php if(!$findMax): ?><td class="align-center"><div <?= $tooltip; ?>>0</div></td><?php endif; ?> | |||||
<!-- totaux commandés --> | <!-- totaux commandés --> | ||||
<?php | <?php | ||||
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($currentProduct['name']).' / Total '. $year .' / Commandés"' ; | |||||
$tooltip = 'data-toggle="tooltip" data-placement="top" title="'.Html::encode($currentProduct['name']).' / Total '. $year .' / Commandés"' ; | |||||
foreach($dataProducts[StatsController::TOTALS]['orders'] as $productName => $totalOrders): | foreach($dataProducts[StatsController::TOTALS]['orders'] as $productName => $totalOrders): | ||||
?> | ?> | ||||
<?php if($productName == $currentProduct['name']): ?> | |||||
<?php if($productName == $currentProduct['name']): | |||||
$findOrders = true ; | |||||
?> | |||||
<td class="align-center"> | <td class="align-center"> | ||||
<div <?= $tooltip ?> ><?= $totalOrders ?></div> | |||||
<div <?= $tooltip ?> ><?= (int) $totalOrders ?></div> | |||||
</td> | </td> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
<?php if(!$findOrders): ?><td class="align-center"><div <?= $tooltip ?> >0</div></td><?php endif; ?> | |||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
</tr> | </tr> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
<?php endif; ?> | |||||
</div> | </div> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $model app\models\Produit */ | |||||
$this->setTitle('Ajouter un abonnement') ; | |||||
$this->addBreadcrumb(['label' => 'Abonnements', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb('Ajouter') ; | |||||
$this->title = 'Ajouter un abonnement'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Abonnements', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = 'Ajouter'; | |||||
?> | ?> | ||||
<div class="subscription-create"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="subscription-create"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
'productsArray' => $productsArray | 'productsArray' => $productsArray | ||||
]) ?> | ]) ?> | ||||
</div> | </div> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\grid\GridView; | use yii\grid\GridView; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $dataProvider yii\data\ActiveDataProvider */ | |||||
$this->title = 'Abonnements'; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
$this->setTitle('Abonnements') ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
$this->addButton(['label' => '+', 'url' => 'subscription/create', 'class' => 'btn btn-success']) ; | |||||
?> | ?> | ||||
<div class="subscription-index"> | <div class="subscription-index"> | ||||
<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1> | |||||
<?= GridView::widget([ | <?= GridView::widget([ | ||||
'filterModel' => $searchModel, | |||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, | ||||
'columns' => [ | 'columns' => [ | ||||
[ | [ | ||||
'attribute' => 'id_user', | |||||
'attribute' => 'username', | |||||
'label' => 'Utilisateur', | |||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) { | 'value' => function($model) { | ||||
if(strlen($model->username)) | if(strlen($model->username)) | ||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'id_point_sale', | |||||
'format' => 'raw', | |||||
'value' => function($model) { | |||||
return Html::encode($model->pointSale->name) ; | |||||
} | |||||
], | |||||
[ | |||||
'attribute' => 'products', | |||||
'attribute' => 'product_name', | |||||
'label' => 'Produits', | |||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) { | 'value' => function($model) { | ||||
$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 | ||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'date_begin', | |||||
'attribute' => 'id_point_sale', | |||||
'label' => 'Point de vente', | |||||
'format' => 'raw', | |||||
'filter' => ArrayHelper::map(PointSale::find()->where(['id_producer' => Producer::getId()])->asArray()->all(), 'id', 'name'), | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
return date('d/m/Y',strtotime($model->date_begin)) ; | |||||
return Html::encode($model->pointSale->name) ; | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'date_end', | |||||
'attribute' => 'date_begin', | |||||
'label' => 'Date de début', | |||||
'format' => 'raw', | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
if($model->date_end) | |||||
return date('d/m/Y',strtotime($model->date_end)) ; | |||||
else | |||||
return 'indéterminée' ; | |||||
$html = date('d/m/Y',strtotime($model->date_begin)) ; | |||||
return $html ; | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'monday', | |||||
'attribute' => 'day', | |||||
'label' => 'Jours', | 'label' => 'Jours', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'filter' => [ | |||||
'monday' => 'Lundi', | |||||
'tuesday' => 'Mardi', | |||||
'wednesday' => 'Mercredi', | |||||
'thursday' => 'Jeudi', | |||||
'friday' => 'Vendredi', | |||||
'saterday' => 'Samedi', | |||||
'sunday' => 'Dimanche', | |||||
], | |||||
'contentOptions' => ['class' => 'text-small'], | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
$html = '' ; | $html = '' ; | ||||
if($model->monday) | |||||
if($model->monday) { | |||||
$html .= 'lundi, ' ; | $html .= 'lundi, ' ; | ||||
if($model->tuesday) | |||||
} | |||||
if($model->tuesday) { | |||||
$html .= 'mardi, ' ; | $html .= 'mardi, ' ; | ||||
if($model->wednesday) | |||||
} | |||||
if($model->wednesday) { | |||||
$html .= 'mercredi, ' ; | $html .= 'mercredi, ' ; | ||||
if($model->thursday) | |||||
} | |||||
if($model->thursday) { | |||||
$html .= 'jeudi, ' ; | $html .= 'jeudi, ' ; | ||||
if($model->friday) | |||||
} | |||||
if($model->friday) { | |||||
$html .= 'vendredi, ' ; | $html .= 'vendredi, ' ; | ||||
if($model->saturday) | |||||
} | |||||
if($model->saturday) { | |||||
$html .= 'samedi, ' ; | $html .= 'samedi, ' ; | ||||
if($model->sunday) | |||||
} | |||||
if($model->sunday) { | |||||
$html .= 'dimanche, ' ; | $html .= 'dimanche, ' ; | ||||
} | |||||
if(strlen($html)) | |||||
if(strlen($html)) { | |||||
return substr ($html, 0, strlen($html) - 2) ; | return substr ($html, 0, strlen($html) - 2) ; | ||||
else | |||||
} | |||||
else { | |||||
return '<span class="glyphicon glyphicon-warning-sign"></span> Aucun jour' ; | return '<span class="glyphicon glyphicon-warning-sign"></span> Aucun jour' ; | ||||
} | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'week_frequency', | 'attribute' => 'week_frequency', | ||||
'filter' => [ | |||||
1 => 'Toutes les semaines', | |||||
2 => 'Toutes les 2 semaines', | |||||
3 => 'Toutes les 3 semaines', | |||||
4 => 'Tous les mois'], | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
if($model->week_frequency == 1) | |||||
if($model->week_frequency == 1) { | |||||
return 'Toutes les semaines' ; | return 'Toutes les semaines' ; | ||||
else | |||||
} | |||||
else { | |||||
return 'Toutes les '.$model->week_frequency.' semaines' ; | return 'Toutes les '.$model->week_frequency.' semaines' ; | ||||
} | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'auto_payment', | 'attribute' => 'auto_payment', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'label' => 'Paiement automatique', | |||||
'headerOptions' => ['class' => 'column-auto-payment'], | |||||
'contentOptions' => ['class' => 'column-auto-payment'], | |||||
'filter' => [0 => 'Non', 1 => 'Oui'], | |||||
'value' => function($model) { | 'value' => function($model) { | ||||
if($model->auto_payment) | |||||
if($model->auto_payment) { | |||||
return '<span class="label label-success">Oui</span>' ; | return '<span class="label label-success">Oui</span>' ; | ||||
else | |||||
} | |||||
else { | |||||
return '<span class="label label-danger">Non</span>' ; | return '<span class="label label-danger">Non</span>' ; | ||||
} | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'class' => 'yii\grid\ActionColumn', | 'class' => 'yii\grid\ActionColumn', | ||||
'template' => '{update} {delete}', | 'template' => '{update} {delete}', | ||||
'headerOptions' => ['class' => 'actions'], | |||||
'headerOptions' => ['class' => 'column-actions'], | |||||
'contentOptions' => ['class' => 'column-actions'], | |||||
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', $url, [ | |||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | 'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | ||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span> Suprimer', $url, [ | |||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | 'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | ||||
]); | ]); | ||||
} | } |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $model app\models\Produit */ | |||||
$this->title = 'Modifier un abonnement'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Abonnements', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = 'Modifier'; | |||||
$this->setTitle('Modifier un abonnement') ; | |||||
$this->addBreadcrumb(['label' => 'Abonnements', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb('Modifier') ; | |||||
?> | ?> | ||||
<div class="subscription-update"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="subscription-update"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
'productsArray' => $productsArray | 'productsArray' => $productsArray |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$this->setTitle('Ajouter un client') ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb('Ajouter') ; | |||||
/* @var $this yii\web\View */ | |||||
/* @var $model common\models\User */ | |||||
$this->title = 'Ajouter un client'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Clients', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = 'Ajouter' ; | |||||
?> | ?> | ||||
<div class="user-create"> | <div class="user-create"> | ||||
<?php if(YII_ENV == 'demo'): ?> | <?php if(YII_ENV == 'demo'): ?> | ||||
<div class="alert alert-warning">Vous ne pouvez pas ajouter de client dans l'espace Démo.</div> | <div class="alert alert-warning">Vous ne pouvez pas ajouter de client dans l'espace Démo.</div> | ||||
<?php else: ?> | <?php else: ?> | ||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
]) ?> | ]) ?> |
use common\models\CreditHistory; | use common\models\CreditHistory; | ||||
use common\models\Producer; | use common\models\Producer; | ||||
$this->title = 'Créditer <small>'.Html::encode($user->lastname.' '.$user->name).'</small>'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Clients', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = ['label' => Html::encode($user->lastname.' '.$user->name)]; | |||||
$this->params['breadcrumbs'][] = 'Créditer'; | |||||
$this->setTitle('Créditer <small>'.Html::encode($user->lastname.' '.$user->name).'</small>', 'Créditer '.Html::encode($user->lastname.' '.$user->name)) ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => Html::encode($user->lastname.' '.$user->name)]) ; | |||||
$this->addBreadcrumb('Créditer') ; | |||||
?> | ?> | ||||
if(!$producer->credit) | if(!$producer->credit) | ||||
{ | { | ||||
echo '<div class="alert alert-warning">Attention, la fonctionnalité <strong>Crédit</strong> est désactivée dans vos <a href="'.Yii::$app->urlManager->createurl(['producer/update']).'">paramètres</a>.' | echo '<div class="alert alert-warning">Attention, la fonctionnalité <strong>Crédit</strong> est désactivée dans vos <a href="'.Yii::$app->urlManager->createurl(['producer/update']).'">paramètres</a>.' | ||||
. ' Pensez à l\'activer si vous souhaitez qu\'elle soit visible de vos clients.</div>' ; | |||||
. ' Pensez à l\'activer si vous souhaitez qu\'elle soit visible de vos utilisateurs.</div>' ; | |||||
} | } | ||||
?> | ?> | ||||
<div class="col-md-12"> | <div class="col-md-12"> | ||||
<h1><?= $this->title ?></h1> | |||||
<?php $form = ActiveForm::begin(); ?> | <?php $form = ActiveForm::begin(); ?> | ||||
<?= $form->field($creditForm, 'type')->dropDownList([ | <?= $form->field($creditForm, 'type')->dropDownList([ | ||||
CreditHistory::TYPE_CREDIT => 'Crédit', | CreditHistory::TYPE_CREDIT => 'Crédit', | ||||
]) ?> | ]) ?> | ||||
<?= $form->field($creditForm, 'amount')->textInput() ?> | <?= $form->field($creditForm, 'amount')->textInput() ?> | ||||
<?= $form->field($creditForm, 'mean_payment')->dropDownList([ | <?= $form->field($creditForm, 'mean_payment')->dropDownList([ | ||||
CreditHistory::MEAN_PAYMENT_MONEYS => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_MONEYS), | |||||
CreditHistory::MOYEN_CB => CreditHistory::getStrMeanPaymentBy(CreditHistory::MOYEN_CB), | |||||
CreditHistory::MOYEN_CHEQUE => CreditHistory::getStrMeanPaymentBy(CreditHistory::MOYEN_CHEQUE), | |||||
CreditHistory::MOYEN_AUTRE => CreditHistory::getStrMeanPaymentBy(CreditHistory::MOYEN_AUTRE), | |||||
CreditHistory::MEAN_PAYMENT_MONEY => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_MONEY), | |||||
CreditHistory::MEAN_PAYMENT_CREDIT_CARD => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_CREDIT_CARD), | |||||
CreditHistory::MEAN_PAYMENT_CHEQUE => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_CHEQUE), | |||||
CreditHistory::MEAN_PAYMENT_OTHER => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_OTHER), | |||||
]) ?> | ]) ?> | ||||
<?= $form->field($creditForm, 'comment')->textarea() ?> | <?= $form->field($creditForm, 'comment')->textarea() ?> | ||||
<?= $form->field($creditForm, 'sendMail')->checkbox() ?> | |||||
<?= $form->field($creditForm, 'send_mail')->checkbox() ?> | |||||
<div class="form-group"> | <div class="form-group"> | ||||
<?= Html::submitButton( 'Créditer', ['class' => 'btn btn-primary']) ?> | <?= Html::submitButton( 'Créditer', ['class' => 'btn btn-primary']) ?> |
use yii\helpers\Html ; | use yii\helpers\Html ; | ||||
$this->title = 'Liste des emails'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Utilisateurs', | |||||
'url' => ['user/index']] ; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
$this->setTitle('Liste des emails') ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['user/index']]) ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
?> | ?> | ||||
<h1><?php if(isset($pointSale) && $pointSale): echo Html::encode($pointSale->name).' : '; endif; ?><?= count($usersArray); ?> utilisateurs</h1> | |||||
<h3><?= count($usersArray); ?> utilisateurs</h3> | |||||
<ul id="tabs-points-sale" class="nav nav-tabs" role="tablist"> | <ul id="tabs-points-sale" class="nav nav-tabs" role="tablist"> | ||||
<li class="<?php if(!isset($pointSale)): ?>active<?php endif; ?>"> | <li class="<?php if(!isset($pointSale)): ?>active<?php endif; ?>"> | ||||
<a href="<?= Yii::$app->urlManager->createUrl(['user/mail']); ?>">Tous</a> | <a href="<?= Yii::$app->urlManager->createUrl(['user/mail']); ?>">Tous</a> | ||||
</li> | </li> | ||||
<?php foreach($pointsSaleArray as $pointSale): ?> | |||||
<li class="<?php if(isset($pointSale) && $pointSale->id == $pointSale->id): ?>active<?php endif; ?>"> | |||||
<a href="<?= Yii::$app->urlManager->createUrl(['user/mail','idPointSale'=>$pointSale->id]); ?>"><?= Html::encode($pointSale->name) ?></a> | |||||
<?php foreach($pointsSaleArray as $thePointSale): ?> | |||||
<li class="<?php if(isset($pointSale) && $pointSale->id == $thePointSale->id): ?>active<?php endif; ?>"> | |||||
<a href="<?= Yii::$app->urlManager->createUrl(['user/mail','idPointSale'=>$thePointSale->id]); ?>"><?= Html::encode($thePointSale->name) ?></a> | |||||
</li> | </li> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
</ul> | </ul> |
use common\models\User ; | use common\models\User ; | ||||
use common\models\Order ; | use common\models\Order ; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $dataProvider yii\data\ActiveDataProvider */ | |||||
$this->setTitle('Utilisateurs') ; | |||||
$this->addBreadcrumb($this->getTitle()) ; | |||||
$this->addButton(['label' => '+', 'url' => 'user/create', 'class' => 'btn btn-primary']) ; | |||||
$this->title = 'Utilisateurs'; | |||||
$this->params['breadcrumbs'][] = $this->title; | |||||
?> | ?> | ||||
<div class="user-index"> | <div class="user-index"> | ||||
<h1> | |||||
<?= Html::encode($this->title) ?> | |||||
<?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-primary']) ?> | |||||
</h1> | |||||
<ul id="tabs-points-vente" class="nav nav-tabs" role="tablist"> | <ul id="tabs-points-vente" class="nav nav-tabs" role="tablist"> | ||||
<li class="<?php if(!$idPointSaleActive && !$sectionInactiveUsers): ?>active<?php endif; ?>"> | <li class="<?php if(!$idPointSaleActive && !$sectionInactiveUsers): ?>active<?php endif; ?>"> | ||||
<a href="<?= Yii::$app->urlManager->createUrl(['user/index']); ?>">Tous</a> | <a href="<?= Yii::$app->urlManager->createUrl(['user/index']); ?>">Tous</a> | ||||
<?= GridView::widget([ | <?= GridView::widget([ | ||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, | ||||
'filterModel' => true, | |||||
'filterModel' => $searchModel, | |||||
'columns' => [ | 'columns' => [ | ||||
[ | [ | ||||
'attribute' => 'lastname', | |||||
'filter' => Html::input( | |||||
'string', | |||||
'lastname', | |||||
isset(Yii::$app->request->queryParams['lastname']) ? Html::encode(Yii::$app->request->queryParams['lastname']) : '', | |||||
[ 'class' => 'form-control'] | |||||
) | |||||
], | |||||
[ | |||||
'attribute' => 'name', | |||||
'filter' => Html::input( | |||||
'string', | |||||
'name', | |||||
isset(Yii::$app->request->queryParams['name']) ? Html::encode(Yii::$app->request->queryParams['name']) : '', | |||||
['class' => 'form-control'] | |||||
) | |||||
], | |||||
[ | |||||
'attribute' => 'phone', | |||||
'filter' => Html::input( | |||||
'string', | |||||
'phone', | |||||
isset(Yii::$app->request->queryParams['phone']) ? Html::encode(Yii::$app->request->queryParams['phone']) : '', | |||||
['class' => 'form-control'] | |||||
) | |||||
'attribute' => 'username', | |||||
'label' => 'Nom', | |||||
'value' => function($model) { | |||||
return $model['lastname'].' '.$model['name'] ; | |||||
} | |||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'email', | |||||
'filter' => Html::input( | |||||
'string', | |||||
'email', | |||||
isset(Yii::$app->request->queryParams['email']) ? Html::encode(Yii::$app->request->queryParams['email']) : '', | |||||
['class' => 'form-control'] | |||||
) | |||||
'attribute' => 'contacts', | |||||
'header' => 'Contacts', | |||||
'format' => 'raw', | |||||
'value' => function($model) { | |||||
$html = '' ; | |||||
if(strlen($model['phone'])) { | |||||
$html .= $model['phone'] ; | |||||
} | |||||
if(strlen($model['phone']) && strlen($model['email'])) { | |||||
$html .= '<br />' ; | |||||
} | |||||
if(strlen($model['email'])) { | |||||
$html .= $model['email'] ; | |||||
} | |||||
return $html ; | |||||
} | |||||
], | ], | ||||
[ | [ | ||||
'attribute' => 'created_at', | 'attribute' => 'created_at', | ||||
return date('m/d/Y à H:i', $model['created_at']); | return date('m/d/Y à H:i', $model['created_at']); | ||||
} | } | ||||
], | ], | ||||
[ | |||||
'attribute' => 'date_last_connection', | |||||
'label' => 'Dernière connexion', | |||||
'value' => function($model) { | |||||
if(isset($model['date_last_connection'])) | |||||
return date('d/m/Y à H:i', strtotime($model['date_last_connection'])); | |||||
else | |||||
return '' ; | |||||
} | |||||
], | |||||
[ | [ | ||||
'class' => 'yii\grid\ActionColumn', | 'class' => 'yii\grid\ActionColumn', | ||||
'header' => 'Commandes', | |||||
'template' => '{orders}', | 'template' => '{orders}', | ||||
'headerOptions' => ['class' => 'actions'], | 'headerOptions' => ['class' => 'actions'], | ||||
'buttons' => [ | 'buttons' => [ | ||||
'orders' => function ($url, $model) { | 'orders' => function ($url, $model) { | ||||
$url = Yii::$app->urlManager->createUrl(['user/orders','id' => $model['user_id']]) ; | |||||
$url = Yii::$app->urlManager->createUrl(['user/orders','id' => $model['id']]) ; | |||||
$countOrders = Order::searchCount([ | $countOrders = Order::searchCount([ | ||||
'id_user' => $model['user_id'] | |||||
'id_user' => $model['id'] | |||||
], ['conditions' => 'date_delete IS NULL']) ; | ], ['conditions' => 'date_delete IS NULL']) ; | ||||
$html = '' ; | $html = '' ; | ||||
if($countOrders) { | if($countOrders) { | ||||
$s = '' ; | |||||
if($countOrders > 1) $s = 's' ; | |||||
$html .= Html::a('<span class="glyphicon glyphicon-eye-open"></span> '.$countOrders.' commande'.$s, $url, [ | |||||
$html .= Html::a('<span class="glyphicon glyphicon-eye-open"></span> '.$countOrders, $url, [ | |||||
'title' => Yii::t('app', 'Commandes'), 'class' => 'btn btn-default ' | 'title' => Yii::t('app', 'Commandes'), 'class' => 'btn btn-default ' | ||||
]); ; | ]); ; | ||||
} | } | ||||
'attribute' => 'credit', | 'attribute' => 'credit', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) use($producer) { | 'value' => function($model) use($producer) { | ||||
if(!isset($model['credit'])) $model['credit'] = 0 ; | |||||
$user = User::findOne($model['user_id']) ; | |||||
$user = User::findOne($model->id) ; | |||||
$html = '<div class="input-group"> | $html = '<div class="input-group"> | ||||
<input type="text" class="form-control input-credit" readonly="readonly" value="'.number_format($user->getCredit($producer->id),2).' €" placeholder=""> | <input type="text" class="form-control input-credit" readonly="readonly" value="'.number_format($user->getCredit($producer->id),2).' €" placeholder=""> | ||||
<span class="input-group-btn"> | <span class="input-group-btn"> | ||||
'.Html::a( | '.Html::a( | ||||
'<span class="glyphicon glyphicon-euro"></span> Crédit', | |||||
Yii::$app->urlManager->createUrl(['user/credit','id' => $model['user_id']]), | |||||
'<span class="glyphicon glyphicon-euro"></span>', | |||||
Yii::$app->urlManager->createUrl(['user/credit','id' => $model->id]), | |||||
[ | [ | ||||
'title' => 'Crédit', | 'title' => 'Crédit', | ||||
'class' => 'btn btn-default' | 'class' => 'btn btn-default' | ||||
[ | [ | ||||
'class' => 'yii\grid\ActionColumn', | 'class' => 'yii\grid\ActionColumn', | ||||
'template' => '{update} {delete}', | 'template' => '{update} {delete}', | ||||
'headerOptions' => ['class' => 'actions'], | |||||
'headerOptions' => ['class' => 'column-actions'], | |||||
'contentOptions' => ['class' => 'column-actions'], | |||||
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
$url = Yii::$app->urlManager->createUrl(['user/update','id' => $model['user_id']]) ; | |||||
$user = User::find()->with('userProducer')->where(['id' => $model['user_id']])->one() ; | |||||
$url = Yii::$app->urlManager->createUrl(['user/update','id' => $model->id]) ; | |||||
$user = User::find()->with('userProducer')->where(['id' => $model->id])->one() ; | |||||
if(count($user->userProducer) <= 1) | if(count($user->userProducer) <= 1) | ||||
{ | { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', $url, [ | |||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | 'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | ||||
]); | ]); | ||||
} | } | ||||
else { | else { | ||||
return '<span data-toggle="tooltip" data-placement="top" title="Vous ne pouvez pas modifier les clients qui sont liés à plusieurs producteurs."><span class="glyphicon glyphicon-remove-sign"></span> Non modifiable</span>' ; | |||||
return '<span data-toggle="tooltip" data-placement="top" title="Vous ne pouvez pas modifier les utilisateurs qui sont liés à plusieurs producteurs."><span class="glyphicon glyphicon-remove-sign"></span> Non modifiable</span>' ; | |||||
} | } | ||||
}, | }, | ||||
'delete' => function($url, $model) { | |||||
if($model['active']) { | |||||
return Html::a('<span class="glyphicon glyphicon-trash"></span> Supprimer', Yii::$app->urlManager->createUrl(array_merge(['user/delete','id' => $model['user_id']], Yii::$app->getRequest()->getQueryParams())), [ | |||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
]); | |||||
} | |||||
'delete' => function($url, $model) { | |||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', Yii::$app->urlManager->createUrl(array_merge(['user/delete','id' => $model->id], Yii::$app->getRequest()->getQueryParams())), [ | |||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
]); | |||||
} | } | ||||
], | ], | ||||
], | ], |
use common\models\Producer; | use common\models\Producer; | ||||
use common\models\Order; | use common\models\Order; | ||||
$this->title = 'Commandes <small>'.Html::encode($user->lastname.' '.$user->name).'</small>'; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Clients', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = ['label' => Html::encode($user->lastname.' '.$user->name)]; | |||||
$this->params['breadcrumbs'][] = 'Créditer'; | |||||
$this->setTitle('Commandes <small>'.Html::encode($user->lastname.' '.$user->name).'</small>', 'Commandes de '.Html::encode($user->lastname.' '.$user->name)) ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => Html::encode($user->lastname.' '.$user->name)]) ; | |||||
$this->addBreadcrumb('Commandes') ; | |||||
?> | ?> | ||||
<div class="user-orders"> | <div class="user-orders"> | ||||
<h1><?= $this->title ?> </h1> | |||||
<?php if(count($commandes)): ?> | |||||
<?php if(count($ordersArray)): ?> | |||||
<table id="historique-commandes" class="table table-striped table-bordered"> | <table id="historique-commandes" class="table table-striped table-bordered"> | ||||
<thead> | <thead> | ||||
<tr> | <tr> | ||||
<th>Historique</th> | |||||
<th>Date livraison</th> | <th>Date livraison</th> | ||||
<th>Historique</th> | |||||
<th>Résumé</th> | <th>Résumé</th> | ||||
<th>Point de vente</th> | <th>Point de vente</th> | ||||
<th class="montant">Montant</th> | <th class="montant">Montant</th> | ||||
</tr> | </tr> | ||||
</thead> | </thead> | ||||
<tbody> | <tbody> | ||||
<?php foreach($commandes as $c): ?> | |||||
<tr class="<?= $c->getClassHistorique() ; ?>"> | |||||
<td class="historique"><?= $c->getStrHistorique() ; ?></td> | |||||
<td><?php echo date('d/m/Y',strtotime($c->production->date)); ?></td> | |||||
<td class="resume"><?= $c->getResumePanier() ; ?></td> | |||||
<td><?= $c->getResumePointVente(); ?></td> | |||||
<td class="montant"><?= $c->getResumeMontant(); ?></td> | |||||
<?php foreach($ordersArray as $order): ?> | |||||
<tr class="<?= $order->getClassHistory() ; ?>"> | |||||
<td><?php echo date('d/m/Y',strtotime($order->distribution->date)); ?></td> | |||||
<td class="historique"><?= $order->getStrHistory() ; ?></td> | |||||
<td class="resume"><?= $order->getCartSummary() ; ?></td> | |||||
<td><?= $order->getPointSaleSummary(); ?></td> | |||||
<td class="montant"><?= $order->getAmountSummary(); ?></td> | |||||
</tr> | </tr> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
</tbody> | </tbody> |
use yii\helpers\Html; | use yii\helpers\Html; | ||||
/* @var $this yii\web\View */ | |||||
/* @var $model common\models\User */ | |||||
$this->setTitle('Modifier un client') ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => Html::encode($model->lastname.' '.$model->name)]) ; | |||||
$this->addBreadcrumb('Modifier') ; | |||||
$this->title = 'Modifier un client' ; | |||||
$this->params['breadcrumbs'][] = ['label' => 'Clients', 'url' => ['index']]; | |||||
$this->params['breadcrumbs'][] = ['label' => Html::encode($model->lastname.' '.$model->name)]; | |||||
$this->params['breadcrumbs'][] = 'Modifier'; | |||||
?> | ?> | ||||
<div class="user-update"> | |||||
<h1><?= Html::encode($this->title) ?></h1> | |||||
<div class="user-update"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
]) ?> | ]) ?> | ||||
</div> | </div> |
return ui; | return ui; | ||||
}; | }; | ||||
$(".produit-index table tbody").sortable({ | |||||
$(".product-index table tbody").sortable({ | |||||
items: "> tr", | items: "> tr", | ||||
appendTo: "parent", | appendTo: "parent", | ||||
cursor: "move", | cursor: "move", | ||||
var tab_ordre = {} ; | var tab_ordre = {} ; | ||||
var ordre = 1 ; | var ordre = 1 ; | ||||
$(".produit-index table tbody tr").each(function() { | |||||
$(".product-index table tbody tr").each(function() { | |||||
tab_ordre[$(this).attr('data-key')] = ordre ; | tab_ordre[$(this).attr('data-key')] = ordre ; | ||||
ordre++ ; | ordre++ ; | ||||
}) ; | }) ; | ||||
console.log(tab_ordre) ; | console.log(tab_ordre) ; | ||||
$.get(UrlManager.getBaseUrl()+'produit/ordre',{ | |||||
tab: JSON.stringify(tab_ordre) | |||||
$.get(UrlManager.getBaseUrl()+'product/order',{ | |||||
array: JSON.stringify(tab_ordre) | |||||
}) ; | }) ; | ||||
} | } | ||||
}).disableSelection(); | }).disableSelection(); |
body.skin-black { | |||||
.main-header { | |||||
.logo { | |||||
background-color: darken($color1,5) ; | |||||
&:hover { | |||||
background-color: $color1 ; | |||||
} | |||||
.logo-lg { | |||||
img { | |||||
width: 30px ; | |||||
height: 30px ; | |||||
} | |||||
} | |||||
.logo-mini { | |||||
img { | |||||
width: 30px ; | |||||
height: 30px ; | |||||
} | |||||
} | |||||
} | |||||
.navbar { | |||||
background-color: $color1 ; | |||||
.sidebar-toggle { | |||||
color: white ; | |||||
} | |||||
.navbar-custom-menu .navbar-nav > li > a, | |||||
.navbar-right > li > a { | |||||
border-left: solid 1px lighten($color1, 15) ; | |||||
color: white ; | |||||
} | |||||
.nav > li > a:hover, .nav > li > a:active, .nav > li > a:focus, | |||||
.nav .open > a, .nav .open > a:hover, .nav .open > a:focus, | |||||
.nav > .active > a { | |||||
color: white ; | |||||
background-color: darken($color1, 4) ; | |||||
} | |||||
.dropdown-menu { | |||||
@include box-shadow(0px 0px 4px gray) ; | |||||
} | |||||
} | |||||
.logo, .navbar .sidebar-toggle { | |||||
border-right: solid 1px lighten($color1, 15) ; | |||||
} | |||||
.link-control-sidebar { | |||||
display: none ; | |||||
} | |||||
.notifications-menu { | |||||
ul.menu { | |||||
max-height: 300px ; | |||||
li { | |||||
a { | |||||
padding-top: 4px ; | |||||
padding-bottom: 4px ; | |||||
h5 { | |||||
margin-bottom: 2px ; | |||||
small { | |||||
float: right ; | |||||
} | |||||
} | |||||
p { | |||||
margin-left: 10px ; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
.sidebar-menu > li.active > a { | |||||
border-color: $color1 ; | |||||
} | |||||
.content-wrapper { | |||||
background-color: #f5f5f5 ; | |||||
.content-header { | |||||
//background-color: $color2 ; | |||||
background-color: #eeeeee ; | |||||
padding-bottom: 15px ; | |||||
border-bottom: solid 1px #e0e0e0 ; | |||||
.btn { | |||||
padding: 3px 6px ; | |||||
font-size: 13px ; | |||||
} | |||||
} | |||||
a { | |||||
color: $color1 ; | |||||
} | |||||
.btn { | |||||
color: white ; | |||||
} | |||||
.btn-default { | |||||
color: #333 ; | |||||
} | |||||
.btn-primary, .btn-success { | |||||
background-color: $color1 ; | |||||
color: white ; | |||||
border-color: $color1 ; | |||||
} | |||||
.alert { | |||||
a { | |||||
color: white ; | |||||
} | |||||
} | |||||
.callout { | |||||
a { | |||||
color: white ; | |||||
} | |||||
.btn { | |||||
color: #333 ; | |||||
text-decoration: none ; | |||||
} | |||||
} | |||||
.table { | |||||
th { | |||||
font-size: 13px ; | |||||
} | |||||
th.column-actions, td.column-actions { | |||||
width: 150px ; | |||||
text-align: right ; | |||||
} | |||||
td.text-small, th.text-small { | |||||
font-size: 12px ; | |||||
} | |||||
} | |||||
.pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { | |||||
background-color: $color1 ; | |||||
border: solid 1px $color1 ; | |||||
color: white ; | |||||
} | |||||
.pagination > li > a, .pagination > li > span { | |||||
color: $color1 ; | |||||
&:hover { | |||||
color: darken($color1, 10) ; | |||||
} | |||||
} | |||||
} | |||||
.main-footer { | |||||
a { | |||||
color: $color1 ; | |||||
} | |||||
} | |||||
} | |||||
body.login-page { | |||||
background: none ; | |||||
background-color: $color2 ; | |||||
.login-box { | |||||
.login-logo { | |||||
text-align: center ; | |||||
font-family: 'comfortaalight' ; | |||||
img { | |||||
width: 50px ; | |||||
} | |||||
} | |||||
.login-box-body { | |||||
.btn-primary { | |||||
background-color: $color1 ; | |||||
border-color: $color1 ; | |||||
padding: 5px 10px ; | |||||
&:active { | |||||
background-color: lighten($color1, 5) ; | |||||
border-color: $color1 ; | |||||
} | |||||
} | |||||
a { | |||||
color: $color1 ; | |||||
&:hover { | |||||
color: lighten($color1, 5) ; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} |
.product-index { | |||||
.td-photo { | |||||
max-width: 100px ; | |||||
width: 100px ; | |||||
} | |||||
.photo-product { | |||||
max-width: 100px ; | |||||
} | |||||
.ui-state-highlight { | |||||
height: 75px; | |||||
background-color: $color2 ; | |||||
} | |||||
} |
z-index: 1031 ; | z-index: 1031 ; | ||||
} | } | ||||
.pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { | |||||
background-color: $color1 ; | |||||
border: solid 1px $color1 ; | |||||
} | |||||
.pagination > li > a, .pagination > li > span { | |||||
color: $color1 ; | |||||
&:hover { | |||||
color: darken($color1, 10) ; | |||||
} | |||||
} | |||||
.wrap { | .wrap { | ||||
.btn-primary, | .btn-primary, | ||||
.btn-success { | .btn-success { | ||||
background-color: white ; | background-color: white ; | ||||
} | } | ||||
.wrap .product-index { | |||||
.td-photo { | |||||
max-width: 100px ; | |||||
width: 100px ; | |||||
} | |||||
.photo-product { | |||||
max-width: 100px ; | |||||
} | |||||
.ui-state-highlight { | |||||
height: 75px; | |||||
background-color: $color2 ; | |||||
} | |||||
} | |||||
/* communiquer */ | /* communiquer */ | ||||
.btn-liste-emails { | .btn-liste-emails { | ||||
float: right ; | float: right ; | ||||
position: relative ; | position: relative ; | ||||
top: -8px ; | |||||
top: 6px ; | |||||
} | } | ||||
} | } | ||||
td.align-center { | td.align-center { | ||||
text-align: center ; | text-align: center ; | ||||
} | } | ||||
} | |||||
} | |||||
@import "_adminlte.scss" ; | |||||
@import "site/_index.scss" ; | |||||
@import "subscription/_index.scss" ; | |||||
@import "product/_index.scss" ; | |||||
@import "stats/_products.scss" ; |
.site-index { | |||||
#distributions { | |||||
.info-box { | |||||
.date { | |||||
text-transform: uppercase ; | |||||
font-size: 12px ; | |||||
line-height: 20px ; | |||||
padding-top: 10px ; | |||||
span { | |||||
display: block ; | |||||
} | |||||
.day { | |||||
} | |||||
.num { | |||||
font-size: 30px ; | |||||
padding-top: 5px ; | |||||
padding-bottom: 5px ; | |||||
} | |||||
.month { | |||||
} | |||||
} | |||||
} | |||||
.info-box-content { | |||||
.buttons { | |||||
margin-top: 10px ; | |||||
} | |||||
} | |||||
} | |||||
} |
.stats-products { | |||||
//width: 100% ; | |||||
//overflow-x: scroll ; | |||||
} |
.subscription-index { | |||||
.table { | |||||
.column-auto-payment { | |||||
width: 50px ; | |||||
} | |||||
} | |||||
} |
* @return mixed | * @return mixed | ||||
* @throws NotFoundHttpException | * @throws NotFoundHttpException | ||||
*/ | */ | ||||
public static function search($params = [], $options = []) | |||||
public static function searchBy($params = [], $options = []) | |||||
{ | { | ||||
$class = get_called_class() ; | $class = get_called_class() ; | ||||
public static function searchDispatch($params = [], $options = []) | public static function searchDispatch($params = [], $options = []) | ||||
{ | { | ||||
$class = get_called_class() ; | $class = get_called_class() ; | ||||
return $class::search($params, $options) ; | |||||
return $class::searchBy($params, $options) ; | |||||
} | } | ||||
} | } |
class MyView extends \yii\web\View | class MyView extends \yii\web\View | ||||
{ | { | ||||
var $title ; | var $title ; | ||||
var $page_title ; | var $page_title ; | ||||
var $buttons ; | |||||
public function setTitle($title, $page_title = '') | public function setTitle($title, $page_title = '') | ||||
{ | { | ||||
$this->title = $title ; | $this->title = $title ; | ||||
if(strlen($page_title)) | |||||
if(strlen($page_title)) { | |||||
$this->page_title = $page_title ; | $this->page_title = $page_title ; | ||||
else | |||||
} | |||||
else { | |||||
$this->page_title = $title ; | $this->page_title = $title ; | ||||
} | |||||
} | } | ||||
public function getTitle() | public function getTitle() | ||||
return Yii::$app->controller->id.'/'.Yii::$app->controller->action->id ; | return Yii::$app->controller->id.'/'.Yii::$app->controller->action->id ; | ||||
} | } | ||||
public function addBreadcrumb($breadcrumb) | |||||
{ | |||||
$this->params['breadcrumbs'][] = $breadcrumb ; | |||||
} | |||||
public function addButton($button) | |||||
{ | |||||
$this->buttons[] = $button ; | |||||
} | |||||
} | } |
termes. | termes. | ||||
*/ | */ | ||||
$serverName = $_SERVER['SERVER_NAME'] ; | |||||
return [ | return [ | ||||
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', | 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', | ||||
'components' => [ | 'components' => [ | ||||
'enableAutoLogin' => true, | 'enableAutoLogin' => true, | ||||
'identityCookie' => [ | 'identityCookie' => [ | ||||
'name' => 'laboiteapain', | 'name' => 'laboiteapain', | ||||
'domain' => '.'.Yii::getAlias('@domainName'), | |||||
'domain' => (($serverName != 'localhost') ? '.' : '') . Yii::getAlias('@domainName'), | |||||
'path' => '/', | 'path' => '/', | ||||
] | ] | ||||
], | ], | ||||
'class' => 'yii\web\Session', | 'class' => 'yii\web\Session', | ||||
'name' => 'PHPLABOITEAPAINSESSID', | 'name' => 'PHPLABOITEAPAINSESSID', | ||||
'cookieParams' => [ | 'cookieParams' => [ | ||||
'domain' => '.'.Yii::getAlias('@domainName'), | |||||
'domain' => (($serverName != 'localhost') ? '.' : '') . Yii::getAlias('@domainName'), | |||||
'httpOnly' => true, | 'httpOnly' => true, | ||||
], | ], | ||||
], | ], |
* @property double $amount | * @property double $amount | ||||
* @property string $type | * @property string $type | ||||
* @property integer $id_producer | * @property integer $id_producer | ||||
* @property string $mean_payement | |||||
* @property string $mean_payment | |||||
*/ | */ | ||||
class CreditHistory extends ActiveRecordCommon | class CreditHistory extends ActiveRecordCommon | ||||
{ | { | ||||
*/ | */ | ||||
public function getStrMeanPayment() | public function getStrMeanPayment() | ||||
{ | { | ||||
self::getStrMeanPaymentBy($this->mean_payement) ; | |||||
self::getStrMeanPaymentBy($this->mean_payment) ; | |||||
} | } | ||||
/** | /** |
{ | { | ||||
$distribution = null ; | $distribution = null ; | ||||
if ($date != '') { | if ($date != '') { | ||||
$distribution = Distribution::find() | |||||
->where(['date' => $date]) | |||||
->one() ; | |||||
$distribution = Distribution::searchOne([ | |||||
'date' => $date | |||||
]) ; | |||||
if (!$distribution) { | if (!$distribution) { | ||||
$distribution = new Distribution; | $distribution = new Distribution; |
$html .= '<span class="label label-success">Payée</span>'; | $html .= '<span class="label label-success">Payée</span>'; | ||||
} elseif ($this->getPaymentStatus() == Order::PAYMENT_UNPAID) { | } elseif ($this->getPaymentStatus() == Order::PAYMENT_UNPAID) { | ||||
$html .= '<span class="label label-danger">Non payée</span><br /> | $html .= '<span class="label label-danger">Non payée</span><br /> | ||||
Reste <strong>' . $this->getRemainingAmount(true) . '</strong> à payer'; | |||||
Reste <strong>' . $this->getAmount(Order::AMOUNT_REMAINING, true) . '</strong> à payer'; | |||||
} elseif ($this->getPaymentStatus() == Order::PAYMENT_SURPLUS) { | } elseif ($this->getPaymentStatus() == Order::PAYMENT_SURPLUS) { | ||||
$html .= '<span class="label label-success">Payée</span>'; | $html .= '<span class="label label-success">Payée</span>'; | ||||
} | } | ||||
* @param integer $limit | * @param integer $limit | ||||
* @return array | * @return array | ||||
*/ | */ | ||||
public static function search($params = [], $options = []) | |||||
public static function searchBy($params = [], $options = []) | |||||
{ | { | ||||
$orders = parent::search($params, $options) ; | |||||
$orders = parent::searchBy($params, $options) ; | |||||
/* | /* | ||||
* Initialisation des commandes | * Initialisation des commandes |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
namespace common\models ; | |||||
use common\models\PointSale ; | |||||
class PointSaleSearch extends PointSale | |||||
{ | |||||
var $delivery ; | |||||
var $access_type ; | |||||
public function rules() | |||||
{ | |||||
return [ | |||||
[['restricted_access'], 'boolean'], | |||||
[['name', 'code'], 'string', 'max' => 255], | |||||
[['address', 'locality', 'infos_monday', 'infos_tuesday', | |||||
'infos_wednesday', 'infos_thursday', 'infos_friday', | |||||
'infos_saturday', 'infos_sunday'], 'string'], | |||||
[['point_production', 'credit', 'delivery_monday', 'delivery_tuesday', | |||||
'delivery_wednesday', 'delivery_thursday', 'delivery_friday', | |||||
'delivery_saturday', 'delivery_sunday'], 'boolean'], | |||||
['id_producer', 'integer'], | |||||
[['users', 'users_comment', 'code','name', 'delivery', 'access_type'], 'safe'] | |||||
]; | |||||
} | |||||
public function search($params) | |||||
{ | |||||
$optionsSearch = self::defaultOptionsSearch() ; | |||||
$query = PointSale::find() | |||||
->with($optionsSearch['with']) | |||||
->innerJoinWith($optionsSearch['join_with'], true) | |||||
->where(['point_sale.id_producer' => Producer::getId()]) | |||||
; | |||||
$dataProvider = new ActiveDataProvider([ | |||||
'query' => $query, | |||||
'sort' => ['attributes' => ['name', 'locality','point_production','credit']], | |||||
'pagination' => [ | |||||
'pageSize' => 20, | |||||
], | |||||
]); | |||||
$this->load($params); | |||||
if (!$this->validate()) { | |||||
return $dataProvider; | |||||
} | |||||
if(isset($this->point_production) && is_numeric($this->point_production)) { | |||||
$query->andWhere([ | |||||
'point_sale.point_production' => $this->point_production | |||||
]) ; | |||||
} | |||||
if(isset($this->delivery) && strlen($this->delivery)) { | |||||
$query->andWhere([ | |||||
'point_sale.delivery_'.$this->delivery => 1 | |||||
]) ; | |||||
} | |||||
if(isset($this->access_type) && strlen($this->access_type)) { | |||||
if($this->access_type == 'open') { | |||||
$query->andWhere(['or', | |||||
['=','point_sale.code',''], | |||||
['IS','point_sale.code',null], | |||||
]) ; | |||||
$query->andWhere(['point_sale.restricted_access' => 0]) ; | |||||
} | |||||
elseif($this->access_type == 'code') { | |||||
$query->andWhere(['!=','point_sale.code','']) ; | |||||
} | |||||
elseif($this->access_type == 'restricted_access') { | |||||
$query->andWhere(['point_sale.restricted_access' => 1]) ; | |||||
} | |||||
} | |||||
$query->andFilterWhere(['like', 'point_sale.name', $this->name]) ; | |||||
$query->andFilterWhere(['like', 'point_sale.locality', $this->locality]) ; | |||||
return $dataProvider; | |||||
} | |||||
} |
* | * | ||||
* @return Producer|boolean | * @return Producer|boolean | ||||
*/ | */ | ||||
public static function get() | |||||
public static function getCurrent() | |||||
{ | { | ||||
if(self::getId()) { | if(self::getId()) { | ||||
return self::searchOne() ; | return self::searchOne() ; |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
namespace common\models ; | |||||
use common\models\Product ; | |||||
class ProductSearch extends Product | |||||
{ | |||||
public function rules() | |||||
{ | |||||
return [ | |||||
[['active', 'order', 'quantity_max', 'id_producer'], 'integer'], | |||||
[['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'unavailable'], 'boolean'], | |||||
[['price', 'weight'], 'number'], | |||||
[[ 'photo'], 'file'], | |||||
[['name', 'description', 'photo'], 'string', 'max' => 255], | |||||
[['recipe'], 'string', 'max' => 1000], | |||||
]; | |||||
} | |||||
public function search($params) | |||||
{ | |||||
$optionsSearch = self::defaultOptionsSearch() ; | |||||
$query = Product::find() | |||||
->with($optionsSearch['with']) | |||||
->innerJoinWith($optionsSearch['join_with'], true) | |||||
->where(['product.id_producer' => Producer::getId()]) | |||||
; | |||||
$dataProvider = new ActiveDataProvider([ | |||||
'query' => $query, | |||||
'sort' => ['attributes' => ['order', 'photo', 'name', 'description','active']], | |||||
'pagination' => [ | |||||
'pageSize' => 20, | |||||
], | |||||
]); | |||||
$this->load($params); | |||||
if (!$this->validate()) { | |||||
return $dataProvider; | |||||
} | |||||
$query->andFilterWhere(['like', 'product.name', $this->name]) ; | |||||
$query->andFilterWhere(['like', 'product.description', $this->description]) ; | |||||
if(isset($this->active) && is_numeric($this->active)) { | |||||
$query->andWhere([ | |||||
'product.active' => $this->active | |||||
]) ; | |||||
} | |||||
return $dataProvider; | |||||
} | |||||
} |
* | * | ||||
* @return array | * @return array | ||||
*/ | */ | ||||
public static function defaultOptionsSearch() { | |||||
public static function defaultOptionsSearch() | |||||
{ | |||||
return [ | return [ | ||||
'with' => ['producer', 'pointSale', 'productSubscription'], | |||||
'join_with' => ['user'], | |||||
'with' => ['producer'], | |||||
'join_with' => ['user', 'productSubscription', 'productSubscription.product', 'pointSale'], | |||||
'orderby' => 'user.name ASC', | 'orderby' => 'user.name ASC', | ||||
'attribute_id_producer' => 'subscription.id_producer' | 'attribute_id_producer' => 'subscription.id_producer' | ||||
] ; | ] ; |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
namespace common\models; | |||||
use common\models\Subscription ; | |||||
class SubscriptionSearch extends Subscription | |||||
{ | |||||
var $username; | |||||
var $product_name; | |||||
var $day ; | |||||
public function rules() | |||||
{ | |||||
return [ | |||||
[['id_point_sale', 'week_frequency'], 'integer'], | |||||
[['auto_payment'], 'boolean'], | |||||
[['date_begin', 'username','product_name', 'day'], 'safe'], | |||||
]; | |||||
} | |||||
public function search($params) { | |||||
$optionsSearch = self::defaultOptionsSearch() ; | |||||
$query = Subscription::find() | |||||
->with($optionsSearch['with']) | |||||
->innerJoinWith($optionsSearch['join_with'], true) | |||||
->where(['subscription.id_producer' => Producer::getId()]) | |||||
; | |||||
$dataProvider = new ActiveDataProvider([ | |||||
'query' => $query, | |||||
'sort' => ['attributes' => ['username']], | |||||
'pagination' => [ | |||||
'pageSize' => 20, | |||||
], | |||||
]); | |||||
$dataProvider->sort->attributes['username'] = [ | |||||
'asc' => ['user.lastname' => SORT_ASC, 'user.name' => SORT_ASC], | |||||
'desc' => ['user.lastname' => SORT_DESC, 'user.name' => SORT_DESC], | |||||
]; | |||||
$dataProvider->sort->attributes['id_point_sale'] = [ | |||||
'asc' => ['point_sale.name' => SORT_ASC], | |||||
'desc' => ['point_sale.name' => SORT_DESC], | |||||
]; | |||||
$dataProvider->sort->attributes['auto_payment'] = [ | |||||
'asc' => ['subscription.auto_payment' => SORT_ASC], | |||||
'desc' => ['subscription.auto_payment' => SORT_DESC], | |||||
]; | |||||
$this->load($params); | |||||
if (!$this->validate()) { | |||||
return $dataProvider; | |||||
} | |||||
if(isset($this->id_point_sale) && is_numeric($this->id_point_sale)) { | |||||
$query->andWhere([ | |||||
'subscription.id_point_sale' => $this->id_point_sale | |||||
]) ; | |||||
} | |||||
if(isset($this->auto_payment) && is_numeric($this->auto_payment)) { | |||||
$query->andWhere([ | |||||
'subscription.auto_payment' => $this->auto_payment | |||||
]) ; | |||||
} | |||||
if(isset($this->week_frequency) && is_numeric($this->week_frequency)) { | |||||
$query->andWhere([ | |||||
'subscription.week_frequency' => $this->week_frequency | |||||
]) ; | |||||
} | |||||
if(isset($this->day) && strlen($this->day)) { | |||||
$query->andWhere([ | |||||
'subscription.'.$this->day => 1 | |||||
]) ; | |||||
} | |||||
if(strlen($this->date_begin)) { | |||||
$date = \DateTime::createFromFormat('d/m/Y', $this->date_begin); | |||||
$query->andWhere([ | |||||
'subscription.date_begin' => date('Y-m-d',$date->format('U')) | |||||
]) ; | |||||
} | |||||
$query->andFilterWhere([ | |||||
'or', | |||||
['like', 'user.lastname', $this->username], | |||||
['like', 'user.name', $this->username] | |||||
]); | |||||
$query->andFilterWhere(['like', 'product.name', $this->product_name]) ; | |||||
return $dataProvider; | |||||
} | |||||
} |
{ | { | ||||
return [ | return [ | ||||
'id' => 'ID', | 'id' => 'ID', | ||||
'name' => 'Prénom', | |||||
'lastname' => 'Nom', | |||||
'username' => 'Identifiant', | 'username' => 'Identifiant', | ||||
'password' => 'Mot de passe', | 'password' => 'Mot de passe', | ||||
'rememberMe' => 'Se souvenir de moi', | 'rememberMe' => 'Se souvenir de moi', | ||||
*/ | */ | ||||
public static function findBy($params = []) | public static function findBy($params = []) | ||||
{ | { | ||||
if (!isset($params['id_producer'])) { | if (!isset($params['id_producer'])) { | ||||
$params['id_producer'] = Producer::getId() ; | $params['id_producer'] = Producer::getId() ; | ||||
} | } | ||||
$query = (new Query()) | $query = (new Query()) | ||||
->select(['user.id AS user_id', 'user.name', 'user.lastname', 'user.phone', 'user.email', 'user.created_at', 'user.date_last_connection', 'user_producer.*']) | |||||
->select(['user.id AS user_id', 'user.name', 'user.lastname', 'user.phone', 'user.email', 'user.created_at','user.date_last_connection', 'user_producer.*']) | |||||
->from('user'); | ->from('user'); | ||||
$active = (isset($params['inactive']) && $params['inactive']) ? 0 : 1 ; | $active = (isset($params['inactive']) && $params['inactive']) ? 0 : 1 ; | ||||
} | } | ||||
/** | /** | ||||
* Retourne si l'utilisateur est un boulanger ou non. | |||||
* Retourne l'utilisateur courant. | |||||
* | |||||
* @return User | |||||
*/ | |||||
public static function getCurrent() | |||||
{ | |||||
if(!Yii::$app->user->isGuest) { | |||||
return Yii::$app->user->identity ; | |||||
} | |||||
return false ; | |||||
} | |||||
/** | |||||
* Retourne si l'utilisateur courant est connecté ou non. | |||||
* | |||||
* @return boolean | |||||
*/ | |||||
public static function isCurrentConnected() | |||||
{ | |||||
return !Yii::$app->user->isGuest ; | |||||
} | |||||
/** | |||||
* Retourne si l'utilisateur est un producteur ou non. | |||||
* | * | ||||
* @return boolean | * @return boolean | ||||
*/ | */ | ||||
{ | { | ||||
return ($this->status == User::STATUS_ADMIN || $this->status == User::STATUS_PRODUCER) && $this->id_producer; | return ($this->status == User::STATUS_ADMIN || $this->status == User::STATUS_PRODUCER) && $this->id_producer; | ||||
} | } | ||||
/** | |||||
* Retourne si l'utilisateur courant est un producteur ou non. | |||||
* | |||||
* @return boolean | |||||
*/ | |||||
public static function isCurrentProducer() | |||||
{ | |||||
$user = User::getCurrent() ; | |||||
if($user) { | |||||
return $user->isProducer() ; | |||||
} | |||||
return false ; | |||||
} | |||||
/** | |||||
* Retourne si l'utilisateur est un admin ou non. | |||||
* | |||||
* @return boolean | |||||
*/ | |||||
public function isAdmin() { | |||||
return $this->status == User::STATUS_ADMIN ; | |||||
} | |||||
/** | |||||
* Retourne si l'utilisateur courant est un admin ou non. | |||||
* | |||||
* @return boolean | |||||
*/ | |||||
public static function isCurrentAdmin() | |||||
{ | |||||
$user = User::getCurrent() ; | |||||
if($user) { | |||||
return $user->isAdmin() ; | |||||
} | |||||
return false ; | |||||
} | |||||
/** | /** | ||||
* Retourne le nom du producteur. | * Retourne le nom du producteur. |
<?php | |||||
/** | |||||
Copyright La boîte à pain (2018) | |||||
contact@laboiteapain.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
namespace common\models ; | |||||
use common\models\User ; | |||||
class UserSearch extends User | |||||
{ | |||||
var $id_point_sale ; | |||||
var $inactive ; | |||||
var $username ; | |||||
public function rules() | |||||
{ | |||||
return [ | |||||
[['no_mail', 'mail_distribution_monday', 'mail_distribution_tuesday', 'mail_distribution_wednesday', 'mail_distribution_thursday', 'mail_distribution_friday', 'mail_distribution_saturday', 'mail_distribution_sunday'], 'boolean'], | |||||
[['lastname', 'name', 'phone', 'address'], 'string'], | |||||
[['id_point_sale', 'inactive'],'integer'], | |||||
[['date_last_connection', 'id_point_sale', 'username'], 'safe'], | |||||
]; | |||||
} | |||||
public function search($params) | |||||
{ | |||||
$optionsSearch = self::defaultOptionsSearch() ; | |||||
$query = User::find(); | |||||
$dataProvider = new ActiveDataProvider([ | |||||
'query' => $query, | |||||
'sort' => ['attributes' => ['username','credit','orders']], | |||||
'pagination' => [ | |||||
'pageSize' => 20, | |||||
], | |||||
]); | |||||
$dataProvider->sort->attributes['username'] = [ | |||||
'asc' => ['user.lastname' => SORT_ASC, 'user.name' => SORT_ASC], | |||||
'desc' => ['user.lastname' => SORT_DESC, 'user.name' => SORT_DESC], | |||||
]; | |||||
$dataProvider->sort->attributes['credit'] = [ | |||||
'asc' => ['user_producer.credit' => SORT_ASC], | |||||
'desc' => ['user_producer.credit' => SORT_DESC], | |||||
]; | |||||
$this->load($params); | |||||
if (!$this->validate()) { | |||||
return $dataProvider; | |||||
} | |||||
$active = (isset($this->inactive) && $this->inactive) ? 0 : 1 ; | |||||
$query->innerJoin('user_producer','user.id = user_producer.id_user AND user_producer.active = '.$active.' AND user_producer.id_producer = :id_producer', [':id_producer' => Producer::getId()]) ; | |||||
if(isset($this->id_point_sale) && $this->id_point_sale) { | |||||
$pointSale = PointSale::findOne(['id' => $this->id_point_sale]) ; | |||||
if($pointSale->restricted_access) { | |||||
$query->innerJoin('user_point_sale','user.id = user_point_sale.id_user AND user_point_sale.id_point_sale = :id_point_sale',[':id_point_sale' => $this->id_point_sale]) ; | |||||
} | |||||
else { | |||||
$query->innerJoin( | |||||
'order', | |||||
'user.id = order.id_user AND order.id_point_sale = :id_point_sale', | |||||
[':id_point_sale' => $this->id_point_sale] | |||||
)->groupBy('user.id') ; | |||||
} | |||||
} | |||||
if(isset($this->inactive) && $this->inactive) { | |||||
$query->innerJoin( | |||||
'order', | |||||
'user.id = order.id_user' | |||||
) | |||||
->groupBy('user.id'); | |||||
} | |||||
$query->andFilterWhere([ | |||||
'or', | |||||
['like', 'user.lastname', $this->username], | |||||
['like', 'user.name', $this->username] | |||||
]); | |||||
return $dataProvider; | |||||
} | |||||
} |
"2amigos/yii2-leaflet-extension" : "*", | "2amigos/yii2-leaflet-extension" : "*", | ||||
"kartik-v/yii2-mpdf": "dev-master", | "kartik-v/yii2-mpdf": "dev-master", | ||||
"c006/yii2-paypal-ipn": "dev-master", | "c006/yii2-paypal-ipn": "dev-master", | ||||
"yurkinx/yii2-image": "dev-master" | |||||
"yurkinx/yii2-image": "dev-master", | |||||
"dmstr/yii2-adminlte-asset": "^2.1" | |||||
}, | }, | ||||
"require-dev": { | "require-dev": { | ||||
"yiisoft/yii2-codeception": "*", | "yiisoft/yii2-codeception": "*", |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | ||||
"This file is @generated automatically" | "This file is @generated automatically" | ||||
], | ], | ||||
"hash": "46cc589f605c139a6a51351333713a31", | |||||
"content-hash": "82e078c37024338d837d4b3156a19b19", | |||||
"hash": "2e9a6a86294d914308fbf7224eb6353e", | |||||
"content-hash": "05a859eb0741bf9a3b81242b85b777c6", | |||||
"packages": [ | "packages": [ | ||||
{ | { | ||||
"name": "2amigos/yii2-chartjs-widget", | "name": "2amigos/yii2-chartjs-widget", | ||||
], | ], | ||||
"time": "2016-12-06 14:54:20" | "time": "2016-12-06 14:54:20" | ||||
}, | }, | ||||
{ | |||||
"name": "almasaeed2010/adminlte", | |||||
"version": "v2.4.8", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/almasaeed2010/AdminLTE.git", | |||||
"reference": "d9e68301848a95dff2e2dbef6569e617a9b3fa30" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/almasaeed2010/AdminLTE/zipball/d9e68301848a95dff2e2dbef6569e617a9b3fa30", | |||||
"reference": "d9e68301848a95dff2e2dbef6569e617a9b3fa30", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"bower-asset/jquery": ">=1.9.0 <4.0.0", | |||||
"composer/installers": "1.*" | |||||
}, | |||||
"type": "template", | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Abdullah Almsaeed", | |||||
"email": "abdullah@almsaeedstudio.com" | |||||
} | |||||
], | |||||
"description": "AdminLTE - admin control panel and dashboard that's based on Bootstrap 3", | |||||
"homepage": "https://adminlte.io/", | |||||
"keywords": [ | |||||
"JS", | |||||
"admin", | |||||
"back-end", | |||||
"css", | |||||
"less", | |||||
"responsive", | |||||
"template", | |||||
"theme", | |||||
"web" | |||||
], | |||||
"time": "2018-07-15 18:48:11" | |||||
}, | |||||
{ | { | ||||
"name": "bower-asset/bootstrap", | "name": "bower-asset/bootstrap", | ||||
"version": "v3.3.7", | "version": "v3.3.7", | ||||
], | ], | ||||
"time": "2016-09-14 20:40:20" | "time": "2016-09-14 20:40:20" | ||||
}, | }, | ||||
{ | |||||
"name": "cebe/yii2-gravatar", | |||||
"version": "1.1", | |||||
"target-dir": "cebe/gravatar", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/cebe/yii2-gravatar.git", | |||||
"reference": "c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/cebe/yii2-gravatar/zipball/c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057", | |||||
"reference": "c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"yiisoft/yii2": "*" | |||||
}, | |||||
"type": "yii2-extension", | |||||
"autoload": { | |||||
"psr-0": { | |||||
"cebe\\gravatar\\": "" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Carsten Brandt", | |||||
"email": "mail@cebe.cc", | |||||
"homepage": "http://cebe.cc/", | |||||
"role": "Core framework development" | |||||
} | |||||
], | |||||
"description": "Gravatar Widget for Yii 2", | |||||
"keywords": [ | |||||
"gravatar", | |||||
"yii" | |||||
], | |||||
"time": "2013-12-10 17:49:58" | |||||
}, | |||||
{ | |||||
"name": "composer/installers", | |||||
"version": "v1.6.0", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/composer/installers.git", | |||||
"reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", | |||||
"reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"composer-plugin-api": "^1.0" | |||||
}, | |||||
"replace": { | |||||
"roundcube/plugin-installer": "*", | |||||
"shama/baton": "*" | |||||
}, | |||||
"require-dev": { | |||||
"composer/composer": "1.0.*@dev", | |||||
"phpunit/phpunit": "^4.8.36" | |||||
}, | |||||
"type": "composer-plugin", | |||||
"extra": { | |||||
"class": "Composer\\Installers\\Plugin", | |||||
"branch-alias": { | |||||
"dev-master": "1.0-dev" | |||||
} | |||||
}, | |||||
"autoload": { | |||||
"psr-4": { | |||||
"Composer\\Installers\\": "src/Composer/Installers" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Kyle Robinson Young", | |||||
"email": "kyle@dontkry.com", | |||||
"homepage": "https://github.com/shama" | |||||
} | |||||
], | |||||
"description": "A multi-framework Composer library installer", | |||||
"homepage": "https://composer.github.io/installers/", | |||||
"keywords": [ | |||||
"Craft", | |||||
"Dolibarr", | |||||
"Eliasis", | |||||
"Hurad", | |||||
"ImageCMS", | |||||
"Kanboard", | |||||
"Lan Management System", | |||||
"MODX Evo", | |||||
"Mautic", | |||||
"Maya", | |||||
"OXID", | |||||
"Plentymarkets", | |||||
"Porto", | |||||
"RadPHP", | |||||
"SMF", | |||||
"Thelia", | |||||
"WolfCMS", | |||||
"agl", | |||||
"aimeos", | |||||
"annotatecms", | |||||
"attogram", | |||||
"bitrix", | |||||
"cakephp", | |||||
"chef", | |||||
"cockpit", | |||||
"codeigniter", | |||||
"concrete5", | |||||
"croogo", | |||||
"dokuwiki", | |||||
"drupal", | |||||
"eZ Platform", | |||||
"elgg", | |||||
"expressionengine", | |||||
"fuelphp", | |||||
"grav", | |||||
"installer", | |||||
"itop", | |||||
"joomla", | |||||
"kohana", | |||||
"laravel", | |||||
"lavalite", | |||||
"lithium", | |||||
"magento", | |||||
"majima", | |||||
"mako", | |||||
"mediawiki", | |||||
"modulework", | |||||
"modx", | |||||
"moodle", | |||||
"osclass", | |||||
"phpbb", | |||||
"piwik", | |||||
"ppi", | |||||
"puppet", | |||||
"pxcms", | |||||
"reindex", | |||||
"roundcube", | |||||
"shopware", | |||||
"silverstripe", | |||||
"sydes", | |||||
"symfony", | |||||
"typo3", | |||||
"wordpress", | |||||
"yawik", | |||||
"zend", | |||||
"zikula" | |||||
], | |||||
"time": "2018-08-27 06:10:37" | |||||
}, | |||||
{ | |||||
"name": "dmstr/yii2-adminlte-asset", | |||||
"version": "2.6.2", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/dmstr/yii2-adminlte-asset.git", | |||||
"reference": "c96336e1960ebc6c1e72487a7c6ca1a1589519fe" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/dmstr/yii2-adminlte-asset/zipball/c96336e1960ebc6c1e72487a7c6ca1a1589519fe", | |||||
"reference": "c96336e1960ebc6c1e72487a7c6ca1a1589519fe", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"almasaeed2010/adminlte": "^2.4.0", | |||||
"cebe/yii2-gravatar": "1.*", | |||||
"rmrevin/yii2-fontawesome": "~2.9", | |||||
"yiisoft/yii2": "2.*", | |||||
"yiisoft/yii2-bootstrap": "~2.0.0" | |||||
}, | |||||
"type": "yii2-extension", | |||||
"extra": { | |||||
"branch-alias": { | |||||
"dev-master": "2.0.x-dev" | |||||
} | |||||
}, | |||||
"autoload": { | |||||
"psr-4": { | |||||
"dmstr\\": "" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"BSD-3-Clause" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Tobias Munk", | |||||
"email": "tobias@diemeisterei.de" | |||||
}, | |||||
{ | |||||
"name": "Evgeniy Tkachenko", | |||||
"email": "et.coder@gmail.com" | |||||
} | |||||
], | |||||
"description": "AdminLTE backend theme asset bundle for Yii 2.0 Framework", | |||||
"keywords": [ | |||||
"AdminLTE", | |||||
"admin", | |||||
"asset", | |||||
"backend", | |||||
"css", | |||||
"extension", | |||||
"less", | |||||
"theme", | |||||
"yii2" | |||||
], | |||||
"time": "2018-07-24 14:47:13" | |||||
}, | |||||
{ | { | ||||
"name": "ezyang/htmlpurifier", | "name": "ezyang/htmlpurifier", | ||||
"version": "v4.8.0", | "version": "v4.8.0", | ||||
], | ], | ||||
"time": "2016-07-16 12:58:58" | "time": "2016-07-16 12:58:58" | ||||
}, | }, | ||||
{ | |||||
"name": "fortawesome/font-awesome", | |||||
"version": "v4.7.0", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/FortAwesome/Font-Awesome.git", | |||||
"reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/FortAwesome/Font-Awesome/zipball/a8386aae19e200ddb0f6845b5feeee5eb7013687", | |||||
"reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687", | |||||
"shasum": "" | |||||
}, | |||||
"require-dev": { | |||||
"jekyll": "1.0.2", | |||||
"lessc": "1.4.2" | |||||
}, | |||||
"type": "library", | |||||
"extra": { | |||||
"branch-alias": { | |||||
"dev-master": "4.6.x-dev" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"OFL-1.1", | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Dave Gandy", | |||||
"email": "dave@fontawesome.io", | |||||
"homepage": "http://twitter.com/davegandy", | |||||
"role": "Developer" | |||||
} | |||||
], | |||||
"description": "The iconic font and CSS framework", | |||||
"homepage": "http://fontawesome.io/", | |||||
"keywords": [ | |||||
"FontAwesome", | |||||
"awesome", | |||||
"bootstrap", | |||||
"font", | |||||
"icon" | |||||
], | |||||
"time": "2016-10-24 15:52:54" | |||||
}, | |||||
{ | { | ||||
"name": "kartik-v/yii2-mpdf", | "name": "kartik-v/yii2-mpdf", | ||||
"version": "dev-master", | "version": "dev-master", | ||||
}, | }, | ||||
"dist": { | "dist": { | ||||
"type": "zip", | "type": "zip", | ||||
"url": "https://api.github.com/repos/kartik-v/yii2-mpdf/zipball/67980ab7861ae9541b1a1784be8938dbeba13045", | |||||
"url": "https://api.github.com/repos/kartik-v/yii2-mpdf/zipball/beecfa00d5debfef1ccac6ff7b1abe8560b6ffd1", | |||||
"reference": "17fda1cb084c58fee6014026d35af5faf73316ef", | "reference": "17fda1cb084c58fee6014026d35af5faf73316ef", | ||||
"shasum": "" | "shasum": "" | ||||
}, | }, | ||||
], | ], | ||||
"time": "2016-12-12 10:42:18" | "time": "2016-12-12 10:42:18" | ||||
}, | }, | ||||
{ | |||||
"name": "rmrevin/yii2-fontawesome", | |||||
"version": "2.17.1", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/rmrevin/yii2-fontawesome.git", | |||||
"reference": "65ce306da864f4d558348aeba040ed7876878090" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/rmrevin/yii2-fontawesome/zipball/65ce306da864f4d558348aeba040ed7876878090", | |||||
"reference": "65ce306da864f4d558348aeba040ed7876878090", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"fortawesome/font-awesome": "~4.7", | |||||
"php": ">=5.4.0", | |||||
"yiisoft/yii2": "2.0.*" | |||||
}, | |||||
"type": "yii2-extension", | |||||
"extra": { | |||||
"asset-installer-paths": { | |||||
"npm-asset-library": "vendor/npm", | |||||
"bower-asset-library": "vendor/bower" | |||||
} | |||||
}, | |||||
"autoload": { | |||||
"psr-4": { | |||||
"rmrevin\\yii\\fontawesome\\": "" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Revin Roman", | |||||
"email": "roman@rmrevin.com", | |||||
"homepage": "https://rmrevin.com/" | |||||
} | |||||
], | |||||
"description": "Asset Bundle for Yii2 with Font Awesome", | |||||
"keywords": [ | |||||
"asset", | |||||
"awesome", | |||||
"bundle", | |||||
"font", | |||||
"yii" | |||||
], | |||||
"time": "2017-01-11 14:05:47" | |||||
}, | |||||
{ | { | ||||
"name": "setasign/fpdi", | "name": "setasign/fpdi", | ||||
"version": "1.6.1", | "version": "1.6.1", |
*/ | */ | ||||
class SiteController extends FrontendController | class SiteController extends FrontendController | ||||
{ | { | ||||
/** | /** | ||||
* @inheritdoc | * @inheritdoc | ||||
*/ | */ | ||||
public function actionLogin() | public function actionLogin() | ||||
{ | { | ||||
if (!\Yii::$app->user->isGuest) { | if (!\Yii::$app->user->isGuest) { | ||||
return Yii::$app->getResponse()->redirect(['order/index']); | |||||
return Yii::$app->getResponse()->redirect(['site/index']); | |||||
} | } | ||||
$model = new LoginForm(); | $model = new LoginForm(); |
$user->phone = $this->phone; | $user->phone = $this->phone; | ||||
if ($this->option_user_producer == 'producer') { | if ($this->option_user_producer == 'producer') { | ||||
// etablissement | |||||
// producteur | |||||
$producer = new Producer; | $producer = new Producer; | ||||
$producer->name = $this->name_producer; | $producer->name = $this->name_producer; | ||||
$producer->type = $this->type; | $producer->type = $this->type; | ||||
$user->setPassword($this->password); | $user->setPassword($this->password); | ||||
$user->generateAuthKey(); | $user->generateAuthKey(); | ||||
if ($user->save()) { | if ($user->save()) { | ||||
// on ajoute l'établissement sélectionnée par l'user en favoris | // on ajoute l'établissement sélectionnée par l'user en favoris | ||||
if ($this->option_user_producer == 'producer') { | |||||
if ($this->id_producer) { | |||||
$producer = Producer::find()->where(['id' => $this->id_producer])->one(); | |||||
if ($producer) { | |||||
Producer::addUser($user->id, $this->id_producer) ; | |||||
if ($this->option_user_producer == 'user' && $this->id_producer) { | |||||
$producer = Producer::find()->where(['id' => $this->id_producer])->one(); | |||||
// envoi d'un email à l'utilisateur | |||||
Yii::$app->mailer->compose( | |||||
[ | |||||
'html' => 'signup-html', | |||||
'text' => 'signup-text' | |||||
], | |||||
[ | |||||
'user' => $user, | |||||
'producer' => $producer | |||||
]) | |||||
->setTo($user->email) | |||||
->setFrom([Yii::$app->params['adminEmail'] => 'La boîte à pain']) | |||||
->setSubject('[La boîte à pain] Inscription') | |||||
->send(); | |||||
} | |||||
if ($producer) { | |||||
Producer::addUser($user->id, $this->id_producer) ; | |||||
// envoi d'un email à l'utilisateur | |||||
Yii::$app->mailer->compose( | |||||
[ | |||||
'html' => 'signup-html', | |||||
'text' => 'signup-text' | |||||
], | |||||
[ | |||||
'user' => $user, | |||||
'producer' => $producer | |||||
]) | |||||
->setTo($user->email) | |||||
->setFrom([Yii::$app->params['adminEmail'] => 'La boîte à pain']) | |||||
->setSubject('[La boîte à pain] Inscription') | |||||
->send(); | |||||
} | } | ||||
} | } | ||||
if ($this->option_user_producer == 'producer') { | |||||
$userProducer = new UserProducer; | |||||
$userProducer->id_producer = $producer->id; | |||||
$userProducer->id_user = $user->id; | |||||
$userProducer->credit = 0; | |||||
$userProducer->active = 1; | |||||
$userProducer->save(); | |||||
} | |||||
return $user; | return $user; | ||||
} | } | ||||
} | } |
return array( | return array( | ||||
'yii\\image\\' => array($vendorDir . '/yurkinx/yii2-image'), | 'yii\\image\\' => array($vendorDir . '/yurkinx/yii2-image'), | ||||
'cebe\\gravatar\\' => array($vendorDir . '/cebe/yii2-gravatar'), | |||||
'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src'), | 'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src'), | ||||
'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'), | 'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'), | ||||
'Diff' => array($vendorDir . '/phpspec/php-diff/lib'), | 'Diff' => array($vendorDir . '/phpspec/php-diff/lib'), |
'yii\\codeception\\' => array($vendorDir . '/yiisoft/yii2-codeception'), | 'yii\\codeception\\' => array($vendorDir . '/yiisoft/yii2-codeception'), | ||||
'yii\\bootstrap\\' => array($vendorDir . '/yiisoft/yii2-bootstrap'), | 'yii\\bootstrap\\' => array($vendorDir . '/yiisoft/yii2-bootstrap'), | ||||
'yii\\' => array($vendorDir . '/yiisoft/yii2'), | 'yii\\' => array($vendorDir . '/yiisoft/yii2'), | ||||
'rmrevin\\yii\\fontawesome\\' => array($vendorDir . '/rmrevin/yii2-fontawesome'), | |||||
'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'), | 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'), | ||||
'kartik\\mpdf\\' => array($vendorDir . '/kartik-v/yii2-mpdf'), | 'kartik\\mpdf\\' => array($vendorDir . '/kartik-v/yii2-mpdf'), | ||||
'dosamigos\\leaflet\\' => array($vendorDir . '/2amigos/yii2-leaflet-extension/src'), | 'dosamigos\\leaflet\\' => array($vendorDir . '/2amigos/yii2-leaflet-extension/src'), | ||||
'dosamigos\\chartjs\\' => array($vendorDir . '/2amigos/yii2-chartjs-widget/src'), | 'dosamigos\\chartjs\\' => array($vendorDir . '/2amigos/yii2-chartjs-widget/src'), | ||||
'dmstr\\' => array($vendorDir . '/dmstr/yii2-adminlte-asset'), | |||||
'cebe\\markdown\\' => array($vendorDir . '/cebe/markdown'), | 'cebe\\markdown\\' => array($vendorDir . '/cebe/markdown'), | ||||
'c006\\paypal_ipn\\' => array($vendorDir . '/c006/yii2-paypal-ipn'), | 'c006\\paypal_ipn\\' => array($vendorDir . '/c006/yii2-paypal-ipn'), | ||||
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), | 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), | ||||
'Facebook\\WebDriver\\' => array($vendorDir . '/facebook/webdriver/lib'), | 'Facebook\\WebDriver\\' => array($vendorDir . '/facebook/webdriver/lib'), | ||||
'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), | 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), | ||||
'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), | 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), | ||||
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'), | |||||
'Codeception\\Extension\\' => array($vendorDir . '/codeception/codeception/ext'), | 'Codeception\\Extension\\' => array($vendorDir . '/codeception/codeception/ext'), | ||||
'Codeception\\' => array($vendorDir . '/codeception/codeception/src/Codeception'), | 'Codeception\\' => array($vendorDir . '/codeception/codeception/src/Codeception'), | ||||
); | ); |
}, | }, | ||||
"dist": { | "dist": { | ||||
"type": "zip", | "type": "zip", | ||||
"url": "https://api.github.com/repos/kartik-v/yii2-mpdf/zipball/67980ab7861ae9541b1a1784be8938dbeba13045", | |||||
"url": "https://api.github.com/repos/kartik-v/yii2-mpdf/zipball/beecfa00d5debfef1ccac6ff7b1abe8560b6ffd1", | |||||
"reference": "17fda1cb084c58fee6014026d35af5faf73316ef", | "reference": "17fda1cb084c58fee6014026d35af5faf73316ef", | ||||
"shasum": "" | "shasum": "" | ||||
}, | }, | ||||
"functional testing", | "functional testing", | ||||
"unit testing" | "unit testing" | ||||
] | ] | ||||
}, | |||||
{ | |||||
"name": "composer/installers", | |||||
"version": "v1.6.0", | |||||
"version_normalized": "1.6.0.0", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/composer/installers.git", | |||||
"reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", | |||||
"reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"composer-plugin-api": "^1.0" | |||||
}, | |||||
"replace": { | |||||
"roundcube/plugin-installer": "*", | |||||
"shama/baton": "*" | |||||
}, | |||||
"require-dev": { | |||||
"composer/composer": "1.0.*@dev", | |||||
"phpunit/phpunit": "^4.8.36" | |||||
}, | |||||
"time": "2018-08-27 06:10:37", | |||||
"type": "composer-plugin", | |||||
"extra": { | |||||
"class": "Composer\\Installers\\Plugin", | |||||
"branch-alias": { | |||||
"dev-master": "1.0-dev" | |||||
} | |||||
}, | |||||
"installation-source": "dist", | |||||
"autoload": { | |||||
"psr-4": { | |||||
"Composer\\Installers\\": "src/Composer/Installers" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Kyle Robinson Young", | |||||
"email": "kyle@dontkry.com", | |||||
"homepage": "https://github.com/shama" | |||||
} | |||||
], | |||||
"description": "A multi-framework Composer library installer", | |||||
"homepage": "https://composer.github.io/installers/", | |||||
"keywords": [ | |||||
"Craft", | |||||
"Dolibarr", | |||||
"Eliasis", | |||||
"Hurad", | |||||
"ImageCMS", | |||||
"Kanboard", | |||||
"Lan Management System", | |||||
"MODX Evo", | |||||
"Mautic", | |||||
"Maya", | |||||
"OXID", | |||||
"Plentymarkets", | |||||
"Porto", | |||||
"RadPHP", | |||||
"SMF", | |||||
"Thelia", | |||||
"WolfCMS", | |||||
"agl", | |||||
"aimeos", | |||||
"annotatecms", | |||||
"attogram", | |||||
"bitrix", | |||||
"cakephp", | |||||
"chef", | |||||
"cockpit", | |||||
"codeigniter", | |||||
"concrete5", | |||||
"croogo", | |||||
"dokuwiki", | |||||
"drupal", | |||||
"eZ Platform", | |||||
"elgg", | |||||
"expressionengine", | |||||
"fuelphp", | |||||
"grav", | |||||
"installer", | |||||
"itop", | |||||
"joomla", | |||||
"kohana", | |||||
"laravel", | |||||
"lavalite", | |||||
"lithium", | |||||
"magento", | |||||
"majima", | |||||
"mako", | |||||
"mediawiki", | |||||
"modulework", | |||||
"modx", | |||||
"moodle", | |||||
"osclass", | |||||
"phpbb", | |||||
"piwik", | |||||
"ppi", | |||||
"puppet", | |||||
"pxcms", | |||||
"reindex", | |||||
"roundcube", | |||||
"shopware", | |||||
"silverstripe", | |||||
"sydes", | |||||
"symfony", | |||||
"typo3", | |||||
"wordpress", | |||||
"yawik", | |||||
"zend", | |||||
"zikula" | |||||
] | |||||
}, | |||||
{ | |||||
"name": "fortawesome/font-awesome", | |||||
"version": "v4.7.0", | |||||
"version_normalized": "4.7.0.0", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/FortAwesome/Font-Awesome.git", | |||||
"reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/FortAwesome/Font-Awesome/zipball/a8386aae19e200ddb0f6845b5feeee5eb7013687", | |||||
"reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687", | |||||
"shasum": "" | |||||
}, | |||||
"require-dev": { | |||||
"jekyll": "1.0.2", | |||||
"lessc": "1.4.2" | |||||
}, | |||||
"time": "2016-10-24 15:52:54", | |||||
"type": "library", | |||||
"extra": { | |||||
"branch-alias": { | |||||
"dev-master": "4.6.x-dev" | |||||
} | |||||
}, | |||||
"installation-source": "dist", | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"OFL-1.1", | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Dave Gandy", | |||||
"email": "dave@fontawesome.io", | |||||
"homepage": "http://twitter.com/davegandy", | |||||
"role": "Developer" | |||||
} | |||||
], | |||||
"description": "The iconic font and CSS framework", | |||||
"homepage": "http://fontawesome.io/", | |||||
"keywords": [ | |||||
"FontAwesome", | |||||
"awesome", | |||||
"bootstrap", | |||||
"font", | |||||
"icon" | |||||
] | |||||
}, | |||||
{ | |||||
"name": "rmrevin/yii2-fontawesome", | |||||
"version": "2.17.1", | |||||
"version_normalized": "2.17.1.0", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/rmrevin/yii2-fontawesome.git", | |||||
"reference": "65ce306da864f4d558348aeba040ed7876878090" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/rmrevin/yii2-fontawesome/zipball/65ce306da864f4d558348aeba040ed7876878090", | |||||
"reference": "65ce306da864f4d558348aeba040ed7876878090", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"fortawesome/font-awesome": "~4.7", | |||||
"php": ">=5.4.0", | |||||
"yiisoft/yii2": "2.0.*" | |||||
}, | |||||
"time": "2017-01-11 14:05:47", | |||||
"type": "yii2-extension", | |||||
"extra": { | |||||
"asset-installer-paths": { | |||||
"npm-asset-library": "vendor/npm", | |||||
"bower-asset-library": "vendor/bower" | |||||
} | |||||
}, | |||||
"installation-source": "dist", | |||||
"autoload": { | |||||
"psr-4": { | |||||
"rmrevin\\yii\\fontawesome\\": "" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Revin Roman", | |||||
"email": "roman@rmrevin.com", | |||||
"homepage": "https://rmrevin.com/" | |||||
} | |||||
], | |||||
"description": "Asset Bundle for Yii2 with Font Awesome", | |||||
"keywords": [ | |||||
"asset", | |||||
"awesome", | |||||
"bundle", | |||||
"font", | |||||
"yii" | |||||
] | |||||
}, | |||||
{ | |||||
"name": "almasaeed2010/adminlte", | |||||
"version": "v2.4.8", | |||||
"version_normalized": "2.4.8.0", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/almasaeed2010/AdminLTE.git", | |||||
"reference": "d9e68301848a95dff2e2dbef6569e617a9b3fa30" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/almasaeed2010/AdminLTE/zipball/d9e68301848a95dff2e2dbef6569e617a9b3fa30", | |||||
"reference": "d9e68301848a95dff2e2dbef6569e617a9b3fa30", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"bower-asset/jquery": ">=1.9.0 <4.0.0", | |||||
"composer/installers": "1.*" | |||||
}, | |||||
"time": "2018-07-15 18:48:11", | |||||
"type": "template", | |||||
"installation-source": "dist", | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Abdullah Almsaeed", | |||||
"email": "abdullah@almsaeedstudio.com" | |||||
} | |||||
], | |||||
"description": "AdminLTE - admin control panel and dashboard that's based on Bootstrap 3", | |||||
"homepage": "https://adminlte.io/", | |||||
"keywords": [ | |||||
"JS", | |||||
"admin", | |||||
"back-end", | |||||
"css", | |||||
"less", | |||||
"responsive", | |||||
"template", | |||||
"theme", | |||||
"web" | |||||
] | |||||
}, | |||||
{ | |||||
"name": "cebe/yii2-gravatar", | |||||
"version": "1.1", | |||||
"version_normalized": "1.1.0.0", | |||||
"target-dir": "cebe/gravatar", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/cebe/yii2-gravatar.git", | |||||
"reference": "c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/cebe/yii2-gravatar/zipball/c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057", | |||||
"reference": "c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"yiisoft/yii2": "*" | |||||
}, | |||||
"time": "2013-12-10 17:49:58", | |||||
"type": "yii2-extension", | |||||
"installation-source": "dist", | |||||
"autoload": { | |||||
"psr-0": { | |||||
"cebe\\gravatar\\": "" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"MIT" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Carsten Brandt", | |||||
"email": "mail@cebe.cc", | |||||
"homepage": "http://cebe.cc/", | |||||
"role": "Core framework development" | |||||
} | |||||
], | |||||
"description": "Gravatar Widget for Yii 2", | |||||
"keywords": [ | |||||
"gravatar", | |||||
"yii" | |||||
] | |||||
}, | |||||
{ | |||||
"name": "dmstr/yii2-adminlte-asset", | |||||
"version": "2.6.2", | |||||
"version_normalized": "2.6.2.0", | |||||
"source": { | |||||
"type": "git", | |||||
"url": "https://github.com/dmstr/yii2-adminlte-asset.git", | |||||
"reference": "c96336e1960ebc6c1e72487a7c6ca1a1589519fe" | |||||
}, | |||||
"dist": { | |||||
"type": "zip", | |||||
"url": "https://api.github.com/repos/dmstr/yii2-adminlte-asset/zipball/c96336e1960ebc6c1e72487a7c6ca1a1589519fe", | |||||
"reference": "c96336e1960ebc6c1e72487a7c6ca1a1589519fe", | |||||
"shasum": "" | |||||
}, | |||||
"require": { | |||||
"almasaeed2010/adminlte": "^2.4.0", | |||||
"cebe/yii2-gravatar": "1.*", | |||||
"rmrevin/yii2-fontawesome": "~2.9", | |||||
"yiisoft/yii2": "2.*", | |||||
"yiisoft/yii2-bootstrap": "~2.0.0" | |||||
}, | |||||
"time": "2018-07-24 14:47:13", | |||||
"type": "yii2-extension", | |||||
"extra": { | |||||
"branch-alias": { | |||||
"dev-master": "2.0.x-dev" | |||||
} | |||||
}, | |||||
"installation-source": "dist", | |||||
"autoload": { | |||||
"psr-4": { | |||||
"dmstr\\": "" | |||||
} | |||||
}, | |||||
"notification-url": "https://packagist.org/downloads/", | |||||
"license": [ | |||||
"BSD-3-Clause" | |||||
], | |||||
"authors": [ | |||||
{ | |||||
"name": "Tobias Munk", | |||||
"email": "tobias@diemeisterei.de" | |||||
}, | |||||
{ | |||||
"name": "Evgeniy Tkachenko", | |||||
"email": "et.coder@gmail.com" | |||||
} | |||||
], | |||||
"description": "AdminLTE backend theme asset bundle for Yii 2.0 Framework", | |||||
"keywords": [ | |||||
"AdminLTE", | |||||
"admin", | |||||
"asset", | |||||
"backend", | |||||
"css", | |||||
"extension", | |||||
"less", | |||||
"theme", | |||||
"yii2" | |||||
] | |||||
} | } | ||||
] | ] |
'@kartik/mpdf' => $vendorDir . '/kartik-v/yii2-mpdf', | '@kartik/mpdf' => $vendorDir . '/kartik-v/yii2-mpdf', | ||||
), | ), | ||||
), | ), | ||||
'rmrevin/yii2-fontawesome' => | |||||
array ( | |||||
'name' => 'rmrevin/yii2-fontawesome', | |||||
'version' => '2.17.1.0', | |||||
'alias' => | |||||
array ( | |||||
'@rmrevin/yii/fontawesome' => $vendorDir . '/rmrevin/yii2-fontawesome', | |||||
), | |||||
), | |||||
'cebe/yii2-gravatar' => | |||||
array ( | |||||
'name' => 'cebe/yii2-gravatar', | |||||
'version' => '1.1.0.0', | |||||
'alias' => | |||||
array ( | |||||
'@cebe/gravatar' => $vendorDir . '/cebe/yii2-gravatar/cebe/gravatar', | |||||
), | |||||
), | |||||
'dmstr/yii2-adminlte-asset' => | |||||
array ( | |||||
'name' => 'dmstr/yii2-adminlte-asset', | |||||
'version' => '2.6.2.0', | |||||
'alias' => | |||||
array ( | |||||
'@dmstr' => $vendorDir . '/dmstr/yii2-adminlte-asset', | |||||
), | |||||
), | |||||
); | ); |
Yii::info($log, __METHOD__); | Yii::info($log, __METHOD__); | ||||
$this->afterLogin($identity, false, $duration); | $this->afterLogin($identity, false, $duration); | ||||
} | } | ||||
return !$this->getIsGuest(); | return !$this->getIsGuest(); | ||||
} | } | ||||