Merge branch 'develop' into issue-55
This commit is contained in:
commit
fa3ff2129e
21 changed files with 1923 additions and 1605 deletions
|
|
@ -19,8 +19,8 @@ final class InvoicingUnit extends BaseEnum
|
|||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'pce' => 'PCE',
|
||||
'kgm' => 'KGM',
|
||||
'pce' => 'PCE',
|
||||
'kgm' => 'KGM',
|
||||
'colis' => 'COLIS',
|
||||
];
|
||||
}
|
||||
|
|
@ -33,8 +33,8 @@ final class InvoicingUnit extends BaseEnum
|
|||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
'pce' => __('Pièce'),
|
||||
'kgm' => __('Kg'),
|
||||
'pce' => __('Pièce'),
|
||||
'kgm' => __('Kg'),
|
||||
'colis' => __('Colis'),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ final class OrderUnit extends BaseEnum
|
|||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'pce' => 'PCE',
|
||||
'kgm' => 'KGM',
|
||||
'pce' => 'PCE',
|
||||
'kgm' => 'KGM',
|
||||
'colis' => 'COLIS',
|
||||
];
|
||||
}
|
||||
|
|
@ -33,8 +33,8 @@ final class OrderUnit extends BaseEnum
|
|||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
'pce' => __('Pièce'),
|
||||
'kgm' => __('Kg'),
|
||||
'pce' => __('Pièce'),
|
||||
'kgm' => __('Kg'),
|
||||
'colis' => __('Colis'),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class PriceShowingMode extends BaseEnumRoutable
|
|||
{
|
||||
return [
|
||||
'authenticated' => 'authenticated',
|
||||
'guest' => 'guest',
|
||||
'guest' => 'guest',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ class PriceShowingMode extends BaseEnumRoutable
|
|||
{
|
||||
return [
|
||||
'authenticated' => __('Client Connecté'),
|
||||
'guest' => __('Public'),
|
||||
'guest' => __('Public'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ class ProductBrand extends BaseEnumRoutable
|
|||
public static function labels()
|
||||
{
|
||||
return [
|
||||
'none' => 'Sans marque',
|
||||
'loue' => 'Loué',
|
||||
'legaulois' => 'Le Gaulois',
|
||||
'legauloispro' => 'Le Gaulois Professionnel',
|
||||
'marie' => 'Marie',
|
||||
'tregalette' => 'Trégalette',
|
||||
'none' => 'Sans marque',
|
||||
'loue' => 'Loué',
|
||||
'legaulois' => 'Le Gaulois',
|
||||
'legauloispro' => 'Le Gaulois Professionnel',
|
||||
'marie' => 'Marie',
|
||||
'tregalette' => 'Trégalette',
|
||||
'esprirestauration' => 'Espri Restauration',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,21 +34,21 @@ class SalarieSite extends BaseEnumRoutable
|
|||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'slhp' => 'SLHP',
|
||||
'ldcser' => 'LDCSER',
|
||||
'ldcvol' => 'LDCVOL',
|
||||
'ldcter' => 'LDCTER',
|
||||
'ldctra' => 'LDCTRA',
|
||||
'ldccav' => 'LDCCAV',
|
||||
'ldchol' => 'LDCHOL',
|
||||
'slhp' => 'SLHP',
|
||||
'ldcser' => 'LDCSER',
|
||||
'ldcvol' => 'LDCVOL',
|
||||
'ldcter' => 'LDCTER',
|
||||
'ldctra' => 'LDCTRA',
|
||||
'ldccav' => 'LDCCAV',
|
||||
'ldchol' => 'LDCHOL',
|
||||
'cepacpe' => 'CEPACP',
|
||||
'dde' => 'DDE',
|
||||
'dpe' => 'DPE',
|
||||
'sl' => 'SL',
|
||||
'gdfroi' => 'GDFROI',
|
||||
'ldcplb' => 'LDCPLB',
|
||||
'slela' => 'SLELA',
|
||||
'tpwiss' => 'TPWISS'
|
||||
'dde' => 'DDE',
|
||||
'dpe' => 'DPE',
|
||||
'sl' => 'SL',
|
||||
'gdfroi' => 'GDFROI',
|
||||
'ldcplb' => 'LDCPLB',
|
||||
'slela' => 'SLELA',
|
||||
'tpwiss' => 'TPWISS'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -60,21 +60,21 @@ class SalarieSite extends BaseEnumRoutable
|
|||
public static function labels()
|
||||
{
|
||||
return [
|
||||
'slhp' => 'Holdings',
|
||||
'ldcser' => 'LDC Services',
|
||||
'ldcvol' => 'LDC Sablé',
|
||||
'ldcter' => 'LDC Intenational',
|
||||
'ldctra' => 'LDC Traiteur',
|
||||
'ldccav' => 'Cavol',
|
||||
'ldchol' => 'LDC Holding',
|
||||
'slhp' => 'Holdings',
|
||||
'ldcser' => 'LDC Services',
|
||||
'ldcvol' => 'LDC Sablé',
|
||||
'ldcter' => 'LDC Intenational',
|
||||
'ldctra' => 'LDC Traiteur',
|
||||
'ldccav' => 'Cavol',
|
||||
'ldchol' => 'LDC Holding',
|
||||
'cepacpe' => 'CPE-CEPA',
|
||||
'dde' => 'Unité Dinde',
|
||||
'dpe' => 'DPE',
|
||||
'sl' => 'Saint-Laurent',
|
||||
'gdfroi' => 'Grand Froid',
|
||||
'ldcplb' => 'LDC PLB',
|
||||
'slela' => 'SLELA',
|
||||
'tpwiss' => 'TPWISS'
|
||||
'dde' => 'Unité Dinde',
|
||||
'dpe' => 'DPE',
|
||||
'sl' => 'Saint-Laurent',
|
||||
'gdfroi' => 'Grand Froid',
|
||||
'ldcplb' => 'LDC PLB',
|
||||
'slela' => 'SLELA',
|
||||
'tpwiss' => 'TPWISS'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ final class SellUnit extends BaseEnum
|
|||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'pce' => 'PCE',
|
||||
'kgm' => 'KGM',
|
||||
'pce' => 'PCE',
|
||||
'kgm' => 'KGM',
|
||||
'colis' => 'COLIS',
|
||||
];
|
||||
}
|
||||
|
|
@ -33,8 +33,8 @@ final class SellUnit extends BaseEnum
|
|||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
'pce' => __('Pièce'),
|
||||
'kgm' => __('Kg'),
|
||||
'pce' => __('Pièce'),
|
||||
'kgm' => __('Kg'),
|
||||
'colis' => __('Colis'),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ final class SettingRegisterMode extends BaseEnum
|
|||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'public' => 'public',
|
||||
'public' => 'public',
|
||||
'salaries' => 'salaries',
|
||||
];
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ final class SettingRegisterMode extends BaseEnum
|
|||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
'public' => __('Public'),
|
||||
'public' => __('Public'),
|
||||
'salaries' => __('Salaries'),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
41
app/Enums/StatsCustomerType.php
Normal file
41
app/Enums/StatsCustomerType.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use Kwaadpepper\Enum\BaseEnum;
|
||||
|
||||
/**
|
||||
* @method static self nbSalarie()
|
||||
* @method static self nbSalarieWithAccount()
|
||||
* @method static self membershipRate()
|
||||
*
|
||||
*/
|
||||
class StatsCustomerType extends BaseEnum
|
||||
{
|
||||
/**
|
||||
* Enum values
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'nbSalarie' => 1,
|
||||
'nbSalarieWithAccount' => 2,
|
||||
'membershipRate' => 3,
|
||||
];
|
||||
}
|
||||
/**
|
||||
* Enum labels
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
'nbSalarie' => trans('Nombre de salariés'),
|
||||
'nbSalarieWithAccount' => trans('Nombre de salariés ayant créé un compte'),
|
||||
'membershipRate' => trans('Taux d\'adhésion à la :appName', ['appName' => config('app.name')]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -5,21 +5,22 @@ namespace App\Enums;
|
|||
use Kwaadpepper\Enum\BaseEnum;
|
||||
|
||||
/**
|
||||
* @method static self nbActiveClients()
|
||||
* @method static self nbValidateCmd()
|
||||
* @method static self nbWaitingCmd()
|
||||
* @method static self nbCanceledCmd()
|
||||
* @method static self canceledRate()
|
||||
* @method static self orderFrequency()
|
||||
* @method static self nbActiveClients()
|
||||
* @method static self nbCmdWith7DayDelay()
|
||||
* @method static self nbCmdWith14DayDelay()
|
||||
* @method static self nbCmdWithMoreThan14DayDelay()
|
||||
* @method static self caHt()
|
||||
* @method static self canceledRate()
|
||||
* @method static self orderFrequency()
|
||||
* @method static self purchaseFrequency()
|
||||
* @method static self averageBasketHt()
|
||||
* @method static self averageProductCountPerOrder()
|
||||
* @method static self caHt()
|
||||
* @method static self caTtc()
|
||||
*
|
||||
*/
|
||||
class StatsType extends BaseEnum
|
||||
class StatsShopType extends BaseEnum
|
||||
{
|
||||
/**
|
||||
* Enum values
|
||||
|
|
@ -29,18 +30,19 @@ class StatsType extends BaseEnum
|
|||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'nbValidateCmd' => 1,
|
||||
'nbWaitingCmd' => 2,
|
||||
'nbCanceledCmd' => 3,
|
||||
'canceledRate' => 4,
|
||||
'orderFrequency' => 5,
|
||||
'nbActiveClients' => 6,
|
||||
'nbCmdWith7DayDelay' => 7,
|
||||
'nbCmdWith14DayDelay' => 8,
|
||||
'nbCmdWithMoreThan14DayDelay' => 9,
|
||||
'caHt' => 10,
|
||||
'averageBasketHt' => 11,
|
||||
'averageProductCountPerOrder' => 12
|
||||
'nbActiveClients' => 1,
|
||||
'nbValidateCmd' => 2,
|
||||
'nbWaitingCmd' => 3,
|
||||
'nbCanceledCmd' => 4,
|
||||
'nbCmdWith7DayDelay' => 5,
|
||||
'nbCmdWith14DayDelay' => 6,
|
||||
'canceledRate' => 7,
|
||||
'orderFrequency' => 8,
|
||||
'purchaseFrequency' => 9,
|
||||
'averageBasketHt' => 10,
|
||||
'averageProductCountPerOrder' => 11,
|
||||
'caHt' => 12,
|
||||
'caTtc' => 13,
|
||||
];
|
||||
}
|
||||
/**
|
||||
|
|
@ -51,18 +53,19 @@ class StatsType extends BaseEnum
|
|||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
'nbValidateCmd' => trans('Nombre de commandes validées'),
|
||||
'nbWaitingCmd' => trans('Nombre de commandes en attente'),
|
||||
'nbCanceledCmd' => trans('Nombre de commandes annulées'),
|
||||
'canceledRate' => trans('Taux d\'abandon (en pourcentage)'),
|
||||
'orderFrequency' => trans('Fréquence d\'achat (en jours)'),
|
||||
'nbActiveClients' => trans('Nombre de clients actifs'),
|
||||
'nbValidateCmd' => trans('Commandes validées'),
|
||||
'nbWaitingCmd' => trans('Commandes en attente'),
|
||||
'nbCanceledCmd' => trans('Commandes annulées'),
|
||||
'nbCmdWith7DayDelay' => trans('Nombre de commandes à J+7'),
|
||||
'nbCmdWith14DayDelay' => trans('Nombre de commandes à J+14'),
|
||||
'nbCmdWithMoreThan14DayDelay' => trans('Nombre de commandes à J+15 et plus'),
|
||||
'caHt' => trans('Montant total HT'),
|
||||
'canceledRate' => trans('Taux d\'abandon'),
|
||||
'orderFrequency' => trans('Fréquence de commande'),
|
||||
'purchaseFrequency' => trans('Fréquence d\'achat'),
|
||||
'averageBasketHt' => trans('Prix du panier moyen'),
|
||||
'averageProductCountPerOrder' => trans('Nombre d\'article moyen par commande')
|
||||
'averageProductCountPerOrder' => trans('Nombre d\'article moyen par commande'),
|
||||
'caHt' => trans('Montant total HT'),
|
||||
'caTtc' => trans('Montant total TTC'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -19,8 +19,8 @@ final class WeightUnit extends BaseEnum
|
|||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
'g' => 'G',
|
||||
'kg' => 'KG',
|
||||
'g' => 'G',
|
||||
'kg' => 'KG',
|
||||
'ton' => 'T',
|
||||
];
|
||||
}
|
||||
|
|
@ -33,8 +33,8 @@ final class WeightUnit extends BaseEnum
|
|||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
'g' => __('Gramme'),
|
||||
'kg' => __('Kg'),
|
||||
'g' => __('Gramme'),
|
||||
'kg' => __('Kg'),
|
||||
'ton' => __('Tonne'),
|
||||
];
|
||||
}
|
||||
|
|
@ -48,9 +48,9 @@ final class WeightUnit extends BaseEnum
|
|||
public static function convert(): array
|
||||
{
|
||||
return [
|
||||
'G' => 0.001,
|
||||
'G' => 0.001,
|
||||
'KG' => 1,
|
||||
'T' => 1000,
|
||||
'T' => 1000,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Enums\StatsCustomerType;
|
||||
use App\Enums\StatsShopType;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Carbon\Carbon;
|
||||
use App\Http\Requests\Bo\DashboardRequest;
|
||||
|
|
@ -17,16 +19,22 @@ class DashboardController extends Controller
|
|||
*/
|
||||
public function index(DashboardRequest $request)
|
||||
{
|
||||
$stats = [];
|
||||
$adhesion = StatsHelper::getMembershipPercentage();
|
||||
$previousDates = [];
|
||||
$statsShop = [];
|
||||
$statsCustomer = [];
|
||||
$prevDates = [];
|
||||
|
||||
if ($request->has('start') && $request->has('end')) {
|
||||
$start = new Carbon($request->start);
|
||||
$end = new Carbon($request->end);
|
||||
$previousDates = StatsHelper::getPreviousPeriod($start, $end);
|
||||
$stats = StatsHelper::getStats($start, $end);
|
||||
$start = new Carbon($request->start);
|
||||
$end = new Carbon($request->end);
|
||||
|
||||
$prevDates = StatsHelper::getPreviousPeriod($start, $end);
|
||||
$statsShop = StatsHelper::getStats(StatsShopType::toArray(), $start, $end);
|
||||
$statsCustomer = StatsHelper::getStats(StatsCustomerType::toArray(), $start, $end);
|
||||
}
|
||||
return view('bo.dashboard', compact('stats', 'adhesion', 'previousDates'));
|
||||
return view('bo.dashboard', compact(
|
||||
'prevDates',
|
||||
'statsShop',
|
||||
'statsCustomer',
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ use App\Models\TaxRate;
|
|||
use App\Models\XmlInco;
|
||||
use App\Traits\Controllers\ChangesModelOrder;
|
||||
use App\Traits\Controllers\UpdateModelStatus;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
|
@ -35,12 +36,18 @@ class ProductsController extends Controller
|
|||
{
|
||||
$ranges = Range::all();
|
||||
|
||||
$filter_range = $request->query('filter_range');
|
||||
$filter_brand = $request->query('filter_brand');
|
||||
$filter_name = $request->query('filter_name');
|
||||
$filter_range = $request->query('filter_range');
|
||||
$filter_brand = $request->query('filter_brand');
|
||||
$filter_name = $request->query('filter_name');
|
||||
$filter_code_product = $request->query('filter_code_product');
|
||||
|
||||
$products = new Product();
|
||||
$products = (new Product())::query();
|
||||
|
||||
if (!empty($filter_code_product)) {
|
||||
$products = $products->whereHas('foodProduct', function (Builder $q) use ($filter_code_product) {
|
||||
$q->where('no_art', 'like', $filter_code_product);
|
||||
});
|
||||
}
|
||||
if (!empty($filter_name)) {
|
||||
$products = $products->where('name', 'like', '%' . $filter_name . '%');
|
||||
}
|
||||
|
|
@ -65,7 +72,14 @@ class ProductsController extends Controller
|
|||
}
|
||||
}
|
||||
unset($product);
|
||||
return view('bo.products.index', compact('products', 'ranges', 'filter_name', 'filter_range', 'filter_brand'));
|
||||
return view('bo.products.index', compact(
|
||||
'products',
|
||||
'ranges',
|
||||
'filter_name',
|
||||
'filter_range',
|
||||
'filter_brand',
|
||||
'filter_code_product'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -217,7 +217,9 @@ class OrderTunnelController extends Controller
|
|||
* On utilise les méthodes de Carbon pour la comparaison de date, parce que c'est fait pour...
|
||||
*/
|
||||
if (
|
||||
$current->addHours($currentTime->format('H'))->addMinutes($currentTime->format('i'))->lessThan($now->add($delaiPrepa))
|
||||
$current->addHours($currentTime->format('H'))
|
||||
->addMinutes($currentTime->format('i'))
|
||||
->lessThan($now->add($delaiPrepa))
|
||||
) {
|
||||
$isDispo = false;
|
||||
}
|
||||
|
|
@ -258,7 +260,8 @@ class OrderTunnelController extends Controller
|
|||
);
|
||||
}
|
||||
// Génération des plages.
|
||||
// On commence le calcul à aujourd'hui + 1 car on ne va pas afficher de créaneaux pour aujourd'hui dans l'interface...
|
||||
// On commence le calcul à aujourd'hui + 1
|
||||
// car on ne va pas afficher de créaneaux pour aujourd'hui dans l'interface...
|
||||
$today = CarbonImmutable::now()->addDay()->startOfDay();
|
||||
$weekDay = $today->weekday();
|
||||
// Final boundary (permet de limiter la liste des jours d'exception).
|
||||
|
|
@ -275,7 +278,7 @@ class OrderTunnelController extends Controller
|
|||
$availCreneaux = array();
|
||||
|
||||
for ($i = 0; $i < $plage_days; $i++) {
|
||||
$current = $today->add($i, 'day');
|
||||
$current = $today->add($i, 'day');
|
||||
/**
|
||||
* On gère le décalage par rapport au tableau de settings...
|
||||
* Dans le tableau lundi = 0
|
||||
|
|
@ -349,7 +352,14 @@ class OrderTunnelController extends Controller
|
|||
return $availCreneaux;
|
||||
}
|
||||
|
||||
private function hasCreneauAvailableTime($creneaux)
|
||||
/**
|
||||
* hasCreneauAvailableTime
|
||||
*
|
||||
* @param array $creneaux
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function hasCreneauAvailableTime(array $creneaux): bool
|
||||
{
|
||||
foreach ($creneaux as $creneau) {
|
||||
if ($creneau[1]) {
|
||||
|
|
|
|||
|
|
@ -9,25 +9,25 @@ use App\Models\Salarie;
|
|||
use Carbon\Carbon;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Enums\StatsType;
|
||||
|
||||
final class StatsHelper
|
||||
{
|
||||
/**
|
||||
* getStats
|
||||
*
|
||||
* @param array $statsType
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return array
|
||||
*/
|
||||
public static function getStats(Carbon $start, Carbon $end)
|
||||
public static function getStats(array $statsType, Carbon $start, Carbon $end)
|
||||
{
|
||||
$stats = [];
|
||||
foreach (StatsType::toArray() as $type) {
|
||||
foreach ($statsType as $type) {
|
||||
$stats[$type->value] = [
|
||||
'previous' => self::getPrevious(sprintf('get%s', ucfirst($type->getDefinition())), $start, $end),
|
||||
'current' => self::{sprintf('get%s', ucfirst($type->getDefinition()))}($start, $end),
|
||||
'diff' => self::getDiff(sprintf('get%s', ucfirst($type->getDefinition())), $start, $end),
|
||||
'current' => self::{sprintf('get%s', ucfirst($type->getDefinition()))}($start, $end),
|
||||
'diff' => self::getDiff(sprintf('get%s', ucfirst($type->getDefinition())), $start, $end),
|
||||
];
|
||||
}
|
||||
return $stats;
|
||||
|
|
@ -60,16 +60,72 @@ final class StatsHelper
|
|||
return self::{$method}($start, $end) - self::getPrevious($method, $start, $end);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all validated orders.
|
||||
*
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return mixed
|
||||
*/
|
||||
private function getNbSalarie(Carbon $start, Carbon $end)
|
||||
{
|
||||
return self::getNumberCustomers($start, $end);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all validated orders.
|
||||
*
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return mixed
|
||||
*/
|
||||
private function getNbSalarieWithAccount(Carbon $start, Carbon $end)
|
||||
{
|
||||
return self::getNumberSalaries($start, $end);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the percentage of registered people / people with a generated code
|
||||
*
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return integer
|
||||
*/
|
||||
public static function getNumberCustomers(Carbon $start, Carbon $end): int
|
||||
{
|
||||
return Customers::query()
|
||||
->whereDate('created_at', '>=', $start)
|
||||
->whereDate('created_at', '<=', $end)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the percentage of registered people / people with a generated code
|
||||
*
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return integer
|
||||
*/
|
||||
public static function getNumberSalaries(Carbon $start, Carbon $end): int
|
||||
{
|
||||
return Customers::query()
|
||||
->has('salarie')
|
||||
->whereDate('created_at', '>=', $start)
|
||||
->whereDate('created_at', '<=', $end)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the percentage of registered people / people with a generated code
|
||||
*
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return integer|float
|
||||
*/
|
||||
public static function getMembershipPercentage()
|
||||
public static function getMembershipRate(Carbon $start, Carbon $end): int
|
||||
{
|
||||
$employee = Salarie::count();
|
||||
$registered = Customers::has('salarie')->count();
|
||||
return round($registered / $employee * 100, 2);
|
||||
$registered = self::getNumberSalaries($start, $end);
|
||||
return round($registered / Salarie::count() * 100, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -164,6 +220,23 @@ final class StatsHelper
|
|||
return round($nbValidateCmd / $period, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the order frequency.
|
||||
*
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return mixed
|
||||
*/
|
||||
private function getPurchaseFrequency(Carbon $start, Carbon $end)
|
||||
{
|
||||
$activeClients = self::getNbActiveClients($start, $end);
|
||||
if (!$activeClients) {
|
||||
return 0;
|
||||
}
|
||||
$nbValidateCmd = self::getNbValidateCmd($start, $end);
|
||||
return round($nbValidateCmd / $activeClients, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of active clients (ordered in the period).
|
||||
*
|
||||
|
|
@ -214,23 +287,6 @@ final class StatsHelper
|
|||
})->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number command where the collect day is > 14 days after the order.
|
||||
*
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return mixed
|
||||
*/
|
||||
private function getNbCmdWithMoreThan14DayDelay(Carbon $start, Carbon $end)
|
||||
{
|
||||
return Order::with('timeslot')->whereHas('status', function (Builder $query) {
|
||||
$query->whereIn('id', [3, 4, 5, 6]);
|
||||
})->whereBetween('date', [$start, $end])->get()->filter(function (Order $order) {
|
||||
return Carbon::create($order->timeslot->day)
|
||||
->greaterThan(Carbon::create($order->date)->modify('+14 day'));
|
||||
})->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CA HT.
|
||||
*
|
||||
|
|
@ -254,6 +310,30 @@ final class StatsHelper
|
|||
return $totalCaHt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CA TTC.
|
||||
*
|
||||
* @param \Carbon\Carbon $start
|
||||
* @param \Carbon\Carbon $end
|
||||
* @return mixed
|
||||
*/
|
||||
private function getCaTtc(Carbon $start, Carbon $end)
|
||||
{
|
||||
$orderedProducts = OrderLine::whereHas('order', function (Builder $query) use ($start, $end) {
|
||||
$query->whereHas('status', function (Builder $query) {
|
||||
$query->whereIn('id', [3, 4, 5, 6]);
|
||||
})->whereBetween('date', [$start->toDateString(), $end->toDateString()]);
|
||||
})->get();
|
||||
|
||||
$totalCaTtc = 0;
|
||||
$orderedProducts->map(function ($item) use (&$totalCaTtc) {
|
||||
$totalCaTtc += $item->total_ttc;
|
||||
});
|
||||
|
||||
return $totalCaTtc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the average basket HT.
|
||||
*
|
||||
|
|
@ -312,7 +392,7 @@ final class StatsHelper
|
|||
$diffDays = $start->copy()->diffInDays($end);
|
||||
return (object)[
|
||||
'start' => $start->copy()->subDays($diffDays + 1),
|
||||
'end' => $start->copy()->subDay()
|
||||
'end' => $start->copy()->subDay()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,17 +98,17 @@ class Customers extends Authenticatable
|
|||
parent::toArray(),
|
||||
(array)$this->apiData
|
||||
))->intersectByKeys([
|
||||
'email' => '',
|
||||
'firstname' => '',
|
||||
'lastname' => '',
|
||||
'address' => '',
|
||||
'address2' => '',
|
||||
'postcode' => '',
|
||||
'email' => '',
|
||||
'firstname' => '',
|
||||
'lastname' => '',
|
||||
'address' => '',
|
||||
'address2' => '',
|
||||
'postcode' => '',
|
||||
'birth_date' => '',
|
||||
'city' => '',
|
||||
'country' => '',
|
||||
'opt_in' => '',
|
||||
'phone' => ''
|
||||
'city' => '',
|
||||
'country' => '',
|
||||
'opt_in' => '',
|
||||
'phone' => ''
|
||||
])->toArray();
|
||||
} else {
|
||||
return parent::toArray();
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ class Product extends Model implements Buyable
|
|||
*/
|
||||
protected $casts = [
|
||||
'orderable_start' => 'datetime',
|
||||
'orderable_end' => 'datetime',
|
||||
'price' => 'float'
|
||||
'orderable_end' => 'datetime',
|
||||
'price' => 'float'
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -155,12 +155,12 @@ class Product extends Model implements Buyable
|
|||
public function getCalcPrices()
|
||||
{
|
||||
$prices = array(
|
||||
'priceHt' => $this->priceHt,
|
||||
'priceKgTtc' => $this->priceKgTtc,
|
||||
'discountAmount' => $this->discountAmount,
|
||||
'discountRate' => $this->discountRate,
|
||||
'discountedPriceHt' => $this->discountedPriceHt,
|
||||
'priceTtc' => $this->priceTtc,
|
||||
'priceHt' => $this->priceHt,
|
||||
'priceKgTtc' => $this->priceKgTtc,
|
||||
'discountAmount' => $this->discountAmount,
|
||||
'discountRate' => $this->discountRate,
|
||||
'discountedPriceHt' => $this->discountedPriceHt,
|
||||
'priceTtc' => $this->priceTtc,
|
||||
'discountedPriceTtc' => $this->discountedPriceTtc,
|
||||
);
|
||||
return $prices;
|
||||
|
|
|
|||
2332
package-lock.json
generated
2332
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -5,40 +5,24 @@
|
|||
<h1 class="h2">Dashboard</h1>
|
||||
</div>
|
||||
<div class="container">
|
||||
<table class="table table-responsive table-bordered">
|
||||
<thead>
|
||||
<tr class="text-center table-secondary">
|
||||
<th scope="col">{{ __('Nombre de salariés') }}</th>
|
||||
<th scope="col">{{ __('Nombre de salariés inscrits') }}</th>
|
||||
<th scope="col">{{ __('Taux d\'adhésion') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="text-center table-light text-bold fw-semibold">
|
||||
<td>{{ number_format(App\Models\Salarie::count(), 0, ",", " ") }}</td>
|
||||
<td>{{ number_format(App\Models\Customers::has('salarie')->count(), 0, ",", " ") }}</td>
|
||||
<td>{{ number_format($adhesion, 2, ",", " ") }} %</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
{{-- DATES --}}
|
||||
<form action="{{ route('bo.dashboard') }}">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<label for="start">{{ __('Date de début') }}:</label>
|
||||
<input class="form-control" type="date" id="start" name="start" value="{{ request()->start }}" required/>
|
||||
@if (!empty($stats))
|
||||
<label for="previousStart">{{ __('Date de début de la période précédente') }}:</label>
|
||||
<input class="form-control" type="date" id="previousStart" name="previousStart" value="{{ $previousDates->start->toDateString() }}" aria-label="disabled input" disabled>
|
||||
@if (!empty($statsShop))
|
||||
<label for="previousStart">{{ __('Date de début de la période précédente') }}:</label>
|
||||
<input class="form-control" type="date" id="previousStart" name="previousStart" value="{{ $prevDates->start->toDateString() }}" aria-label="disabled input" disabled>
|
||||
@endif
|
||||
<br>
|
||||
</div>
|
||||
<div class="col">
|
||||
<label for="end">{{ __('Date de fin') }}:</label>
|
||||
<input class="form-control" type="date" id="end" name="end" value="{{ request()->end }}" required/>
|
||||
@if (!empty($stats))
|
||||
<label for="previousEnd">{{ __('Date de fin de la période précédente') }}:</label>
|
||||
<input class="form-control" type="date" id="previousEnd" name="previousEnd" value="{{ $previousDates->end->toDateString() }}" aria-label="disabled input" disabled>
|
||||
@if (!empty($statsShop))
|
||||
<label for="previousEnd">{{ __('Date de fin de la période précédente') }}:</label>
|
||||
<input class="form-control" type="date" id="previousEnd" name="previousEnd" value="{{ $prevDates->end->toDateString() }}" aria-label="disabled input" disabled>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col d-inline-flex align-items-center">
|
||||
|
|
@ -46,99 +30,154 @@
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table class="table table-responsive table-bordered table-hover">
|
||||
<thead>
|
||||
<tr class="text-center bg-secondary bg-gradient bg-opacity-25">
|
||||
<th scope="col"></th>
|
||||
<th scope="col">{{ __('Période précédente') }}</th>
|
||||
<th scope="col">{{ __('Période actuelle') }}</th>
|
||||
<th scope="col">{{ __('Différence') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@if(!empty($stats))
|
||||
<tbody>
|
||||
@foreach ($stats as $k => $stat)
|
||||
<tr class="text-center">
|
||||
@if (
|
||||
$k === App\Enums\StatsType::nbWaitingCmd()->value ||
|
||||
$k === App\Enums\StatsType::nbCanceledCmd()->value ||
|
||||
$k === App\Enums\StatsType::canceledRate()->value ||
|
||||
$k === App\Enums\StatsType::orderFrequency()->value
|
||||
)
|
||||
<th @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif>{{ App\Enums\StatsType::make($k)->label }}</th>
|
||||
<td @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsType::canceledRate()->value)
|
||||
{{ number_format($stat['previous'], 2, ",", " ") }} %
|
||||
@break
|
||||
@case(App\Enums\StatsType::orderFrequency()->value)
|
||||
{{ number_format($stat['previous'], 2, ",", " ") }} {{ __('jours') }}
|
||||
@break
|
||||
@default
|
||||
{{ str_replace(".", ",", $stat['previous']) }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsType::canceledRate()->value)
|
||||
{{ number_format($stat['current'], 2, ",", " ") }} %
|
||||
@break
|
||||
@case(App\Enums\StatsType::orderFrequency()->value)
|
||||
{{ number_format($stat['current'], 2, ",", " ") }} {{ __('jours') }}
|
||||
@break
|
||||
@default
|
||||
{{ str_replace(".", ",", $stat['current']) }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] < 0) class="text-success table-success" @else class="text-danger table-danger" @endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsType::canceledRate()->value)
|
||||
<b>{{ number_format($stat['diff'], 2, ",", " ") }} %</b>
|
||||
@break
|
||||
@case(App\Enums\StatsType::orderFrequency()->value)
|
||||
<b>{{ number_format($stat['diff'], 2, ",", " ") }} {{ __('jours') }}</b>
|
||||
@break
|
||||
@default
|
||||
<b>{{ str_replace(".", ",", $stat['diff']) }}</b>
|
||||
@endswitch
|
||||
</td>
|
||||
@else
|
||||
<th @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>{{ App\Enums\StatsType::make($k)->label }}</th>
|
||||
<td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsType::caHt()->value)
|
||||
@case(App\Enums\StatsType::averageBasketHt()->value)
|
||||
{{ number_format($stat['previous'], 2, ",", " ") }} €
|
||||
@break
|
||||
@default
|
||||
{{ str_replace(".", ",", $stat['previous']) }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsType::caHt()->value)
|
||||
@case(App\Enums\StatsType::averageBasketHt()->value)
|
||||
{{ number_format($stat['current'], 2, ",", " ") }} €
|
||||
@break
|
||||
@default
|
||||
{{ str_replace(".", ",", $stat['current']) }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] > 0) class="text-success table-success" @else class="text-danger table-danger" @endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsType::caHt()->value)
|
||||
@case(App\Enums\StatsType::averageBasketHt()->value)
|
||||
<b>{{ number_format($stat['diff'], 2, ",", " ") }} €</b>
|
||||
@break
|
||||
@default
|
||||
<b>{{ str_replace(".", ",", $stat['diff']) }}</b>
|
||||
@endswitch
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@endif
|
||||
</table>
|
||||
{{-- CUSTOMERS DATA --}}
|
||||
@if(!empty($statsCustomer))
|
||||
<table class="table table-responsive table-bordered table-hover">
|
||||
<thead>
|
||||
<tr class="text-center bg-secondary bg-gradient bg-opacity-25">
|
||||
<th scope="col">{{-- keep empty --}}</th>
|
||||
<th scope="col">{{ __('Période précédente') }}</th>
|
||||
<th scope="col">{{ __('Période actuelle') }}</th>
|
||||
<th scope="col">{{ __('Différence') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($statsCustomer as $k => $stat)
|
||||
<tr class="text-center">
|
||||
<th @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>
|
||||
{{ App\Enums\StatsCustomerType::make($k)->label }}
|
||||
</th>
|
||||
<td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsCustomerType::membershipRate()->value)
|
||||
{{ number_format($stat['previous'], 2, ",", " ") }} %
|
||||
@break
|
||||
@default
|
||||
{{ $stat['previous'] }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsCustomerType::membershipRate()->value)
|
||||
{{ number_format($stat['current'], 2, ",", " ") }} %
|
||||
@break
|
||||
@default
|
||||
{{ $stat['current'] }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] > 0) class="text-success table-success" @else class="text-danger table-danger" @endif>
|
||||
<b>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsCustomerType::membershipRate()->value)
|
||||
{{ number_format($stat['diff'], 2, ",", " ") }} %
|
||||
@break
|
||||
@default
|
||||
{{ $stat['diff'] }}
|
||||
@endswitch
|
||||
</b>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
@if(!empty($statsShop))
|
||||
<table class="table table-responsive table-bordered table-hover">
|
||||
<thead>
|
||||
<tr class="text-center bg-secondary bg-gradient bg-opacity-25">
|
||||
<th scope="col">{{-- keep empty --}}</th>
|
||||
<th scope="col">{{ __('Période précédente') }}</th>
|
||||
<th scope="col">{{ __('Période actuelle') }}</th>
|
||||
<th scope="col">{{ __('Différence') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($statsShop as $k => $stat)
|
||||
<tr class="text-center">
|
||||
@if (
|
||||
$k === App\Enums\StatsShopType::nbWaitingCmd()->value ||
|
||||
$k === App\Enums\StatsShopType::nbCanceledCmd()->value ||
|
||||
$k === App\Enums\StatsShopType::canceledRate()->value
|
||||
)
|
||||
<th @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif>{{ App\Enums\StatsShopType::make($k)->label }}</th>
|
||||
<td @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsShopType::canceledRate()->value)
|
||||
{{ number_format($stat['previous'], 2, ",", " ") }} %
|
||||
@break
|
||||
@default
|
||||
{{ str_replace(".", ",", $stat['previous']) }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] < 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsShopType::canceledRate()->value)
|
||||
{{ number_format($stat['current'], 2, ",", " ") }} %
|
||||
@break
|
||||
@default
|
||||
{{ str_replace(".", ",", $stat['current']) }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] < 0) class="text-success table-success" @else class="text-danger table-danger" @endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsShopType::canceledRate()->value)
|
||||
<b>{{ number_format($stat['diff'], 2, ",", " ") }} %</b>
|
||||
@break
|
||||
@default
|
||||
<b>{{ str_replace(".", ",", $stat['diff']) }}</b>
|
||||
@endswitch
|
||||
</td>
|
||||
@else
|
||||
<th @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>{{ App\Enums\StatsShopType::make($k)->label }}</th>
|
||||
<td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsShopType::caHt()->value)
|
||||
@case(App\Enums\StatsShopType::caTtc()->value)
|
||||
@case(App\Enums\StatsShopType::averageBasketHt()->value)
|
||||
{{ number_format($stat['previous'], 2, ",", " ") }} €
|
||||
@break
|
||||
@case(App\Enums\StatsShopType::orderFrequency()->value)
|
||||
{{ number_format($stat['previous'], 2, ",", " ") }} {{ __('jours') }}
|
||||
@break
|
||||
@default
|
||||
{{ str_replace(".", ",", $stat['previous']) }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] > 0) class="table-success" @else class="table-danger"@endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsShopType::caHt()->value)
|
||||
@case(App\Enums\StatsShopType::caTtc()->value)
|
||||
@case(App\Enums\StatsShopType::averageBasketHt()->value)
|
||||
{{ number_format($stat['current'], 2, ",", " ") }} €
|
||||
@break
|
||||
@case(App\Enums\StatsShopType::orderFrequency()->value)
|
||||
{{ number_format($stat['current'], 2, ",", " ") }} {{ __('jours') }}
|
||||
@break
|
||||
@default
|
||||
{{ str_replace(".", ",", $stat['current']) }}
|
||||
@endswitch
|
||||
</td>
|
||||
<td @if ($stat['diff'] > 0) class="text-success table-success" @else class="text-danger table-danger" @endif>
|
||||
@switch($k)
|
||||
@case(App\Enums\StatsShopType::caHt()->value)
|
||||
@case(App\Enums\StatsShopType::caTtc()->value)
|
||||
@case(App\Enums\StatsShopType::averageBasketHt()->value)
|
||||
<b>{{ number_format($stat['diff'], 2, ",", " ") }} €</b>
|
||||
@break
|
||||
@case(App\Enums\StatsShopType::orderFrequency()->value)
|
||||
<b>{{ number_format($stat['diff'], 2, ",", " ") }} {{ __('jours') }}</b>
|
||||
@break
|
||||
@default
|
||||
<b>{{ str_replace(".", ",", $stat['diff']) }}</b>
|
||||
@endswitch
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<p>{{ __('Veuillez renseigner une période afin de visualiser les statistiques') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,65 +1,70 @@
|
|||
@extends('layouts.bo-layout')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Produits <small class="text-muted">Liste</small></h1>
|
||||
|
||||
<form method="GET">
|
||||
<div class="row">
|
||||
<label for="filter_range" class="col-form-label">Gamme</label>
|
||||
<div class="col">
|
||||
<select class="form-control" id="filter_range" name="filter_range">
|
||||
<option value="" @if ($filter_range == '') selected @endif>Toutes</option>
|
||||
@foreach($ranges as $range)
|
||||
<option value="{{$range->id}}" @if ($range->id == $filter_range) selected @endif>{{$range->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="pt-3 pb-2 mb-3 border-bottom">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center ">
|
||||
<h1 class="h2">Produits <small class="text-muted">Liste</small></h1>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-primary float-right dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Ajouter un produit
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
@foreach (Config::get('theme.enum_product_types') as $productType => $label)
|
||||
<a class="dropdown-item" href="{{route('bo.products.create', $productType)}}">{{ __($label) }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
<label for="filter_range" class="col-form-label">Marque</label>
|
||||
<div class="col">
|
||||
<select class="form-control" id="filter_brand" name="filter_brand">
|
||||
<option value="" @if ($filter_brand == '') selected @endif>Toutes</option>
|
||||
@foreach (ProductBrand::toArray() as $productbrand)
|
||||
<option value="{{ $productbrand->value }}" @if ($productbrand->value == $filter_brand) selected @endif>{{ $productbrand->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<label for="filter_name" class="col-form-label">Nom</label>
|
||||
<div class="col">
|
||||
<input class="form-control" type="text"
|
||||
placeholder="Recherchez un produit"
|
||||
id="filter_name" name="filter_name"
|
||||
value="{{ $filter_name ?? ''}}">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-primary">Filtrer</button>
|
||||
<a class="btn btn-info" href="{{ route('bo.products.index') }}">Effacer le filtre</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-primary float-right dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Ajouter un produit
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
@foreach (Config::get('theme.enum_product_types') as $productType=>$label)
|
||||
<a class="dropdown-item" href="{{route('bo.products.create', $productType)}}">{{ __($label) }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<form class="row" method="GET">
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="filter_name" class="col-form-label">Nom</label>
|
||||
<input class="form-control" type="text"
|
||||
placeholder="Recherchez un produit"
|
||||
id="filter_name" name="filter_name"
|
||||
value="{{ $filter_name ?? ''}}">
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="filter_range" class="col-form-label">Gamme</label>
|
||||
<select class="form-control" id="filter_range" name="filter_range">
|
||||
<option value="" @if ($filter_range == '') selected @endif>Toutes</option>
|
||||
@foreach($ranges as $range)
|
||||
<option value="{{$range->id}}" @if ($range->id == $filter_range) selected @endif>{{$range->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="filter_code_product" class="col-form-label">Code produit</label>
|
||||
<input class="form-control" type="number"
|
||||
placeholder="Recherchez un code produit"
|
||||
id="filter_code_product" name="filter_code_product"
|
||||
value="{{ $filter_code_product ?? ''}}">
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="filter_range" class="col-form-label">Marque</label>
|
||||
<select class="form-control" id="filter_brand" name="filter_brand">
|
||||
<option value="" @if ($filter_brand == '') selected @endif>Toutes</option>
|
||||
@foreach (ProductBrand::toArray() as $productbrand)
|
||||
<option value="{{ $productbrand->value }}" @if ($productbrand->value == $filter_brand) selected @endif>{{ $productbrand->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 text-center mt-3 mb-2">
|
||||
<button class="btn btn-primary">Filtrer</button>
|
||||
<a class="btn btn-info" href="{{ route('bo.products.index') }}">Effacer le filtre</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
@if(count(Config::get('theme.enum_product_types'))>1)
|
||||
<th scope="col">Type</th>
|
||||
@if(count(Config::get('theme.enum_product_types')) > 1)
|
||||
<th scope="col">Type</th>
|
||||
@endif
|
||||
<th scope="col">Ref Externe</th>
|
||||
<th scope="col">Code produit</th>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Nom</th>
|
||||
<th scope="col">Marque</th>
|
||||
<th scope="col">Prix en €</th>
|
||||
<th scope="col">Stock</th>
|
||||
<th scope="col">Référence</th>
|
||||
<th scope="col">Gamme</th>
|
||||
<th scope="col">Publié</th>
|
||||
<th scope="col">Ordre</th>
|
||||
|
|
@ -69,13 +74,13 @@
|
|||
@foreach ($products as $product)
|
||||
<tr>
|
||||
@if(count(Config::get('theme.enum_product_types'))>1)
|
||||
<td>
|
||||
{{ Config::get('theme.enum_product_types')[$product->product_type] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Config::get('theme.enum_product_types')[$product->product_type] }}
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
@if($product->product_type == "foodProduct")
|
||||
{{ $product->foodProduct->no_art }}
|
||||
{{ $product->foodProduct->no_art }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
|
|
@ -89,7 +94,6 @@
|
|||
<td>{{ $product->brand->label ?? '' }}</td>
|
||||
<td>{{ number_format($product->price, 2, ',', ' ') }}€</td>
|
||||
<td>{{ number_format($product->stock, 0, ',', ' ') }}</td>
|
||||
<td>{{ $product->reference }}</td>
|
||||
<td>{{ $product->range->name }}</td>
|
||||
<td>
|
||||
<form action="{{ route('bo.products.change-published', $product) }}" method="POST">
|
||||
|
|
|
|||
|
|
@ -4,206 +4,184 @@
|
|||
@section('description', 'Procédure d\inscription à la boutique.')
|
||||
|
||||
@section('content')
|
||||
<main class="auth-login container d-flex justify-content-center align-items-center">
|
||||
<div class="row">
|
||||
<div class="col my-5">
|
||||
<h1 class="title-medium font-Barlow-extra-bold text-uppercase text-grey text-center">{{ __('Inscription') }}</h1>
|
||||
@if (session('success'))
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<p class="m-0 me-2">{{ __('Félicitations') }}</p>
|
||||
<p class="m-0">{{ __('Votre compte a bien été créé !') }}</p>
|
||||
<p class="m-0">{{ __('Vous allez recevoir un mail de confirmation sur l\'adresse') }} {{ $mail }}</p>
|
||||
</div>
|
||||
<div class="text-center mt-2">
|
||||
<a class="btn btn-product rounded-4" href="{{ route('auth.connexion') }}">{{ __('Connectez-vous') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<form action="{{ route('auth.register.post') }}" method="POST" id="stdinscription">
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div>
|
||||
<ul class="list-group">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li class="list-group-item bg-transparent text-red border-0 text-center">{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
<main class="auth-login d-flex justify-content-center align-items-center container">
|
||||
<div class="row">
|
||||
<div class="col my-5">
|
||||
<h1 class="title-medium font-Barlow-extra-bold text-uppercase text-grey text-center">{{ __('Inscription') }}</h1>
|
||||
@if (session('success'))
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<p class="m-0 me-2">{{ __('Félicitations') }}</p>
|
||||
<p class="m-0">{{ __('Votre compte a bien été créé !') }}</p>
|
||||
<p class="m-0">{{ __('Vous allez recevoir un mail de confirmation sur l\'adresse') }} {{ $mail }}</p>
|
||||
</div>
|
||||
<div class="mt-2 text-center">
|
||||
<a class="btn btn-product rounded-4" href="{{ route('auth.connexion') }}">{{ __('Connectez-vous') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<form id="stdinscription" action="{{ route('auth.register.post') }}" method="POST">
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div>
|
||||
<ul class="list-group">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li class="list-group-item text-red border-0 bg-transparent text-center">{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@if (config('bosettings.register_salaries') && config('bosettings.register_public'))
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button class="btn btn-product rounded-4 no-after mb-2" id="codebutton" type="button"
|
||||
onclick="visibility2()">{{ __('J\'ai un code d\'inscription') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2" id="codeinscription" style="display: none;">
|
||||
<div class="col d-flex justify-content-center align-items-center p-0 text-center">
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="matricule" type="text"
|
||||
value="{{ old('matricule') }}" placeholder="Matricule*" />
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="code" type="text"
|
||||
value="{{ old('code') }}" placeholder="Code d'inscription*" />
|
||||
</div>
|
||||
</div>
|
||||
@elseif (config('bosettings.register_salaries') && !config('bosettings.register_public'))
|
||||
<div class="row mb-2" id="codeinscription">
|
||||
<div class="col d-flex justify-content-center align-items-center p-0 text-center">
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="matricule" type="text"
|
||||
value="{{ old('matricule') }}" placeholder="Matricule*" required />
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="code" type="text"
|
||||
value="{{ old('code') }}" placeholder="Code d'inscription*" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<p class="text-danger m-0 text-center">
|
||||
{{ __('Merci de renseigner votre matricule (disponible sur votre bulletin de salaire), sur 7 caractères (ex : v00115590 --> 0115590).') }}
|
||||
</p>
|
||||
<p class="text-danger m-0 text-center">
|
||||
{{ __('Merci de vous rapprocher de votre service RH pour connaître votre code d\'inscription à usage unique.') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-center align-items-center p-0 text-center">
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="lastname" type="text"
|
||||
value="{{ old('lastname') }}" placeholder="Nom*" required />
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="firstname" type="text"
|
||||
value="{{ old('firstname') }}" placeholder="Prénom*" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex justify-content-center align-items-center p-0 text-center">
|
||||
<p class="w-50 m-0">{{ __('Date de naissance *') }}</p>
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="birth_date" type="date"
|
||||
value="{{ old('birth_date') }}" placeholder="Date de naissance*" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<input class="w-100 form-control rounded-4 border-dark" name="email" type="email" value="{{ old('email') }}"
|
||||
placeholder="Votre adresse email *" autocomplete="email" pattern="[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$"
|
||||
required>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex justify-content-center align-items-center p-0 text-center">
|
||||
<input class="w-50 form-control rounded-4 border-dark" id="password" name="password" type="password"
|
||||
value="{{ old('password') }}" placeholder="Mot de passe*" required />
|
||||
<span class="input-group-btn" id="eyeSlash">
|
||||
<button class="btn no-after reveal" type="button" onclick="visibility3()">
|
||||
<i class="fas fa-eye-slash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</span>
|
||||
<span class="input-group-btn" id="eyeShow" style="display: none;">
|
||||
<button class="btn no-after reveal" type="button" onclick="visibility3()">
|
||||
<i class="fas fa-eye" aria-hidden="true"></i>
|
||||
</button>
|
||||
</span>
|
||||
<input class="w-50 form-control rounded-4 border-dark" id="password_confirmation"
|
||||
name="password_confirmation" type="password" value="{{ old('password_confirmation') }}"
|
||||
placeholder="Confirmer mot de passe*" autocomplete="new-password" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<p class="text-danger m-0 text-center">
|
||||
{{ __('Le mot de passe doit contenir :') }}
|
||||
</p>
|
||||
<p class="text-danger m-0 text-center">
|
||||
{{ __('- minimum 8 caractères') }}
|
||||
</p>
|
||||
<p class="text-danger m-0 text-center">
|
||||
{{ __('- au moins une majuscule') }}
|
||||
</p>
|
||||
<p class="text-danger m-0 text-center">
|
||||
{{ __('- au moins une minuscule') }}
|
||||
</p>
|
||||
<p class="text-danger m-0 text-center">
|
||||
{{ __('- au moins un chiffre') }}
|
||||
</p>
|
||||
<p class="text-danger m-0 text-center">
|
||||
{{ __('- au moins un caractère spécial.') }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<input class="w-100 form-control rounded-4 border-dark" id="phone" name="phone" type="number"
|
||||
value="{{ old('phone') }}" autocomplete="tel" placeholder="Téléphone" pattern="[0-9]{10}">
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex justify-content-center align-items-center p-0 text-center">
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="address" type="text"
|
||||
value="{{ old('address') }}" placeholder="Adresse postale*" autocomplete="street-address" required />
|
||||
<input class="w-50 form-control rounded-4 border-dark" name="postal_code" type="number"
|
||||
value="{{ old('postal_code') }}" placeholder="Code postal*" autocomplete="postal-code" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<input class="w-100 form-control rounded-4 border-dark" id="town" name="town" type="text"
|
||||
value="{{ old('town') }}" autocomplete="tel" placeholder="Ville*">
|
||||
</div>
|
||||
<div class="form-check d-flex justify-content-center align-items-center rounded-2 p-lg-0 mb-0 mt-2 flex-row px-3 py-2">
|
||||
<input class="form-check-input m-0" id="ok_cgv" name="ok_cgv" type="checkbox" role="button">
|
||||
<label class="w-75 form-check-label ps-2" for="ok_cgv" role="button">
|
||||
{{ __('J\'ai lu et accepte les') }} <a href="{{ route('terms') }}"
|
||||
target="mentions">{{ __('conditions générales') }}</a> et la <a href="{{ route('privacy') }}"
|
||||
target="mentions">{{ __('politique de gestion des données personnelles') }}</a>.
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check d-flex justify-content-center align-items-center rounded-2 p-lg-0 mb-0 mt-2 flex-row px-3 py-2">
|
||||
<input class="form-check-input m-0" id="optin" name="remember" type="checkbox" role="button">
|
||||
<label class="w-75 form-check-label ps-2" for="optin" role="button">
|
||||
{{ __('Je souhaite m\'inscrire à la newsletter') }} {{ Config::get('theme.site_name') }}.
|
||||
</label>
|
||||
</div>
|
||||
<div class="fst-italic my-2 text-center">{{ __('*Champs obligatoires') }}</div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button class="btn btn-product rounded-4" type="submit">{{ __('S\'inscrire') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex justify-content-center align-items-center text-center">
|
||||
<p class="m-0 me-2">{{ __('Déjà inscrit ?') }}</p>
|
||||
<a class="btn btn-product rounded-4" href="{{ route('auth.connexion') }}">{{ __('Connectez-vous') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if (config('bosettings.register_salaries') && config('bosettings.register_public'))
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button class="btn btn-product rounded-4 mb-2 no-after" onclick="visibility2()" type="button" id="codebutton">{{ __('J\'ai un code d\'inscription') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2" id="codeinscription" style="display: none;">
|
||||
<div class="col d-flex justify-content-center align-items-center text-center p-0">
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="text"
|
||||
name="matricule"
|
||||
placeholder="Matricule*"
|
||||
value="{{ old('matricule') }}"/>
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="text"
|
||||
name="code"
|
||||
placeholder="Code d'inscription*"
|
||||
value="{{ old('code') }}"/>
|
||||
</div>
|
||||
</div>
|
||||
@elseif (config('bosettings.register_salaries') && !config('bosettings.register_public'))
|
||||
<div class="row mb-2" id="codeinscription">
|
||||
<div class="col d-flex justify-content-center align-items-center text-center p-0">
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="text"
|
||||
name="matricule"
|
||||
placeholder="Matricule*"
|
||||
value="{{ old('matricule') }}" required/>
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="text"
|
||||
name="code"
|
||||
placeholder="Code d'inscription*"
|
||||
value="{{ old('code') }}" required/>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-center align-items-center text-center p-0">
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="text"
|
||||
name="lastname"
|
||||
placeholder="Nom*"
|
||||
value="{{ old('lastname') }}" required/>
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="text"
|
||||
name="firstname"
|
||||
placeholder="Prénom*"
|
||||
value="{{ old('firstname') }}" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex justify-content-center align-items-center text-center p-0">
|
||||
<p class="w-50 m-0">{{ __('Date de naissance *') }}</p>
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="date"
|
||||
name="birth_date"
|
||||
placeholder="Date de naissance*"
|
||||
value="{{ old('birth_date') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<input class="w-100 form-control rounded-4 border-dark"
|
||||
name="email"
|
||||
type="email"
|
||||
placeholder="Votre adresse email *"
|
||||
autocomplete="email"
|
||||
pattern="[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$"
|
||||
value="{{ old('email') }}" required>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex justify-content-center align-items-center text-center p-0">
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="password"
|
||||
name="password"
|
||||
id="password"
|
||||
placeholder="Mot de passe*"
|
||||
value="{{ old('password') }}" required/>
|
||||
<span class="input-group-btn" id="eyeSlash">
|
||||
<button class="btn no-after reveal" onclick="visibility3()" type="button">
|
||||
<i class="fas fa-eye-slash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</span>
|
||||
<span class="input-group-btn" id="eyeShow" style="display: none;">
|
||||
<button class="btn no-after reveal" onclick="visibility3()" type="button">
|
||||
<i class="fas fa-eye" aria-hidden="true"></i>
|
||||
</button>
|
||||
</span>
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="password"
|
||||
name="password_confirmation"
|
||||
id="password_confirmation"
|
||||
placeholder="Confirmer mot de passe*"
|
||||
autocomplete="new-password"
|
||||
value="{{ old('password_confirmation') }}" required/>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-center text-muted m-0">
|
||||
{{ __('Le mot de passe doit avoir une longueur minimale de 8 caractères et doit contenir majuscule, minuscule, chiffre et caractère spécial.') }}
|
||||
</p>
|
||||
<div class="row mt-2">
|
||||
<input class="w-100 form-control rounded-4 border-dark"
|
||||
type="number"
|
||||
name="phone"
|
||||
id="phone"
|
||||
autocomplete="tel"
|
||||
placeholder="Téléphone"
|
||||
pattern="[0-9]{10}"
|
||||
value="{{ old('phone') }}">
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex justify-content-center align-items-center text-center p-0">
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="text"
|
||||
name="address"
|
||||
placeholder="Adresse postale*"
|
||||
autocomplete="street-address"
|
||||
value="{{ old('address') }}" required/>
|
||||
<input class="w-50 form-control rounded-4 border-dark"
|
||||
type="number"
|
||||
name="postal_code"
|
||||
placeholder="Code postal*"
|
||||
autocomplete="postal-code"
|
||||
value="{{ old('postal_code') }}" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<input class="w-100 form-control rounded-4 border-dark"
|
||||
type="text"
|
||||
name="town"
|
||||
id="town"
|
||||
autocomplete="tel"
|
||||
placeholder="Ville*"
|
||||
value="{{ old('town') }}">
|
||||
</div>
|
||||
<div class="form-check d-flex flex-row justify-content-center align-items-center rounded-2 px-3 py-2 p-lg-0 mt-2 mb-0">
|
||||
<input class="form-check-input m-0" type="checkbox" name="ok_cgv" role="button" id="ok_cgv">
|
||||
<label class="w-75 form-check-label ps-2" role="button" for="ok_cgv">
|
||||
{{ __('J\'ai lu et accepte les') }} <a href="{{ route('terms') }}" target="mentions">{{ __('conditions générales') }}</a> et la <a href="{{ route('privacy') }}" target="mentions">{{ __('politique de gestion des données personnelles') }}</a>.
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check d-flex flex-row justify-content-center align-items-center rounded-2 px-3 py-2 p-lg-0 mt-2 mb-0">
|
||||
<input class="form-check-input m-0" type="checkbox" name="remember" role="button" id="optin">
|
||||
<label class="w-75 form-check-label ps-2" role="button" for="optin">
|
||||
{{ __('Je souhaite m\'inscrire à la newsletter') }} {{ Config::get('theme.site_name') }}.
|
||||
</label>
|
||||
</div>
|
||||
<div class="text-center fst-italic my-2">{{ __('*Champs obligatoires') }}</div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button class="btn btn-product rounded-4" type="submit">{{ __('S\'inscrire') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex justify-content-center align-items-center text-center">
|
||||
<p class="m-0 me-2">{{ __('Déjà inscrit ?') }}</p>
|
||||
<a class="btn btn-product rounded-4" href="{{ route('auth.connexion') }}">{{ __('Connectez-vous') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
@endsection
|
||||
|
||||
<script>
|
||||
function visibility2() {
|
||||
if($('#codebutton').text() == 'Je n\'ai pas de code') {
|
||||
if ($('#codebutton').text() == 'Je n\'ai pas de code') {
|
||||
//vider les champs
|
||||
$('[name=matricule]').val('').attr("required", false);
|
||||
$('[name=code]').val('').attr("required", false);
|
||||
$('#codebutton').text('J\'ai un code d\'inscription');
|
||||
} else if($('#codebutton').text() == 'J\'ai un code d\'inscription') {
|
||||
} else if ($('#codebutton').text() == 'J\'ai un code d\'inscription') {
|
||||
//rendre obligatoire
|
||||
$('[name=matricule]').attr("required", true);
|
||||
$('[name=code]').attr("required", true);
|
||||
|
|
@ -211,6 +189,7 @@
|
|||
}
|
||||
$('#codeinscription').toggle();
|
||||
}
|
||||
|
||||
function visibility3() {
|
||||
var x = document.getElementById('password');
|
||||
var y = document.getElementById('password_confirmation');
|
||||
|
|
|
|||
|
|
@ -5,11 +5,8 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>{{ __('Tableau de bord') }}</title>
|
||||
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="/b-o/css/app.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -25,14 +22,16 @@
|
|||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
|
||||
<div class="position-sticky pt-3">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('home')}}" target="_front">{{ __('Voir le site') }}</a>
|
||||
<a class="nav-link" href="{{ route('home') }}" target="_front">{{ __('Voir le site') }}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('bo.dashboard') }}">{{ __('Dashboard') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="accordion" id="accordionMenu">
|
||||
|
|
@ -76,7 +75,6 @@
|
|||
<i class="fas fa-warehouse"></i> {{ __('Catalogue') }}
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="collapseProduits" class="accordion-collapse collapse {{ ( request()->routeIs('bo.products*') || request()->routeIs('bo.ranges*') || request()->routeIs('bo.tags*') ) ? 'show' : '' }}" aria-labelledby="headingProduits" data-bs-parent="#accordionMenu">
|
||||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
|
|
@ -95,7 +93,6 @@
|
|||
<i class="fas fa-cart-arrow-down"></i> {{ __('Merchandising') }}
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="collapseMerchandising" class="accordion-collapse collapse {{ ( request()->routeIs('bo.promotions*') || request()->routeIs('bo.products.starred') ) ? 'show' : '' }}" aria-labelledby="headingMerchandising" data-bs-parent="#accordionMenu">
|
||||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
|
|
@ -114,7 +111,6 @@
|
|||
<i class="fas fa-cash-register"></i> {{ __('Commandes') }}
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="collapseOrders" class="accordion-collapse collapse {{ ( request()->routeIs('bo.orders*') ) ? 'show' : '' }}" aria-labelledby="headingOrders" data-bs-parent="#accordionMenu">
|
||||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
|
|
@ -149,7 +145,6 @@
|
|||
<i class="fas fa-cog"></i> Règlages
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="collapseSettings" class="accordion-collapse collapse {{ ( request()->routeIs('bo.settings*') ) ? 'show' : '' }}" aria-labelledby="headingSettings" data-bs-parent="#accordionMenu">
|
||||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
|
|
@ -167,7 +162,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
|
||||
@yield('content')
|
||||
</main>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue