Merge branch 'trunk'
This commit is contained in:
commit
d63dfd34c1
118 changed files with 4755 additions and 3920 deletions
|
|
@ -2,13 +2,12 @@
|
|||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CreateAdmin extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
|
|
@ -23,20 +22,10 @@ class CreateAdmin extends Command
|
|||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
* @return integer
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
@ -62,5 +51,7 @@ class CreateAdmin extends Command
|
|||
$user->save();
|
||||
|
||||
$this->info('User created.');
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@
|
|||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class DeleteNotConfirmedUser extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
|
|
@ -23,20 +22,10 @@ class DeleteNotConfirmedUser extends Command
|
|||
*/
|
||||
protected $description = 'Remove users who have not confirmed their accounts within 24 hours of registration';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
* @return integer
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
@ -44,5 +33,7 @@ class DeleteNotConfirmedUser extends Command
|
|||
foreach ($users as $user) {
|
||||
$user->delete();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,14 +3,13 @@
|
|||
namespace App\Console\Commands;
|
||||
|
||||
use App\Mail\ExportCodesUniques as MailExportCodesUniques;
|
||||
use App\Models\Codes;
|
||||
use App\Models\Code;
|
||||
use App\Models\Settings;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class ExportCodesUniques extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
|
|
@ -25,38 +24,31 @@ class ExportCodesUniques extends Command
|
|||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
* @return integer
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$nbCodeTot = $this->ask("Combien de code doivent être exporté ?"); // Nombre total de code à exporter
|
||||
// Nombre total de code à exporter.
|
||||
$nbCodeTot = $this->ask("Combien de code doivent être exporté ?");
|
||||
while (empty(intval($nbCodeTot)) || !is_int(intval($nbCodeTot))) {
|
||||
$this->info("Valeur incorrect, veuillez entrer un nombre entier.");
|
||||
$nbCodeTot = $this->ask("Veuillez entrer une nouvelle valeur");
|
||||
}
|
||||
$nbCodeTot = intval($nbCodeTot);
|
||||
|
||||
$nbCodeFic = $this->ask("Combien de code par fichier ?"); // Nombre de code par fichier
|
||||
// Nombre de code par fichier.
|
||||
$nbCodeFic = $this->ask("Combien de code par fichier ?");
|
||||
while (empty(intval($nbCodeFic)) || !is_int(intval($nbCodeFic))) {
|
||||
$this->info("Valeur incorrect, veuillez entrer un nombre entier.");
|
||||
$nbCodeFic = $this->ask("Veuillez entrer une nouvelle valeur");
|
||||
}
|
||||
$nbCodeFic = intval($nbCodeFic);
|
||||
|
||||
$nbCodeLigne = $this->ask("Combien de code par ligne dans un fichier ?"); // Nombre de code par ligne
|
||||
// Nombre de code par ligne.
|
||||
$nbCodeLigne = $this->ask("Combien de code par ligne dans un fichier ?");
|
||||
while (empty(intval($nbCodeLigne)) || !is_int(intval($nbCodeLigne))) {
|
||||
$this->info("Valeur incorrect, veuillez entrer un nombre entier.");
|
||||
$nbCodeLigne = $this->ask("Veuillez entrer une nouvelle valeur");
|
||||
|
|
@ -70,13 +62,26 @@ class ExportCodesUniques extends Command
|
|||
|
||||
$this->info("Traitement en cours, veuillez patienter...");
|
||||
|
||||
$this->process($nbCodeFic, $nbCodeTot, $nbCodeLigne, $totalExportedCodes, $currentFilename, $currentExportedCodes, $currentLineCodes);
|
||||
$this->process(
|
||||
$nbCodeFic,
|
||||
$nbCodeTot,
|
||||
$nbCodeLigne,
|
||||
$totalExportedCodes,
|
||||
$currentFilename,
|
||||
$currentExportedCodes,
|
||||
$currentLineCodes
|
||||
);
|
||||
|
||||
$this->info("Fin du traitement, creation de l'archive...");
|
||||
|
||||
// Compression des fichiers
|
||||
// Compression des fichiers.
|
||||
$zip = new \ZipArchive();
|
||||
if ($zip->open(storage_path('export_codes_uniques/') . "CodesUniques_" . date('dmY') . ".zip", \ZipArchive::CREATE) === true) {
|
||||
if (
|
||||
$zip->open(
|
||||
storage_path('export_codes_uniques/') . "CodesUniques_" . date('dmY') . ".zip",
|
||||
\ZipArchive::CREATE
|
||||
) === true
|
||||
) {
|
||||
if ($handle = opendir(storage_path('export_codes_uniques/tmp'))) {
|
||||
while (false !== ($file_to_zip = readdir($handle))) {
|
||||
if (pathinfo($file_to_zip, PATHINFO_EXTENSION) != 'csv') {
|
||||
|
|
@ -89,7 +94,7 @@ class ExportCodesUniques extends Command
|
|||
$zip->close();
|
||||
}
|
||||
|
||||
// On vide le dossier temporaire des fichiers csv
|
||||
// On vide le dossier temporaire des fichiers csv.
|
||||
if ($handle = opendir(storage_path('export_codes_uniques/tmp'))) {
|
||||
while (false !== ($file_to_zip = readdir($handle))) {
|
||||
if (pathinfo($file_to_zip, PATHINFO_EXTENSION) != 'csv') {
|
||||
|
|
@ -102,8 +107,11 @@ class ExportCodesUniques extends Command
|
|||
|
||||
$this->info("L'archive CodesUniques_" . date('dmY') . ".zip a ete creer.");
|
||||
|
||||
// Envoi de mail à MAIL_ADMIN avec le nom du ZIP "CodesUniques_". date('dmY') .".zip"
|
||||
Mail::to(config('mail.MAIL_ADMIN'))->send(new MailExportCodesUniques(app(Settings::class)->name, $nbCodeFic, $nbCodeTot, $nbCodeLigne));
|
||||
// Envoi de mail à MAIL_ADMIN avec le nom du ZIP "CodesUniques_". date('dmY') .".zip" .
|
||||
Mail::to(config('mail.MAIL_ADMIN'))
|
||||
->send(new MailExportCodesUniques(app(Settings::class)->name, $nbCodeFic, $nbCodeTot, $nbCodeLigne));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function process($nbCodeFic, $nbCodeTot, $nbCodeLigne, $totalExportedCodes, $currentFilename, $currentExportedCodes, $currentLineCodes, $lastExportedCodeId = null)
|
||||
|
|
@ -121,9 +129,9 @@ class ExportCodesUniques extends Command
|
|||
}
|
||||
|
||||
if ($lastExportedCodeId === null) {
|
||||
$codes = Codes::where('code_exported', 0)->take($nbCodeToRetrieve)->get();
|
||||
$codes = Code::where('code_exported', 0)->take($nbCodeToRetrieve)->get();
|
||||
} else {
|
||||
$codes = Codes::where([
|
||||
$codes = Code::where([
|
||||
['code_exported', '=', 0],
|
||||
['id', '>', $lastExportedCodeId]
|
||||
])->take($nbCodeToRetrieve)->get();
|
||||
|
|
@ -136,12 +144,20 @@ class ExportCodesUniques extends Command
|
|||
foreach ($codes as $k => $code) {
|
||||
if ($currentExportedCodes < $nbCodeTot) {
|
||||
if ($currentLineCodes === ($nbCodeLigne === 1 ? 1 : $nbCodeLigne - 1)) {
|
||||
file_put_contents(storage_path('export_codes_uniques/tmp/') . $currentFilename . ".csv", $code->code_unique . PHP_EOL, FILE_APPEND);
|
||||
file_put_contents(
|
||||
storage_path('export_codes_uniques/tmp/') . $currentFilename . ".csv",
|
||||
$code->code_unique . PHP_EOL,
|
||||
FILE_APPEND
|
||||
);
|
||||
$totalExportedCodes++;
|
||||
$currentExportedCodes++;
|
||||
$currentLineCodes = ($nbCodeLigne === 1 ? 1 : 0);
|
||||
} else {
|
||||
file_put_contents(storage_path('export_codes_uniques/tmp/') . $currentFilename . ".csv", $code->code_unique . ";", FILE_APPEND);
|
||||
file_put_contents(
|
||||
storage_path('export_codes_uniques/tmp/') . $currentFilename . ".csv",
|
||||
$code->code_unique . ";",
|
||||
FILE_APPEND
|
||||
);
|
||||
$totalExportedCodes++;
|
||||
$currentExportedCodes++;
|
||||
$currentLineCodes++;
|
||||
|
|
@ -155,13 +171,22 @@ class ExportCodesUniques extends Command
|
|||
$currentExportedCodes = 0;
|
||||
}
|
||||
if ((($k + 1) === $countCodes) && $totalExportedCodes < $nbCodeTot) {
|
||||
Codes::whereIn('id', $exportedCodesId)->update(['code_exported' => 1]);
|
||||
return $this->process($nbCodeFic, $nbCodeTot, $nbCodeLigne, $totalExportedCodes, $currentFilename, $currentExportedCodes, $currentLineCodes, $lastExportedCodeId);
|
||||
Code::whereIn('id', $exportedCodesId)->update(['code_exported' => 1]);
|
||||
return $this->process(
|
||||
$nbCodeFic,
|
||||
$nbCodeTot,
|
||||
$nbCodeLigne,
|
||||
$totalExportedCodes,
|
||||
$currentFilename,
|
||||
$currentExportedCodes,
|
||||
$currentLineCodes,
|
||||
$lastExportedCodeId
|
||||
);
|
||||
}
|
||||
if (($k + 1) === $countCodes) {
|
||||
Codes::whereIn('id', $exportedCodesId)->update(['code_exported' => 1]);
|
||||
Code::whereIn('id', $exportedCodesId)->update(['code_exported' => 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} //end if
|
||||
}//end foreach
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,25 +7,21 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
//
|
||||
];
|
||||
protected $commands = [];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,21 +2,17 @@
|
|||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
use Kwaadpepper\ExceptionHandler\Exceptions\ExceptionHandler;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
||||
/**
|
||||
* A list of the exception types that are not reported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
//
|
||||
RedirectTo::class
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -28,57 +24,4 @@ class Handler extends ExceptionHandler
|
|||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
* Report or log an exception.
|
||||
*
|
||||
* @param \Throwable $exception
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function report(Throwable $e)
|
||||
{
|
||||
if (get_class($e) == RedirectTo::class) {
|
||||
abort(redirect($e->url));
|
||||
}
|
||||
try {
|
||||
if (!config('app.debug')) {
|
||||
if ($this->shouldntReport($e)) {
|
||||
return;
|
||||
}
|
||||
Mail::send([
|
||||
'html' => 'emails.exception',
|
||||
'text' => 'emails.exception-plain'
|
||||
], [
|
||||
'exception' => $e,
|
||||
'appName' => config('app.name')
|
||||
], function ($m) {
|
||||
$m->to(
|
||||
config('mail.contactsList.serviceweb'),
|
||||
sprintf('%s Exception Handler', config('app.name'))
|
||||
)->subject('Need help !, an error occured in your application, please check Logs ASAP');
|
||||
});
|
||||
}
|
||||
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
|
||||
} catch (RuntimeException $e) {
|
||||
// do nothing, mail send error, let laravel only handle this
|
||||
} finally {
|
||||
parent::report($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Throwable $exception
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function render($request, Throwable $exception)
|
||||
{
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\BannedIP;
|
||||
use App\Models\BannedIp;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BannedIPController extends Controller
|
||||
class BannedIpController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$ips = BannedIP::all();
|
||||
$ips = BannedIp::all();
|
||||
return view('bo.banned-ip.index', compact('ips'));
|
||||
}
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ class BannedIPController extends Controller
|
|||
|
||||
for ($i = 0; $i < count($ips); $i++) {
|
||||
if (!empty($ips[$i]["ip"])) {
|
||||
$ip = BannedIP::updateOrCreate(['ip' => $ips[$i]["ip"]]);
|
||||
$ip = BannedIp::updateOrCreate(['ip' => $ips[$i]["ip"]]);
|
||||
} else {
|
||||
unset($ips[$i]);
|
||||
$i--;
|
||||
|
|
@ -32,7 +32,7 @@ class BannedIPController extends Controller
|
|||
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
$ip = BannedIP::where("ip", $request->ip);
|
||||
$ip = BannedIp::where("ip", $request->ip);
|
||||
$ip->delete();
|
||||
|
||||
return "Suppression terminée !";
|
||||
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\CodeSearchRequest;
|
||||
use App\Http\Requests\ExportCodesRequest;
|
||||
use App\Http\Requests\GenerateCodesRequest;
|
||||
use App\Jobs\ProcessExportCodesUniques;
|
||||
use App\Jobs\ProcessUniqueCode;
|
||||
use App\Models\Codes;
|
||||
use App\Models\Code;
|
||||
use App\Models\Settings;
|
||||
use Kwaadpepper\Serial\Exceptions\SerialCasterException;
|
||||
|
||||
class CodesController extends Controller
|
||||
{
|
||||
|
|
@ -20,10 +22,10 @@ class CodesController extends Controller
|
|||
public function index()
|
||||
{
|
||||
$settings = app(Settings::class);
|
||||
$nbCodeBase = Codes::count();
|
||||
$nbCodeUsed = Codes::where('code_used', 1)->count();
|
||||
$nbCodeExported = Codes::where('code_exported', 1)->count();
|
||||
$nbCodeRemainingToExport = Codes::where('code_exported', 0)->count();
|
||||
$nbCodeBase = Code::count();
|
||||
$nbCodeUsed = Code::where('code_used', 1)->count();
|
||||
$nbCodeExported = Code::where('code_exported', 1)->count();
|
||||
$nbCodeRemainingToExport = Code::where('code_exported', 0)->count();
|
||||
return view('bo.codes.index', compact(
|
||||
'settings',
|
||||
'nbCodeBase',
|
||||
|
|
@ -73,4 +75,30 @@ class CodesController extends Controller
|
|||
config('mail.MAIL_ADMIN') . " lorsque le traitement sera terminé."
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a specific code.
|
||||
*
|
||||
* @param CodeSearchRequest $request
|
||||
* @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function search(CodeSearchRequest $request)
|
||||
{
|
||||
$code = null;
|
||||
try {
|
||||
$code = Code::whereId(Code::serialToInt($request->code))->first();
|
||||
} catch (\Throwable $e) {
|
||||
if (\get_class($e) === SerialCasterException::class) {
|
||||
$code = false;
|
||||
}
|
||||
} finally {
|
||||
if ($code === false) {
|
||||
\session()->flash('warning', trans('Code non valide.'));
|
||||
}
|
||||
if ($code === null) {
|
||||
\session()->flash('warning', trans('Code introuvable.'));
|
||||
}
|
||||
}
|
||||
return view('bo.codes.search', compact('code'));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\CodesEAN;
|
||||
use App\Models\CodeEan;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CodesEANController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$ean = CodesEAN::all();
|
||||
$ean = CodeEan::all();
|
||||
return view('bo.codes-ean.index', compact('ean'));
|
||||
}
|
||||
|
||||
|
|
@ -21,13 +21,13 @@ class CodesEANController extends Controller
|
|||
for ($i = 0; $i < count($codes); $i++) {
|
||||
$codeToInsert = !empty($codes[$i]["code"]) && !empty($codes[$i]["product"]);
|
||||
if (isset($codes[$i]["id"]) && $codes[$i]["id"] !== null && $codeToInsert) {
|
||||
$c = CodesEAN::findOrFail($codes[$i]["id"]);
|
||||
$c = CodeEan::findOrFail($codes[$i]["id"]);
|
||||
$c->code = $codes[$i]["code"];
|
||||
$c->product = $codes[$i]["product"];
|
||||
$c->save();
|
||||
} else {
|
||||
if ($codeToInsert) {
|
||||
$c = CodesEAN::updateOrCreate(['code' => $codes[$i]["code"], 'product' => $codes[$i]["product"]]);
|
||||
$c = CodeEan::updateOrCreate(['code' => $codes[$i]["code"], 'product' => $codes[$i]["product"]]);
|
||||
$codes[$i]["id"] = $c->id;
|
||||
} else {
|
||||
unset($codes[$i]);
|
||||
|
|
@ -41,7 +41,7 @@ class CodesEANController extends Controller
|
|||
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
$code = CodesEAN::findOrFail($request->id);
|
||||
$code = CodeEan::findOrFail($request->id);
|
||||
$code->delete();
|
||||
|
||||
return "Suppression terminée !";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Content;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Participation;
|
||||
|
|
@ -12,18 +12,21 @@ class DashboardController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
// Pour les stats
|
||||
// Pour les stats.
|
||||
$settings = app(Settings::class);
|
||||
$participations = Participation::selectRaw("COUNT(*) AS count, DATE(created_at) AS date")->groupByRaw("DATE(created_at)")->get();
|
||||
$participationsUniquePerDay = Participation::selectRaw("DISTINCT user_id AS user, COUNT(*) AS count, DATE(created_at) AS date")->groupByRaw("DATE(created_at), user")->get();
|
||||
$participations = Participation::selectRaw("COUNT(*) AS count, DATE(created_at) AS date")
|
||||
->groupByRaw("DATE(created_at)")->get();
|
||||
$participationsUniquePerDay = Participation::selectRaw("DISTINCT user_id AS user, COUNT(*) AS count, DATE(created_at) AS date")
|
||||
->groupByRaw("DATE(created_at), user")->get();
|
||||
$statsUnique = [];
|
||||
foreach ($participationsUniquePerDay as $participationPerDay) {
|
||||
$dateUnique = Carbon::parse($participationPerDay->date)->format('d/m/Y');
|
||||
$statsUnique[$dateUnique] = isset($statsUnique[$dateUnique]) ? $statsUnique[$dateUnique] + 1 : 1;
|
||||
}
|
||||
$participationsUnique = Participation::selectRaw("DISTINCT user_id AS user, COUNT(*) AS count")->groupBy("user")->orderBy("user")->get();
|
||||
$participationsUnique = Participation::selectRaw("DISTINCT user_id AS user, COUNT(*) AS count")
|
||||
->groupBy("user")->orderBy("user")->get();
|
||||
|
||||
// Données calculées à afficher
|
||||
// Données calculées à afficher.
|
||||
$totalParticipation = Participation::count();
|
||||
if (count($participationsUnique) > 0) {
|
||||
$avgParticipUser = round($totalParticipation / count($participationsUnique), 1);
|
||||
|
|
@ -31,29 +34,40 @@ class DashboardController extends Controller
|
|||
$avgParticipUser = 0;
|
||||
}
|
||||
|
||||
// Tableau des dates comprises dans la table participation
|
||||
// Tableau des dates comprises dans la table participation.
|
||||
foreach ($participations as $participation) {
|
||||
$datesParticipations[Carbon::parse($participation->date)->format('d/m/Y')] = $participation->count;
|
||||
}
|
||||
|
||||
// Création des tableaux avec toutes les dates depuis le début du jeu et le nombre de participations associées
|
||||
// Création des tableaux avec toutes les dates depuis le début du jeu et le nombre de participations associées.
|
||||
$date = Carbon::parse($settings->start_date);
|
||||
$dateFin = now() < $settings->end_date ? Carbon::now() : Carbon::parse($settings->end_date);
|
||||
|
||||
// Récupération des 3 codes EAN les plus utilisés
|
||||
$codesEan = Participation::select(DB::raw('COUNT(code_ean_id) AS nb_usage, code_ean_id'))->groupBy('code_ean_id')->orderByDesc('nb_usage')->limit(3)->get();
|
||||
// Récupération des 3 codes EAN les plus utilisés.
|
||||
$codesEan = Participation::select(
|
||||
DB::raw('COUNT(code_ean_id) AS nb_usage, code_ean_id')
|
||||
)->groupBy('code_ean_id')->orderByDesc('nb_usage')->limit(3)->get();
|
||||
|
||||
// Génération des tableaux de date depuis le début du jeu
|
||||
// Génération des tableaux de date depuis le début du jeu.
|
||||
$dates = [];
|
||||
$count = [];
|
||||
$countUnique = [];
|
||||
while ($dateFin > $date) {
|
||||
$dates[] = $date->format('d/m/Y');
|
||||
$count[] = isset($datesParticipations[$date->format('d/m/Y')]) ? $datesParticipations[$date->format('d/m/Y')] : 0;
|
||||
$count[] = isset($datesParticipations[$date->format('d/m/Y')]) ?
|
||||
$datesParticipations[$date->format('d/m/Y')] : 0;
|
||||
$countUnique[] = isset($statsUnique[$date->format('d/m/Y')]) ? $statsUnique[$date->format('d/m/Y')] : 0;
|
||||
$date->addDay();
|
||||
}
|
||||
|
||||
return view('bo.dashboard.index', compact('dates', 'count', 'countUnique', 'totalParticipation', 'avgParticipUser', 'codesEan', 'settings'));
|
||||
return view('bo.dashboard.index', compact(
|
||||
'dates',
|
||||
'count',
|
||||
'countUnique',
|
||||
'totalParticipation',
|
||||
'avgParticipUser',
|
||||
'codesEan',
|
||||
'settings'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\FaqQuestions;
|
||||
use App\Models\FaqThemes;
|
||||
use App\Models\FaqQuestion;
|
||||
use App\Models\FaqTheme;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FaqQuestionsController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$questions = FaqQuestions::all();
|
||||
$questions = FaqQuestion::all();
|
||||
for ($i = 0; $i < count($questions); $i++) {
|
||||
$questions[$i]['toggle'] = false;
|
||||
}
|
||||
$themes = FaqThemes::all();
|
||||
$themes = FaqTheme::all();
|
||||
return view('bo.faq-questions.index', compact('questions', 'themes'));
|
||||
}
|
||||
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
if ($request->id !== null) {
|
||||
$question = FaqQuestions::findOrFail($request->id);
|
||||
$question = FaqQuestion::findOrFail($request->id);
|
||||
$question->delete();
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ class FaqQuestionsController extends Controller
|
|||
|
||||
for ($i = 0; $i < count($questions); $i++) {
|
||||
if (isset($questions[$i]["id"])) {
|
||||
$q = FaqQuestions::findOrFail($questions[$i]["id"]);
|
||||
$q = FaqQuestion::findOrFail($questions[$i]["id"]);
|
||||
$q->question = $questions[$i]["question"];
|
||||
$q->answer = $questions[$i]["answer"];
|
||||
$q->positive_vote = $questions[$i]["positive_vote"];
|
||||
|
|
@ -41,7 +41,7 @@ class FaqQuestionsController extends Controller
|
|||
$q->theme_id = $questions[$i]["theme_id"];
|
||||
$q->save();
|
||||
} else {
|
||||
$t = FaqQuestions::updateOrCreate(
|
||||
$t = FaqQuestion::updateOrCreate(
|
||||
[
|
||||
'question' => $questions[$i]["question"],
|
||||
'answer' => $questions[$i]["answer"],
|
||||
|
|
@ -52,7 +52,7 @@ class FaqQuestionsController extends Controller
|
|||
);
|
||||
$questions[$i]["id"] = $t->id;
|
||||
}
|
||||
}
|
||||
}//end for
|
||||
|
||||
return $questions;
|
||||
}
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\FaqQuestions;
|
||||
use App\Models\FaqThemes;
|
||||
use App\Models\FaqQuestion;
|
||||
use App\Models\FaqTheme;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FaqThemesController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$themes = FaqThemes::all();
|
||||
$themes = FaqTheme::all();
|
||||
return view('bo.faq-themes.index', compact('themes'));
|
||||
}
|
||||
|
||||
|
|
@ -19,10 +19,10 @@ class FaqThemesController extends Controller
|
|||
{
|
||||
$deleteOk = 0;
|
||||
|
||||
if (FaqQuestions::where('theme_id', $request->id)->count() > 0) {
|
||||
if (FaqQuestion::where('theme_id', $request->id)->count() > 0) {
|
||||
$deleteOk = 1;
|
||||
} elseif ($request->id !== null) {
|
||||
$theme = FaqThemes::findOrFail($request->id);
|
||||
$theme = FaqTheme::findOrFail($request->id);
|
||||
$theme->delete();
|
||||
} else {
|
||||
$deleteOk = 2;
|
||||
|
|
@ -37,11 +37,11 @@ class FaqThemesController extends Controller
|
|||
|
||||
for ($i = 0; $i < count($themes); $i++) {
|
||||
if (isset($themes[$i]["id"])) {
|
||||
$t = FaqThemes::findOrFail($themes[$i]["id"]);
|
||||
$t = FaqTheme::findOrFail($themes[$i]["id"]);
|
||||
$t->name = $themes[$i]["name"];
|
||||
$t->save();
|
||||
} else {
|
||||
$t = FaqThemes::updateOrCreate(['name' => $themes[$i]["name"]]);
|
||||
$t = FaqTheme::updateOrCreate(['name' => $themes[$i]["name"]]);
|
||||
$themes[$i]["id"] = $t->id;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\GainView;
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\InstantWin;
|
||||
use App\Models\Prizes;
|
||||
use App\Models\Prize;
|
||||
use App\Models\Settings;
|
||||
|
||||
class InstantWinController extends Controller
|
||||
|
|
@ -17,7 +17,7 @@ class InstantWinController extends Controller
|
|||
if (intval($nbInstantWin) > 0) {
|
||||
$canGenerate = 0;
|
||||
} else {
|
||||
$nbLots = Prizes::count();
|
||||
$nbLots = Prize::count();
|
||||
if (intval($nbLots) > 0) {
|
||||
$canGenerate = 1;
|
||||
} else {
|
||||
|
|
@ -37,7 +37,7 @@ class InstantWinController extends Controller
|
|||
{
|
||||
$start_date = Settings::latest()->value("start_date");
|
||||
$end_date = Settings::latest()->value("end_date");
|
||||
$lots = Prizes::all();
|
||||
$lots = Prize::all();
|
||||
|
||||
|
||||
|
||||
|
|
@ -52,7 +52,12 @@ class InstantWinController extends Controller
|
|||
|
||||
foreach ($lots as $k => $lot) {
|
||||
for ($i = 0; $i < $lot->quantity; $i++) {
|
||||
$lotsGlobal[] = ['id' => $lot->id, 'name' => $lot->label_one, 'hour' => str_pad(mt_rand(6, 22), 2, "0", STR_PAD_LEFT) . ":" . str_pad(mt_rand(0, 59), 2, "0", STR_PAD_LEFT) . ":00"];
|
||||
$lotsGlobal[] = [
|
||||
'id' => $lot->id,
|
||||
'name' => $lot->label_one,
|
||||
'hour' => str_pad(mt_rand(6, 22), 2, "0", STR_PAD_LEFT)
|
||||
. ":" . str_pad(mt_rand(0, 59), 2, "0", STR_PAD_LEFT) . ":00"
|
||||
];
|
||||
}
|
||||
}
|
||||
shuffle($lotsGlobal);
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\GainView;
|
||||
use App\Models\Prizes;
|
||||
use App\Models\Prize;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
|
|
@ -13,7 +13,7 @@ class PrizesController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
$prizes = Prizes::all();
|
||||
$prizes = Prize::all();
|
||||
$gainViews = GainView::all();
|
||||
return view('bo.prizes.index', compact('prizes', 'gainViews'));
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ class PrizesController extends Controller
|
|||
for ($i = 0; $i < count($prizes); $i++) {
|
||||
$prize = $prizes[$i];
|
||||
if ($prize->id !== null) {
|
||||
$p = Prizes::findOrFail($prize->id);
|
||||
$p = Prize::findOrFail($prize->id);
|
||||
|
||||
$p->arcadia_id = $prize->arcadia_id;
|
||||
$p->label_one = $prize->label_one;
|
||||
|
|
@ -43,7 +43,8 @@ class PrizesController extends Controller
|
|||
$p->gain_view_id = $prize->gain_view_id;
|
||||
|
||||
if (isset($pdfs[$i])) {
|
||||
$fileName = Str::slug($prize->label_one) . '-' . date('d-m-Y') . '.' . $pdfs[$i]->extension();
|
||||
$fileName = Str::slug($prize->label_one) . '-' .
|
||||
date('d-m-Y') . '.' . $pdfs[$i]->extension();
|
||||
$p->pdf_winning_proof = $fileName;
|
||||
$pdfs[$i]->move(public_path('fichiers/pdf/'), $fileName);
|
||||
$prizes[$i]->pdf_winning_proof = $fileName;
|
||||
|
|
@ -51,7 +52,7 @@ class PrizesController extends Controller
|
|||
|
||||
$p->save();
|
||||
} else {
|
||||
$p = new Prizes();
|
||||
$p = new Prize();
|
||||
$p->arcadia_id = $prize->arcadia_id;
|
||||
$p->label_one = $prize->label_one;
|
||||
$p->label_many = $prize->label_many;
|
||||
|
|
@ -62,7 +63,8 @@ class PrizesController extends Controller
|
|||
$p->gain_view_id = $prize->gain_view_id;
|
||||
|
||||
if (isset($pdfs[$i])) {
|
||||
$fileName = Str::slug($prize->label_one) . '-' . date('d-m-Y') . '.' . $pdfs[$i]->extension();
|
||||
$fileName = Str::slug($prize->label_one) . '-' .
|
||||
date('d-m-Y') . '.' . $pdfs[$i]->extension();
|
||||
$p->pdf_winning_proof = $fileName;
|
||||
$pdfs[$i]->move(public_path('fichiers/pdf/'), $fileName);
|
||||
$prizes[$i]->pdf_winning_proof = $fileName;
|
||||
|
|
@ -70,11 +72,11 @@ class PrizesController extends Controller
|
|||
|
||||
$p->save();
|
||||
$prizes[$i]->id = $p->id;
|
||||
}
|
||||
}
|
||||
} //end if
|
||||
}//end for
|
||||
} catch (Exception $e) {
|
||||
//
|
||||
}
|
||||
}//end try
|
||||
|
||||
return $prizes;
|
||||
}
|
||||
|
|
@ -85,7 +87,7 @@ class PrizesController extends Controller
|
|||
|
||||
if ($request->id !== null) {
|
||||
try {
|
||||
$prize = Prizes::findOrFail($request->id);
|
||||
$prize = Prize::findOrFail($request->id);
|
||||
$prize->delete();
|
||||
} catch (Exception $e) {
|
||||
$retour = "Erreur lors de la suppression : " . $e->getMessage();
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\StoreProductRequest;
|
||||
|
|
@ -43,20 +43,20 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\StoreProductRequest $request
|
||||
* @param \App\Http\Requests\StoreProductRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StoreProductRequest $request)
|
||||
{
|
||||
$name = $request->name;
|
||||
$slug = Str::slug($name);
|
||||
$no_art = $request->no_art;
|
||||
$code_ean = $request->code_ean;
|
||||
$picture = $request->picture;
|
||||
$name = $request->name;
|
||||
$slug = Str::slug($name);
|
||||
$no_art = $request->no_art;
|
||||
$code_ean = $request->code_ean;
|
||||
$picture = $request->picture;
|
||||
|
||||
$product = new Product();
|
||||
$product->name = $name;
|
||||
$product->no_art = $no_art;
|
||||
$product = new Product();
|
||||
$product->name = $name;
|
||||
$product->no_art = $no_art;
|
||||
$product->code_ean = $code_ean;
|
||||
$product->range()->associate($request->range_id);
|
||||
$product->save();
|
||||
|
|
@ -74,7 +74,7 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @param integer $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
|
|
@ -85,7 +85,7 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @param integer $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
|
|
@ -105,17 +105,17 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\UpdateProductRequest $request
|
||||
* @param int $id
|
||||
* @param \App\Http\Requests\UpdateProductRequest $request
|
||||
* @param integer $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateProductRequest $request, $id)
|
||||
{
|
||||
$name = $request->name;
|
||||
$slug = Str::slug($name);
|
||||
$no_art = $request->no_art;
|
||||
$name = $request->name;
|
||||
$slug = Str::slug($name);
|
||||
$no_art = $request->no_art;
|
||||
$code_ean = $request->code_ean;
|
||||
$picture = $request->picture;
|
||||
$picture = $request->picture;
|
||||
|
||||
$product = Product::findOrFail($id);
|
||||
$product->range()->associate($request->range_id);
|
||||
|
|
@ -128,8 +128,8 @@ class ProductsController extends Controller
|
|||
$picture->move(public_path('images/produits'), $imageName);
|
||||
}
|
||||
|
||||
$product->name = $name;
|
||||
$product->no_art = $no_art;
|
||||
$product->name = $name;
|
||||
$product->no_art = $no_art;
|
||||
$product->code_ean = $code_ean;
|
||||
|
||||
if ($picture !== null) {
|
||||
|
|
@ -143,7 +143,7 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @param integer $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\StoreRangeRequest;
|
||||
|
|
@ -34,7 +34,7 @@ class RangeController extends Controller
|
|||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\StoreRangeRequest $request
|
||||
* @param \App\Http\Requests\StoreRangeRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StoreRangeRequest $request)
|
||||
|
|
@ -43,8 +43,8 @@ class RangeController extends Controller
|
|||
$slug = Str::slug($name);
|
||||
$picture = $request->picture;
|
||||
|
||||
$range = new Range();
|
||||
$range->name = $name;
|
||||
$range = new Range();
|
||||
$range->name = $name;
|
||||
$range->save();
|
||||
|
||||
if ($picture !== null) {
|
||||
|
|
@ -61,7 +61,7 @@ class RangeController extends Controller
|
|||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\Range $range
|
||||
* @param \App\Models\Range $range
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Range $range)
|
||||
|
|
@ -72,7 +72,7 @@ class RangeController extends Controller
|
|||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\Range $range
|
||||
* @param \App\Models\Range $range
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Range $range)
|
||||
|
|
@ -83,8 +83,8 @@ class RangeController extends Controller
|
|||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\UpdateRangeRequest $request
|
||||
* @param \App\Models\Range $range
|
||||
* @param \App\Http\Requests\UpdateRangeRequest $request
|
||||
* @param \App\Models\Range $range
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateRangeRequest $request, Range $range)
|
||||
|
|
@ -101,7 +101,7 @@ class RangeController extends Controller
|
|||
$picture->move(public_path('images/ranges'), $imageName);
|
||||
}
|
||||
|
||||
$range->name = $name;
|
||||
$range->name = $name;
|
||||
|
||||
if ($picture !== null) {
|
||||
$range->picture = $imageName;
|
||||
|
|
@ -116,7 +116,7 @@ class RangeController extends Controller
|
|||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\Range $range
|
||||
* @param \App\Models\Range $range
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Range $range)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Settings;
|
||||
|
|
@ -12,6 +12,7 @@ class SettingsController extends Controller
|
|||
{
|
||||
public function manage(Request $request)
|
||||
{
|
||||
/** @var \App\Models\Settings $settings */
|
||||
$settings = app(Settings::class);
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
|
@ -39,7 +40,7 @@ class SettingsController extends Controller
|
|||
$company = $request->company;
|
||||
$analytics = $request->analytics;
|
||||
|
||||
// Check du lien de redirection après fermeture
|
||||
// Check du lien de redirection après fermeture.
|
||||
if (strpos($redirectClose, 'https://') === false && strpos($redirectClose, 'http://') === false) {
|
||||
$redirectClose = 'https://' . $redirectClose;
|
||||
}
|
||||
|
|
@ -76,13 +77,14 @@ class SettingsController extends Controller
|
|||
|
||||
$settings->save();
|
||||
|
||||
$settingsGlobal = app(Settings::class)->select('name', 'company', 'analytics', 'start_date', 'end_date')->first();
|
||||
$settingsGlobal = app(Settings::class)
|
||||
->select('name', 'company', 'analytics', 'start_date', 'end_date')->first();
|
||||
Cache::put('settingsGlobal', $settingsGlobal);
|
||||
|
||||
$success = "Modifications enregistrés !";
|
||||
|
||||
return view('bo.settings.manage', compact('settings', 'success'));
|
||||
}
|
||||
}//end if
|
||||
|
||||
return view('bo.settings.manage', compact('settings'));
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\bo;
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Mail\CourrierArcadiaError;
|
||||
|
|
@ -11,7 +11,6 @@ use Illuminate\Support\Facades\Mail;
|
|||
|
||||
class WinnersListController extends Controller
|
||||
{
|
||||
|
||||
private $apiCrm;
|
||||
|
||||
public function __construct()
|
||||
|
|
@ -21,7 +20,7 @@ class WinnersListController extends Controller
|
|||
|
||||
public function index()
|
||||
{
|
||||
$winnersList = Participation::where('instant_win_id', '<>', null)->get();
|
||||
$winnersList = Participation::has('instantWin')->get();
|
||||
$settings = Settings::select('use_ean_codes', 'winning_proof')->first();
|
||||
return view('bo.winners-list.index', compact('winnersList', 'settings'));
|
||||
}
|
||||
|
|
@ -32,7 +31,8 @@ class WinnersListController extends Controller
|
|||
|
||||
$crmUser = $this->apiCrm->getCustomer($participation->user->crm_id);
|
||||
if ($crmUser->status === 'NOK') {
|
||||
return back()->withErrors("Erreur lors de la récupération de l'utilisateur dans la CRM : Code : " . $crmUser->code . " Message : " . $crmUser->message);
|
||||
return back()->withErrors("Erreur lors de la récupération de l'utilisateur dans la CRM : Code : " .
|
||||
$crmUser->code . " Message : " . $crmUser->message);
|
||||
}
|
||||
|
||||
$crmId = $participation->user->crm_id;
|
||||
|
|
@ -66,7 +66,7 @@ class WinnersListController extends Controller
|
|||
public function createCourrierArcadia(Request $request, $id)
|
||||
{
|
||||
$participation = Participation::findOrFail($id);
|
||||
$instantWin = $participation->instant_win;
|
||||
$instantWin = $participation->instantWin;
|
||||
|
||||
if ($instantWin->prize->arcadia_operation_code !== 0 && $instantWin->prize->arcadia_support_code !== 0) {
|
||||
$fields = [
|
||||
|
|
@ -96,20 +96,22 @@ class WinnersListController extends Controller
|
|||
]
|
||||
];
|
||||
|
||||
/** @var \App\Models\Settings $settings */
|
||||
$settings = app(Settings::class);
|
||||
if ($settings->use_ean_codes === 1) {
|
||||
$fields['orderLine'][] = [
|
||||
'fieldName' => 'code_on_pack',
|
||||
'fieldValue' => $participation->code_ean->code
|
||||
'fieldValue' => $participation->codeEan->code
|
||||
];
|
||||
}
|
||||
|
||||
$arcadiaMail = $this->apiCrm->ArcadiaOutgoingMail($participation->user->crm_id, $fields, 'game');
|
||||
if ($arcadiaMail->status === 'NOK') {
|
||||
Mail::to(config('mail.MAIL_ADMIN'))->send(new CourrierArcadiaError($participation->user));
|
||||
return back()->withErrors("Erreur lors de l'envoi du courrier Arcadia. Code : " . $arcadiaMail->code . " Message : " . $arcadiaMail->message);
|
||||
return back()->withErrors("Erreur lors de l'envoi du courrier Arcadia. Code : " .
|
||||
$arcadiaMail->code . " Message : " . $arcadiaMail->message);
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
return back()->with('success', 'Courrier envoyé !');
|
||||
}
|
||||
}
|
||||
|
|
@ -8,8 +8,14 @@ class EndPageController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
$settings = app(Settings::class)->select('start_date', 'end_date', 'activated_close_page', 'close_page_active_date', 'redirect_close')->first();
|
||||
if ($settings->end_date < now() && $settings->activated_close_page === 1 && $settings->close_page_active_date > now()) {
|
||||
$settings = app(Settings::class)
|
||||
->select('start_date', 'end_date', 'activated_close_page', 'close_page_active_date', 'redirect_close')
|
||||
->first();
|
||||
if (
|
||||
$settings->end_date < now() &&
|
||||
$settings->activated_close_page === 1 &&
|
||||
$settings->close_page_active_date > now()
|
||||
) {
|
||||
return view('front.basic.end', compact('settings'));
|
||||
}
|
||||
return redirect()->route('home');
|
||||
|
|
|
|||
|
|
@ -8,30 +8,37 @@ use App\Mail\NotifAdmin;
|
|||
use App\Mail\NotifWinAdmin;
|
||||
use App\Mail\PrizeWon;
|
||||
use App\Mail\ReductionWon;
|
||||
use App\Models\BannedIP;
|
||||
use App\Models\Codes;
|
||||
use App\Models\CodesEAN;
|
||||
use App\Models\BannedIp;
|
||||
use App\Models\InstantWin;
|
||||
use App\Models\Participation;
|
||||
use App\Models\Reductions;
|
||||
use App\Models\Reduction;
|
||||
use LDCWeb\MesBR;
|
||||
use App\Models\Settings;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class EnterCodeController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \LDCCRM\ApiV1
|
||||
*/
|
||||
private $apiCrm;
|
||||
|
||||
/**
|
||||
* EnterCodeController
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->apiCrm = new \LDCCRM\ApiV1(config('crm.endpoint'), config('crm.token'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show enter code form
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$nbParticipations = Participation::where('user_id', Auth::user()->id)->count();
|
||||
|
|
@ -42,177 +49,149 @@ class EnterCodeController extends Controller
|
|||
return view('front.basic.enter-code', compact('settings'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Participate Method
|
||||
*
|
||||
* @param ParticipateRequest $request
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function participate(ParticipateRequest $request)
|
||||
{
|
||||
// TODO : VALIDATE avec / sans code ean
|
||||
// Récupération des données à utilisées.
|
||||
$codeBase = Codes::whereId(Codes::serialToInt($request->code))->first();
|
||||
/** @var \App\Models\Settings $settings */
|
||||
$settings = app(Settings::class);
|
||||
|
||||
// * Cas IP bannie.
|
||||
if (config('app.env') == "local") {
|
||||
$ipBanned = BannedIP::where('ip', $_SERVER['REMOTE_ADDR'])->first() === null ? 0 : 1;
|
||||
} else {
|
||||
$ipBanned = BannedIP::where('ip', $_SERVER['HTTP_X_FORWARDED_FOR'])->first() === null ? 0 : 1;
|
||||
}
|
||||
$ipBanned = BannedIp::where('ip', app('clientIp'))->first() === null ? 0 : 1;
|
||||
if ($ipBanned) {
|
||||
return view('front.basic.participation-exhausted', compact('settings'));
|
||||
}
|
||||
|
||||
// * Cas nombre de participation maximale atteint.
|
||||
$nbParticipations = Participation::where('user_id', Auth::user()->id)->count();
|
||||
$nbParticipations = Participation::where('user_id', auth()->user()->id)->count();
|
||||
if ($nbParticipations >= $settings->nb_participation_player) {
|
||||
return view('front.basic.participation-exhausted', compact('settings'));
|
||||
}
|
||||
|
||||
// * Check le code pour savoir s'il est encore utilisable.
|
||||
if (!$codeBase) {
|
||||
return back()->withErrors("Code incorrect, veuillez réessayer.");
|
||||
}
|
||||
if ($codeBase->code_used === 1) {
|
||||
return back()->withErrors("Ce code n'est plus utilisable.");
|
||||
}
|
||||
|
||||
// * Check si l'utilisateur n'a pas déjà utiliser ce code.
|
||||
$participUser = Participation::where([
|
||||
['code_unique_id', $codeBase->id],
|
||||
['user_id', Auth::user()->id]
|
||||
])->first();
|
||||
if ($participUser) {
|
||||
return back()->withErrors("Vous avez déjà utilisé ce code.");
|
||||
}
|
||||
|
||||
// * Check si les codes ean sont utilisés, auquel cas on test celui envoyé pour savoir s'il est correct.
|
||||
$codeEan = null;
|
||||
// TODO : Task Algo Sebastien
|
||||
if ($settings->use_ean_codes === 1) {
|
||||
$codeEan = $request->code_ean;
|
||||
$codeEanBase = CodesEAN::where('code', $codeEan)->first();
|
||||
if (!$codeEanBase) {
|
||||
$codeEanBase = CodesEAN::where('code', 'like', substr($codeEan, 0, 6) . "%")->first();
|
||||
}
|
||||
if (!$codeEanBase || empty($codeEan)) {
|
||||
return back()->withErrors('Le code barre entré est incorrect, veuillez réessayer.');
|
||||
}
|
||||
}
|
||||
|
||||
$codeNbUsage = Participation::where('code_unique_id', $codeBase->id)->count();
|
||||
|
||||
// * Gestion du nombre d'utilisation d'un code.
|
||||
if ($codeNbUsage >= $settings->nb_unique_code_use) {
|
||||
$codeBase->code_used = 1;
|
||||
$codeBase->save();
|
||||
return back()->withErrors("Ce code n'est plus utilisable.");
|
||||
} else {
|
||||
if ($codeNbUsage + 1 >= $settings->nb_unique_code_use) {
|
||||
$codeBase->code_used = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// * Tous les cas "bloquants" sont passé, l'utilisateur participe à partir d'ici.
|
||||
$participation = new Participation();
|
||||
$participation->user_id = Auth::user()->id;
|
||||
$participation->code_unique_id = $codeBase->id;
|
||||
$participation->code_ean_id = isset($codeEanBase) ? $codeEanBase->id : null;
|
||||
if (config('app.env') === "local") {
|
||||
$participation->ip = $_SERVER['REMOTE_ADDR'];
|
||||
} else {
|
||||
$participation->ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
}
|
||||
$participation->user_id = auth()->user()->id;
|
||||
$participation->code_unique_id = $request->code->id;
|
||||
$participation->code_ean_id = $request->code_ean ? $request->code_ean->id : null;
|
||||
$participation->ip = app('clientIp');
|
||||
$participation->save();
|
||||
|
||||
// * Gestion des instants gagnants.
|
||||
$userAlreadyWon = Participation::where([
|
||||
['user_id', Auth::user()->id],
|
||||
['instant_win_id', '<>', null]
|
||||
])->first();
|
||||
$userAlreadyWon = Participation::has('instantWin')
|
||||
->whereHas('user', function ($q) {
|
||||
$q->whereId(auth()->user()->id);
|
||||
})->first();
|
||||
|
||||
// * Si l'utilisateur actuel à déjà gagné un gros lot, pas d'instant gagnant.
|
||||
if ($userAlreadyWon) {
|
||||
return $this->serveCouponWin($settings,$participation);
|
||||
} else {
|
||||
// Gain d'un gros lot
|
||||
$instantWin = InstantWin::where([['appear_date', '<', now()], ['won', 0]])->orderBy('appear_date', 'ASC')->first();
|
||||
if ($instantWin) {
|
||||
$instantWin->won = 1;
|
||||
$instantWin->participation_id = $participation->id;
|
||||
//should save now to prevent next player win on the same winning moment
|
||||
$instantWin->save();
|
||||
$participation->instant_win_id = $instantWin->id;
|
||||
//ici si fail car unique dupliqué catch
|
||||
try {
|
||||
// Envoi du courrier Arcadia
|
||||
if ($instantWin->prize->arcadia_operation_code !== 0 && $instantWin->prize->arcadia_support_code !== 0) {
|
||||
$crmId = Auth::user()->crm_id;
|
||||
|
||||
$fields = [
|
||||
'root' => [
|
||||
[
|
||||
'fieldName' => 'order_date',
|
||||
'fieldValue' => date('d/m/Y')
|
||||
],
|
||||
[
|
||||
'fieldName' => 'operation',
|
||||
'fieldValue' => $instantWin->prize->arcadia_operation_code
|
||||
]
|
||||
],
|
||||
'orderLine' => [
|
||||
[
|
||||
'fieldName' => 'code_unique',
|
||||
'fieldValue' => "$codeBase->code_unique"
|
||||
],
|
||||
[
|
||||
'fieldName' => 'support_code',
|
||||
'fieldValue' => $instantWin->prize->arcadia_support_code
|
||||
],
|
||||
[
|
||||
'fieldName' => 'label_type_support',
|
||||
'fieldValue' => 'Gain du lot : ' . $instantWin->prize->label_one
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
if ($settings->use_ean_codes === 1) {
|
||||
$codeEan = $request->code_ean;
|
||||
$fields['orderLine'][] = [
|
||||
'fieldName' => 'code_on_pack',
|
||||
'fieldValue' => "$codeEan"
|
||||
];
|
||||
}
|
||||
|
||||
$arcadiaMail = $this->apiCrm->ArcadiaOutgoingMail($crmId, $fields, 'game');
|
||||
if ($arcadiaMail->status === 'NOK') {
|
||||
Mail::to(config('mail.MAIL_ADMIN'))->send(new CourrierArcadiaError(Auth::user()));
|
||||
}
|
||||
}
|
||||
|
||||
Mail::to(Auth::user()->email)->send(new PrizeWon(Auth::user(), $instantWin->prize, $settings));
|
||||
$mails = json_decode($settings->notification_emails);
|
||||
foreach ($mails as $mail) {
|
||||
Mail::to($mail->email)->send(new NotifWinAdmin($settings, $participation));
|
||||
}
|
||||
$participation->save();
|
||||
return view("front.basic." . $instantWin->prize->gain_view->file_name, compact('settings'))->with('prize', $instantWin->prize);
|
||||
} catch(Exception $e) {
|
||||
//unbind instant gagnant
|
||||
$participation->instant_win_id = null;
|
||||
//return $this->serveCouponWin($settings,$participation);
|
||||
}
|
||||
}
|
||||
return $this->serveCouponWin($settings,$participation);
|
||||
return $this->serveCouponWin($settings, $participation);
|
||||
}
|
||||
|
||||
$instantWin = InstantWin::where([['appear_date', '<', now()], ['won', 0]])
|
||||
->orderBy('appear_date', 'ASC')->first();
|
||||
if ($instantWin) {
|
||||
// Ici si fail car unique dupliqué catch.
|
||||
try {
|
||||
// Gain d'un gros lot.
|
||||
return $this->instantWin($settings, $request, $participation, $instantWin);
|
||||
} catch (\ErrorException $e) {
|
||||
// Unbind instant gagnant.
|
||||
$participation->instantWin()->delete();
|
||||
// TODO: si erreur il faut envoyer un mail à equipe.web@ldc.fr
|
||||
} //end try
|
||||
}
|
||||
return $this->serveCouponWin($settings, $participation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle instant wins
|
||||
*
|
||||
* @param Settings $settings
|
||||
* @param Request $request
|
||||
* @param Participation $participation
|
||||
* @param InstantWin|null $instantWin
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
private function instantWin(Settings $settings, Request $request, Participation &$participation, $instantWin)
|
||||
{
|
||||
$instantWin->won = true;
|
||||
// Should save now to prevent next player win on the same winning moment.
|
||||
$instantWin->save();
|
||||
$participation->instantWin()->save($instantWin);
|
||||
// Envoi du courrier Arcadia.
|
||||
if (
|
||||
$instantWin->prize->arcadia_operation_code !== 0 &&
|
||||
$instantWin->prize->arcadia_support_code !== 0
|
||||
) {
|
||||
$crmId = auth()->user()->crm_id;
|
||||
|
||||
$fields = [
|
||||
'root' => [
|
||||
[
|
||||
'fieldName' => 'order_date',
|
||||
'fieldValue' => date('d/m/Y')
|
||||
],
|
||||
[
|
||||
'fieldName' => 'operation',
|
||||
'fieldValue' => $instantWin->prize->arcadia_operation_code
|
||||
]
|
||||
],
|
||||
'orderLine' => [
|
||||
[
|
||||
'fieldName' => 'code_unique',
|
||||
'fieldValue' => $request->serial
|
||||
],
|
||||
[
|
||||
'fieldName' => 'support_code',
|
||||
'fieldValue' => $instantWin->prize->arcadia_support_code
|
||||
],
|
||||
[
|
||||
'fieldName' => 'label_type_support',
|
||||
'fieldValue' => 'Gain du lot : ' . $instantWin->prize->label_one
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
if ($settings->use_ean_codes === 1) {
|
||||
$codeEan = $request->code_ean;
|
||||
$fields['orderLine'][] = [
|
||||
'fieldName' => 'code_on_pack',
|
||||
'fieldValue' => "$codeEan"
|
||||
];
|
||||
}
|
||||
|
||||
$arcadiaMail = $this->apiCrm->ArcadiaOutgoingMail($crmId, $fields, 'game');
|
||||
if ($arcadiaMail->status === 'KO') {
|
||||
Mail::to(config('mail.MAIL_ADMIN'))->send(new CourrierArcadiaError(auth()->user()));
|
||||
}
|
||||
} //end if
|
||||
|
||||
Mail::to(auth()->user()->email)->send(new PrizeWon(auth()->user(), $instantWin->prize, $settings));
|
||||
$mails = json_decode($settings->notification_emails);
|
||||
foreach ($mails as $mail) {
|
||||
Mail::to($mail->email)->send(new NotifWinAdmin($settings, $participation));
|
||||
}
|
||||
$participation->save();
|
||||
return view("front.basic." . $instantWin->prize->gain_view->file_name, compact('settings'))
|
||||
->with('prize', $instantWin->prize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Détermine si un BR doit être servi
|
||||
* renvoi la vue de gain BR ou la vue "Perdu"
|
||||
*
|
||||
* @param Settings $settings
|
||||
* @param Participation $particiaption
|
||||
* @return View
|
||||
* @param Settings $settings
|
||||
* @param Participation $participation
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
private function serveCouponWin($settings, $participation) {
|
||||
// Si le jeu est 100% gagnant
|
||||
private function serveCouponWin(Settings $settings, Participation $participation)
|
||||
{
|
||||
// Si le jeu est 100% gagnant.
|
||||
if ($settings->reductions_activated === 1) {
|
||||
$coupon = $this->getRandomCoupon($settings);
|
||||
$crmCoupon = $this->updateCoupon($settings, $coupon->web_coupon_identifiant, $participation);
|
||||
|
|
@ -227,7 +206,13 @@ class EnterCodeController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
private function getRandomCoupon($settings)
|
||||
/**
|
||||
* Get a random coupon
|
||||
*
|
||||
* @param Settings $settings
|
||||
* @return mixed
|
||||
*/
|
||||
private function getRandomCoupon(Settings $settings)
|
||||
{
|
||||
$webCoupons = json_decode($settings->web_coupons);
|
||||
if (count($webCoupons) > 1) {
|
||||
|
|
@ -247,7 +232,15 @@ class EnterCodeController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
private function updateCoupon($settings, $coupon, $participation)
|
||||
/**
|
||||
* Update a coupon
|
||||
*
|
||||
* @param Settings $settings
|
||||
* @param mixed $coupon
|
||||
* @param Participation $participation
|
||||
* @return \App\Models\Reduction|null
|
||||
*/
|
||||
private function updateCoupon(Settings $settings, $coupon, Participation $participation)
|
||||
{
|
||||
$reduction = null;
|
||||
$mesBR = new MesBR(config('mesbr.endpoint'), $settings->reductions_site, $settings->reductions_campaign);
|
||||
|
|
@ -257,31 +250,38 @@ class EnterCodeController extends Controller
|
|||
$mesBR->updateContact($crmUser->user);
|
||||
$result = $mesBR->updatePanier($crmUser->user, $coupon);
|
||||
if ($result["status"] === "OK") {
|
||||
$reduction = new Reductions();
|
||||
$reduction->participation_id = $participation->id;
|
||||
$reduction->link = $result["link"];
|
||||
$reduction->verification = $result["verif"];
|
||||
$reduction->basket_id = $result["basketId"];
|
||||
$reduction = new Reduction();
|
||||
$reduction->link = $result["link"];
|
||||
$reduction->verification = $result["verif"];
|
||||
$reduction->basket_id = $result["basketId"];
|
||||
$reduction->save();
|
||||
$participation->reduction_id = $reduction->id;
|
||||
$participation->save();
|
||||
} else {
|
||||
Mail::to(config('mail.MAIL_ADMIN'))->send(new NotifAdmin("MESBR : Une erreur est survenue. Code : " . $result["code"] . " Message : " . $result["message"]));
|
||||
Mail::to(config('mail.MAIL_ADMIN'))
|
||||
->send(new NotifAdmin(\sprintf(
|
||||
'MESBR : Une erreur est survenue. Code : %s Message : %s',
|
||||
$result["code"],
|
||||
$result["message"]
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
} //end if
|
||||
return $reduction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function formWinningProof()
|
||||
{
|
||||
$participation = Participation::where([
|
||||
['user_id', Auth::user()->id],
|
||||
['instant_win_id', '<>', null],
|
||||
['sticker', null],
|
||||
['ticket', null],
|
||||
['barcode', null]
|
||||
])->first();
|
||||
])->has('instantWin')->first();
|
||||
if ($participation) {
|
||||
return view('front.basic.winning-proof', compact('participation'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\FaqQuestions;
|
||||
use App\Models\FaqThemes;
|
||||
use App\Models\FaqQuestion;
|
||||
use App\Models\FaqTheme;
|
||||
|
||||
class FAQController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$questions = FaqQuestions::all();
|
||||
$themes = FaqThemes::all();
|
||||
$questions = FaqQuestion::all();
|
||||
$themes = FaqTheme::all();
|
||||
if (count($questions) === 0 && count($themes) === 0) {
|
||||
return redirect()->route('home');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use App\Models\Settings;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Str;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
|
|
@ -48,9 +48,11 @@ class LoginController extends Controller
|
|||
|
||||
if ($connect->status === 'KO') {
|
||||
if ($connect->code === 500) {
|
||||
return back()->withInput($request->except("password"))->withErrors("La connexion est impossible pour le moment, veuillez réessayer plus tard.");
|
||||
return back()->withInput($request->except("password"))
|
||||
->withErrors("La connexion est impossible pour le moment, veuillez réessayer plus tard.");
|
||||
} else {
|
||||
return back()->withInput($request->except("password"))->withErrors("Email ou mot de passe incorrect.");
|
||||
return back()->withInput($request->except("password"))
|
||||
->withErrors("Email ou mot de passe incorrect.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -58,8 +60,9 @@ class LoginController extends Controller
|
|||
$userLocal->email_verify_token = Str::uuid();
|
||||
$userLocal->save();
|
||||
Mail::to($email)->send(new VerifyEmail($userLocal));
|
||||
return back()->withInput($request->except("password"))->withErrors("Votre compte existe mais votre email n'est pas confirmé, merci de vérifier vos emails.");
|
||||
}
|
||||
return back()->withInput($request->except("password"))
|
||||
->withErrors("Votre compte existe mais votre email n'est pas confirmé, merci de vérifier vos emails.");
|
||||
}//end if
|
||||
} else {
|
||||
$connect = $this->apiCrm->loginCustomer($email, $password);
|
||||
|
||||
|
|
@ -70,7 +73,8 @@ class LoginController extends Controller
|
|||
'lastname' => $connect->user->lastname,
|
||||
'birth_date' => $connect->user->birth_date,
|
||||
'email' => $email,
|
||||
'password' => Hash::make("MOTDEPASSE"), // TODO : ???
|
||||
// TODO : MOTDEPASSE ???.
|
||||
'password' => Hash::make("MOTDEPASSE"),
|
||||
'address' => $connect->user->address,
|
||||
'address2' => $connect->user->address2,
|
||||
'town' => $connect->user->city,
|
||||
|
|
@ -79,14 +83,16 @@ class LoginController extends Controller
|
|||
'email_verified' => 1
|
||||
]);
|
||||
} else {
|
||||
if ($connect->code === 116) { // Compte existant mais non activé
|
||||
// Compte existant mais non activé.
|
||||
if ($connect->code === 116) {
|
||||
$userLocal = User::create([
|
||||
'crm_id' => $connect->user->crm_id,
|
||||
'firstname' => $connect->user->firstname,
|
||||
'lastname' => $connect->user->lastname,
|
||||
'birth_date' => $connect->user->birth_date,
|
||||
'email' => $email,
|
||||
'password' => Hash::make("MOTDEPASSE"), // TODO : ???
|
||||
// TODO : MOTDEPASSE ???.
|
||||
'password' => Hash::make("MOTDEPASSE"),
|
||||
'address' => $connect->user->address,
|
||||
'address2' => $connect->user->address2,
|
||||
'town' => $connect->user->city,
|
||||
|
|
@ -97,16 +103,19 @@ class LoginController extends Controller
|
|||
$userLocal->email_verify_token = Str::uuid();
|
||||
$userLocal->save();
|
||||
Mail::to($email)->send(new VerifyEmail($userLocal));
|
||||
return back()->withInput($request->except("password"))->withErrors("Votre compte existe mais votre email n'est pas confirmé, merci de vérifier vos emails.");
|
||||
return back()->withInput($request->except("password"))
|
||||
->withErrors("Votre compte existe mais votre email n'est pas confirmé, merci de vérifier vos emails.");
|
||||
} elseif ($connect->code === 500) {
|
||||
return back()->withInput($request->except("password"))->withErrors("La connexion est impossible pour le moment, veuillez réessayer plus tard.");
|
||||
return back()->withInput($request->except("password"))
|
||||
->withErrors("La connexion est impossible pour le moment, veuillez réessayer plus tard.");
|
||||
} else {
|
||||
return back()->withInput($request->except("password"))->withErrors("Email ou mot de passe incorrect.");
|
||||
}
|
||||
}
|
||||
}
|
||||
return back()->withInput($request->except("password"))
|
||||
->withErrors("Email ou mot de passe incorrect.");
|
||||
} //end if
|
||||
} //end if
|
||||
}//end if
|
||||
|
||||
// TODO : Modifier avec separation guard
|
||||
// TODO : Modifier avec separation guard.
|
||||
$tmpPwd = "MOTDEPASSE";
|
||||
if ($userLocal->role <= 2) {
|
||||
$tmpPwd = $password;
|
||||
|
|
@ -144,7 +153,8 @@ class LoginController extends Controller
|
|||
$user->save();
|
||||
$result = true;
|
||||
} else {
|
||||
if ($activation->code === 110) { // User already active
|
||||
// User already active.
|
||||
if ($activation->code === 110) {
|
||||
$user->email_verified = 1;
|
||||
$user->email_verify_token = null;
|
||||
$user->save();
|
||||
|
|
@ -168,12 +178,14 @@ class LoginController extends Controller
|
|||
public function forgotPasswordReset(Request $request, $token)
|
||||
{
|
||||
if (!$request->hasValidSignature(false)) {
|
||||
return redirect()->route('login')->withErrors("Le lien de changement de votre mot de passe n'est plus valide, veuillez réessayer.");
|
||||
return redirect()->route('login')
|
||||
->withErrors("Le lien de changement de votre mot de passe n'est plus valide, veuillez réessayer.");
|
||||
}
|
||||
$tokenValid = false;
|
||||
$user = User::where('password_token', $token)->first();
|
||||
if (!$user) {
|
||||
return redirect()->route('forgot-password', compact('tokenValid'))->withErrors('Le lien de changement du mot de passe est incorrect.');
|
||||
return redirect()->route('forgot-password', compact('tokenValid'))
|
||||
->withErrors('Le lien de changement du mot de passe est incorrect.');
|
||||
}
|
||||
$tokenValid = true;
|
||||
return redirect()->route('forgot-password', compact('tokenValid', 'token'));
|
||||
|
|
@ -193,7 +205,8 @@ class LoginController extends Controller
|
|||
'lastname' => $userCrm->user->lastname,
|
||||
'birth_date' => $userCrm->user->birth_date,
|
||||
'email' => $email,
|
||||
'password' => Hash::make("MOTDEPASSE"), // TODO : ???
|
||||
// TODO : MOTDEPASSE ???
|
||||
'password' => Hash::make("MOTDEPASSE"),
|
||||
'address' => $userCrm->user->address,
|
||||
'address2' => $userCrm->user->address2,
|
||||
'town' => $userCrm->user->city,
|
||||
|
|
@ -207,22 +220,26 @@ class LoginController extends Controller
|
|||
$user->email_verify_token = Str::uuid();
|
||||
$user->save();
|
||||
Mail::to($email)->send(new VerifyEmail($user));
|
||||
return back()->withInput($request->except("password"))->withErrors("Votre compte existe mais votre email n'est pas confirmé, merci de vérifier vos emails.");
|
||||
return back()->withInput($request->except("password"))
|
||||
->withErrors("Votre compte existe mais votre email n'est pas confirmé, merci de vérifier vos emails.");
|
||||
}
|
||||
} else {
|
||||
if ($userCrm->code === 101) {
|
||||
return back()->withInput($request->only('email'))->withErrors("Le mail que vous avez entré n'est pas enregistré dans nos services.");
|
||||
return back()->withInput($request->only('email'))
|
||||
->withErrors("Le mail que vous avez entré n'est pas enregistré dans nos services.");
|
||||
} else {
|
||||
return back()->withErrors("Une erreur est survenue, veuillez réessayer plus tard.");
|
||||
}
|
||||
}
|
||||
}
|
||||
} //end if
|
||||
}//end if
|
||||
|
||||
$user->password_token = Str::uuid();
|
||||
$user->save();
|
||||
/** @var \App\Models\Settings $settings */
|
||||
$settings = app(Settings::class);
|
||||
Mail::to($email)->send(new PasswordReset($user, $settings));
|
||||
return redirect()->route('login')->with('success', 'Un mail de réinitialisation de votre mot de passe vous a été envoyé(e).');
|
||||
return redirect()->route('login')
|
||||
->with('success', 'Un mail de réinitialisation de votre mot de passe vous a été envoyé(e).');
|
||||
}
|
||||
|
||||
public function changePassword(Request $request)
|
||||
|
|
@ -236,7 +253,7 @@ class LoginController extends Controller
|
|||
return back()->withErrors('Le lien de changement de votre mot de passe est incorrect, veuillez réessayer.');
|
||||
}
|
||||
|
||||
// TODO : Ajouter controle du contenu du mot de passe
|
||||
// TODO : Ajouter controle du contenu du mot de passe.
|
||||
$newPassword = $request->password;
|
||||
|
||||
$update = $this->apiCrm->changePwdCustomer($user->crm_id, $newPassword);
|
||||
|
|
@ -244,10 +261,12 @@ class LoginController extends Controller
|
|||
if ($update->status === 'OK') {
|
||||
$user->password_token = null;
|
||||
$user->save();
|
||||
return redirect()->route('login')->with('success', 'Vous pouvez désormais vous connecter avec votre nouveau mot de passe.');
|
||||
return redirect()->route('login')
|
||||
->with('success', 'Vous pouvez désormais vous connecter avec votre nouveau mot de passe.');
|
||||
} else {
|
||||
if ($update->code === 123) {
|
||||
return back()->withErrors("Il semblerait que vous ayez déjà utilisé ce mot de passe pour votre compte. Veuillez réessayer en changeant de mot de passe.");
|
||||
return back()
|
||||
->withErrors("Il semblerait que vous ayez déjà utilisé ce mot de passe pour votre compte. Veuillez réessayer en changeant de mot de passe.");
|
||||
} else {
|
||||
return back()->withErrors("Une erreur est survenue, veuillez réessayer plus tard.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Models\Range;
|
||||
|
||||
class ProduitsController extends Controller
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Mail\VerifyEmail;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Http\Request;
|
||||
|
|
@ -122,7 +122,7 @@ class RegisterController extends Controller
|
|||
->withInput($request->except('password'))
|
||||
->withErrors("Une erreur est survenue, merci de recommencer.");
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
private function isSQLDate($date)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ class TeaserController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
$settings = app(Settings::class)->select('start_date', 'end_date', 'activated_teaser', 'teaser_end_activity')->first();
|
||||
$settings = app(Settings::class)
|
||||
->select('start_date', 'end_date', 'activated_teaser', 'teaser_end_activity')->first();
|
||||
if ($settings->activated_teaser === 1 && $settings->teaser_end_activity > now()) {
|
||||
return view('front.basic.teaser', compact('settings'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use App\Mail\NotifAdmin;
|
|||
use App\Mail\WinningProof;
|
||||
use App\Models\Participation;
|
||||
use App\Models\Settings;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
|
@ -27,11 +27,10 @@ class WinningProofController extends Controller
|
|||
// On récupère la participation gagnante en attente des infos
|
||||
$participation = Participation::where([
|
||||
['user_id', Auth::user()->id],
|
||||
['instant_win_id', '<>', null],
|
||||
['sticker', null],
|
||||
['ticket', null],
|
||||
['barcode', null]
|
||||
])->first();
|
||||
])->has('instantWin')->first();
|
||||
if (!$participation) {
|
||||
return redirect()->route('home');
|
||||
}
|
||||
|
|
@ -62,7 +61,7 @@ class WinningProofController extends Controller
|
|||
$ticket = $request->ticket;
|
||||
$barcode = $request->barcode;
|
||||
|
||||
// Mise à jour de l'utilisateur en local
|
||||
// Mise à jour de l'utilisateur en local.
|
||||
$user = User::find(Auth::user()->id);
|
||||
$user->lastname = $lastname;
|
||||
$user->firstname = $firstname;
|
||||
|
|
@ -74,11 +73,27 @@ class WinningProofController extends Controller
|
|||
$user->phone = $phone;
|
||||
$user->save();
|
||||
|
||||
// Mise à jour utilisateur dans la CRM
|
||||
$update = $this->apiCrm->updateCustomer($user->crm_id, $firstname, $lastname, null, null, $phone, $address, $address2, $town, $postalCode, ucfirst($country));
|
||||
// Mise à jour utilisateur dans la CRM.
|
||||
$update = $this->apiCrm->updateCustomer(
|
||||
$user->crm_id,
|
||||
$firstname,
|
||||
$lastname,
|
||||
null,
|
||||
null,
|
||||
$phone,
|
||||
$address,
|
||||
$address2,
|
||||
$town,
|
||||
$postalCode,
|
||||
ucfirst($country)
|
||||
);
|
||||
if ($update->status !== 'OK') {
|
||||
Log::warning('Erreur lors de la mise a jour du user (crm_id : ' . $user->crm_id . ') - code : ' . $update->code . ' - message : ' . $update->message);
|
||||
Mail::to(config('mail.MAIL_ADMIN'))->send(new NotifAdmin('CRM : Erreur lors de la mise a jour du user (crm_id : ' . $user->crm_id . ') - code : ' . $update->code . ' - message : ' . $update->message));
|
||||
Log::warning('Erreur lors de la mise a jour du user (crm_id : ' . $user->crm_id .
|
||||
') - code : ' . $update->code . ' - message : ' . $update->message);
|
||||
Mail::to(config('mail.MAIL_ADMIN'))->send(new NotifAdmin(
|
||||
'CRM : Erreur lors de la mise a jour du user (crm_id : ' .
|
||||
$user->crm_id . ') - code : ' . $update->code . ' - message : ' . $update->message
|
||||
));
|
||||
}
|
||||
|
||||
$participationId = $participation->id;
|
||||
|
|
@ -99,10 +114,18 @@ class WinningProofController extends Controller
|
|||
$participation->barcode = $barcodeFileName;
|
||||
$participation->save();
|
||||
|
||||
/** @var \App\Models\Settings $settings */
|
||||
$settings = app(Settings::class);
|
||||
$mails = json_decode($settings->notification_emails);
|
||||
foreach ($mails as $mail) {
|
||||
Mail::to($mail->email)->send(new WinningProof($stickerPath, $ticketPath, $barcodePath, $participation, $user, $settings));
|
||||
Mail::to($mail->email)->send(new WinningProof(
|
||||
$stickerPath,
|
||||
$ticketPath,
|
||||
$barcodePath,
|
||||
$participation,
|
||||
$user,
|
||||
$settings
|
||||
));
|
||||
}
|
||||
|
||||
return view('front.basic.replay');
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Settings;
|
||||
use App\Models\Reductions;
|
||||
use App\Models\Reduction;
|
||||
|
||||
class re7Controller extends Controller
|
||||
{
|
||||
|
|
@ -14,7 +14,8 @@ class re7Controller extends Controller
|
|||
|
||||
public function teaser()
|
||||
{
|
||||
$settings = app(Settings::class)->select('start_date', 'end_date', 'activated_teaser', 'teaser_end_activity')->first();
|
||||
$settings = app(Settings::class)
|
||||
->select('start_date', 'end_date', 'activated_teaser', 'teaser_end_activity')->first();
|
||||
return view('front.basic.teaser', compact('settings'));
|
||||
}
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ class re7Controller extends Controller
|
|||
{
|
||||
$settings = app(Settings::class);
|
||||
$coupon = $this->getRandomCoupon($settings);
|
||||
$crmCoupon = new Reductions();
|
||||
$crmCoupon = new Reduction();
|
||||
return view('front.basic.reduction', compact('coupon', 'crmCoupon'));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
|||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
|
|
@ -15,7 +14,6 @@ class Kernel extends HttpKernel
|
|||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Fruitcake\Cors\HandleCors::class,
|
||||
\App\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
|
|
@ -34,7 +32,6 @@ class Kernel extends HttpKernel
|
|||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class GameCheckDate
|
|||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
/** @var \App\Models\Settings $settings */
|
||||
$settings = app(Settings::class);
|
||||
|
||||
// Check si le teaser est actif
|
||||
|
|
|
|||
32
app/Http/Requests/CodeSearchRequest.php
Normal file
32
app/Http/Requests/CodeSearchRequest.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CodeSearchRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
// ? Is auth and super admin ?
|
||||
return auth()->check() and
|
||||
auth()->user()->role === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'code' => 'required|string|min:1|max:25'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Codes;
|
||||
use App\Models\Code;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ExportCodesRequest extends FormRequest
|
||||
|
|
@ -15,8 +15,8 @@ class ExportCodesRequest extends FormRequest
|
|||
public function authorize()
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Builder */
|
||||
$codesAvailableToExport = Codes::whereCodeExported(false);
|
||||
$lastExportedId = Codes::whereCodeExported(true)
|
||||
$codesAvailableToExport = Code::whereCodeExported(false);
|
||||
$lastExportedId = Code::whereCodeExported(true)
|
||||
->orderBy('id', 'desc')->first()->id ?? null;
|
||||
if ($lastExportedId) {
|
||||
$codesAvailableToExport = $codesAvailableToExport
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@
|
|||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Codes;
|
||||
use App\Models\Code;
|
||||
use App\Models\CodeEan;
|
||||
use App\Models\Participation;
|
||||
use App\Models\Settings;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
use Kwaadpepper\Serial\Exceptions\SerialCasterException;
|
||||
|
||||
|
|
@ -17,11 +19,39 @@ class ParticipateRequest extends FormRequest
|
|||
*/
|
||||
public function authorize()
|
||||
{
|
||||
$this->merge([
|
||||
'code' => is_string($this->code) ? Str::upper($this->code) : $this->code,
|
||||
'accept_rules' => $this->accept_rules ? true : false
|
||||
]);
|
||||
return true;
|
||||
/**
|
||||
* * Check si les codes ean sont utilisés, auquel cas
|
||||
* * on test celui envoyé pour savoir s'il est correct.
|
||||
* Modif demande vincent :
|
||||
* Tester code ean existe avec 13, puis 8 puis 7 chars
|
||||
*/
|
||||
if (app(Settings::class)->use_ean_codes) {
|
||||
$this->merge([
|
||||
'code_ean' => \in_array(Str::length($this->code_ean), [13, 8, 7]) ?
|
||||
CodeEan::where('code', $this->code_ean)
|
||||
->orWhere('code', 'LIKE', Str::limit($this->code_ean, 13, '') . '%')
|
||||
->orWhere('code', 'LIKE', Str::limit($this->code_ean, 8, '') . '%')
|
||||
->orWhere('code', 'LIKE', Str::limit($this->code_ean, 7, '') . '%')
|
||||
->first() : null
|
||||
]);
|
||||
}
|
||||
try {
|
||||
if (is_string($this->code)) {
|
||||
$this->merge([
|
||||
'serial' => $this->code,
|
||||
'code' => Code::whereId(Code::serialToInt(Str::upper($this->code)))->first() ?? false,
|
||||
]);
|
||||
}
|
||||
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
|
||||
} catch (SerialCasterException $e) {
|
||||
// Ignore.
|
||||
} finally {
|
||||
$this->merge([
|
||||
'accept_rules' => $this->accept_rules ? true : false
|
||||
]);
|
||||
}
|
||||
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +61,7 @@ class ParticipateRequest extends FormRequest
|
|||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
$rules = [
|
||||
'accept_rules' => [
|
||||
'required', 'boolean',
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
|
|
@ -42,21 +72,64 @@ class ParticipateRequest extends FormRequest
|
|||
}
|
||||
],
|
||||
'code' => [
|
||||
'required', 'string',
|
||||
'required',
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
function ($attribute, $value, $fail) {
|
||||
try {
|
||||
$int = Codes::serialToInt($value);
|
||||
if (!Codes::whereId(Codes::serialToInt($value))->exists()) {
|
||||
throw new SerialCasterException();
|
||||
}
|
||||
} catch (SerialCasterException $e) {
|
||||
dd($e);
|
||||
Log::debug($e->getMessage(), $e->getTrace());
|
||||
if (
|
||||
$value === false or
|
||||
!\is_object($value) or
|
||||
\get_class($value) !== Code::class
|
||||
) {
|
||||
$fail('Code incorrect, veuillez réessayer.');
|
||||
return false;
|
||||
} elseif ($value->code_used === 1) {
|
||||
$fail('Ce code n\'est plus utilisable.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// * Check si l'utilisateur n'a pas déjà utilisé ce code.
|
||||
$query = Participation::where([
|
||||
['code_unique_id', $this->code->id],
|
||||
['user_id', auth()->user()->id]
|
||||
]);
|
||||
if ($query->exists()) {
|
||||
$fail('Vous avez déjà utilisé ce code.');
|
||||
}
|
||||
|
||||
/** @var \App\Models\Settings $settings */
|
||||
$settings = app(Settings::class);
|
||||
|
||||
$codeNbUsage = Participation::where('code_unique_id', $this->code->id)
|
||||
->count();
|
||||
|
||||
// * Gestion du nombre d'utilisation d'un code.
|
||||
if ($codeNbUsage >= $settings->nb_unique_code_use) {
|
||||
$this->code->code_used = 1;
|
||||
return back()->withErrors("Ce code n'est plus utilisable.");
|
||||
} else {
|
||||
if ($codeNbUsage + 1 >= $settings->nb_unique_code_use) {
|
||||
$this->code->code_used = 1;
|
||||
}
|
||||
}
|
||||
$this->code->save();
|
||||
}
|
||||
]
|
||||
];
|
||||
|
||||
if (app(Settings::class)->use_ean_codes) {
|
||||
$rules = \array_merge($rules, [
|
||||
'code_ean' => [
|
||||
'required',
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
function ($attribute, $value, $fail) {
|
||||
if (!\is_object($value) or \get_class($value) !== CodeEan::class) {
|
||||
$fail('Le code barre entré est incorrect, veuillez réessayer.');
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
]);
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class StoreProductRequest extends FormRequest
|
|||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
|
|
@ -30,7 +30,9 @@ class StoreProductRequest extends FormRequest
|
|||
'image',
|
||||
'mimes:jpeg,png,jpg',
|
||||
'max:2048',
|
||||
Rule::dimensions()->maxWidth(config('theme.product_image_maxwidth'))->maxHeight(config('theme.product_image_maxheight'))
|
||||
Rule::dimensions()
|
||||
->maxWidth(config('theme.product_image_maxwidth'))
|
||||
->maxHeight(config('theme.product_image_maxheight'))
|
||||
],
|
||||
'range_id' => 'exists:ranges,id'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class StoreRangeRequest extends FormRequest
|
|||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
|
|
@ -30,7 +30,9 @@ class StoreRangeRequest extends FormRequest
|
|||
'image',
|
||||
'mimes:jpeg,png,jpg',
|
||||
'max:2048',
|
||||
Rule::dimensions()->maxWidth(config('theme.product_image_maxwidth'))->maxHeight(config('theme.product_image_maxheight'))
|
||||
Rule::dimensions()
|
||||
->maxWidth(config('theme.product_image_maxwidth'))
|
||||
->maxHeight(config('theme.product_image_maxheight'))
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class UpdateProductRequest extends FormRequest
|
|||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
|
|
@ -30,7 +30,9 @@ class UpdateProductRequest extends FormRequest
|
|||
'image',
|
||||
'mimes:jpeg,png,jpg',
|
||||
'max:2048',
|
||||
Rule::dimensions()->maxWidth(config('theme.product_image_maxwidth'))->maxHeight(config('theme.product_image_maxheight'))
|
||||
Rule::dimensions()
|
||||
->maxWidth(config('theme.product_image_maxwidth'))
|
||||
->maxHeight(config('theme.product_image_maxheight'))
|
||||
],
|
||||
'range_id' => 'exists:ranges,id'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class UpdateRangeRequest extends FormRequest
|
|||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
|
|
@ -30,7 +30,9 @@ class UpdateRangeRequest extends FormRequest
|
|||
'image',
|
||||
'mimes:jpeg,png,jpg',
|
||||
'max:2048',
|
||||
Rule::dimensions()->maxWidth(config('theme.product_image_maxwidth'))->maxHeight(config('theme.product_image_maxheight'))
|
||||
Rule::dimensions()
|
||||
->maxWidth(config('theme.product_image_maxwidth'))
|
||||
->maxHeight(config('theme.product_image_maxheight'))
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace App\Jobs;
|
|||
|
||||
use App\Mail\ExportCodesUniques;
|
||||
use App\Mail\JobFailed;
|
||||
use App\Models\Codes;
|
||||
use App\Models\Code;
|
||||
use Exception;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
|
@ -85,7 +85,7 @@ class ProcessExportCodesUniques implements ShouldQueue
|
|||
date('dmY_His')
|
||||
);
|
||||
|
||||
$lastExportedCodeId = Codes::whereCodeExported(true)
|
||||
$lastExportedCodeId = Code::whereCodeExported(true)
|
||||
->orderBy('id', 'desc')->first()->id ?? null;
|
||||
|
||||
$filesPath = $this->generateCsvFiles($lastExportedCodeId);
|
||||
|
|
@ -157,10 +157,10 @@ class ProcessExportCodesUniques implements ShouldQueue
|
|||
foreach ($codes as $code) {
|
||||
if ($currentExportedCodes < $this->nbCodeTot) {
|
||||
if ($currentLineCodes === ($this->nbCodeLigne === 1 ? 1 : $this->nbCodeLigne - 1)) {
|
||||
File::append($tempFilePath, Codes::intToSerial($code) . "\n");
|
||||
File::append($tempFilePath, Code::intToSerial($code) . "\n");
|
||||
$currentLineCodes = ($this->nbCodeLigne === 1 ? 1 : 0);
|
||||
} else {
|
||||
File::append($tempFilePath, Codes::intToSerial($code) . ';');
|
||||
File::append($tempFilePath, Code::intToSerial($code) . ';');
|
||||
$currentLineCodes++;
|
||||
} //end if
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ class ProcessExportCodesUniques implements ShouldQueue
|
|||
}
|
||||
// ? Have we reached pagination limit for mass saving ?
|
||||
if (count($exportedCodesId) === $paginate) {
|
||||
Codes::whereIn('id', $exportedCodesId)->update(['code_exported' => 1]);
|
||||
Code::whereIn('id', $exportedCodesId)->update(['code_exported' => 1]);
|
||||
$exportedCodesId = [];
|
||||
}
|
||||
} //end if
|
||||
|
|
@ -190,7 +190,7 @@ class ProcessExportCodesUniques implements ShouldQueue
|
|||
|
||||
// ? Are there exported codes to save ?
|
||||
if (count($exportedCodesId)) {
|
||||
Codes::whereIn('id', $exportedCodesId)->update(['code_exported' => 1]);
|
||||
Code::whereIn('id', $exportedCodesId)->update(['code_exported' => 1]);
|
||||
}
|
||||
return $outPaths;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace App\Jobs;
|
|||
|
||||
use App\Mail\CodeGenerationEnd;
|
||||
use App\Mail\JobFailed;
|
||||
use App\Models\Codes;
|
||||
use App\Models\Code;
|
||||
use App\Models\Settings;
|
||||
use Exception;
|
||||
use Illuminate\Bus\Queueable;
|
||||
|
|
@ -66,12 +66,13 @@ class ProcessUniqueCode implements ShouldQueue
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
/** @var \App\Models\Settings $settings */
|
||||
$settings = app(Settings::class);
|
||||
|
||||
$maxSQLPlaceholders = 65535;
|
||||
|
||||
$insertColumns = collect(DB::getSchemaBuilder()
|
||||
->getColumnListing((new Codes())->getTable()))
|
||||
->getColumnListing((new Code())->getTable()))
|
||||
->filter(function ($name) {
|
||||
// * Ignorer les colonnes avec valeurs par défaut sur la table.
|
||||
return !in_array($name, ['id', 'code_used', 'code_exported']);
|
||||
|
|
@ -101,7 +102,7 @@ class ProcessUniqueCode implements ShouldQueue
|
|||
} while ($totalGeneratedInserts < $this->quantity and --$insertToGenerate);
|
||||
|
||||
// * Mass insert
|
||||
Codes::insert($inserts);
|
||||
Code::insert($inserts);
|
||||
|
||||
$totalGeneratedInserts += count($inserts);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
|
|
@ -12,14 +13,20 @@ class CourrierArcadiaError extends Mailable implements ShouldQueue
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* User
|
||||
*
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user)
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
|
@ -32,6 +39,7 @@ class CourrierArcadiaError extends Mailable implements ShouldQueue
|
|||
public function build()
|
||||
{
|
||||
$user = $this->user;
|
||||
return $this->subject("Erreur envoi courrier arcadia")->view('front.basic.error-arcadia-email', compact('user'));
|
||||
return $this->subject("Erreur envoi courrier arcadia")
|
||||
->view('front.basic.error-arcadia-email', compact('user'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class JobFailed extends Mailable
|
|||
public $job;
|
||||
|
||||
public $exception;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
|
|
@ -31,6 +32,7 @@ class JobFailed extends Mailable
|
|||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->subject('[JOB FAILED] Une erreur est survenue pendant le job : ' . $this->job)->view('bo.mails.job-failed');
|
||||
return $this->subject('[JOB FAILED] Une erreur est survenue pendant le job : ' . $this->job)
|
||||
->view('bo.mails.job-failed');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class NotifWinAdmin extends Mailable implements ShouldQueue
|
|||
public function build()
|
||||
{
|
||||
$participation = $this->participation;
|
||||
return $this->subject($this->settings->name . " : un lot a été gagné")->view('front.basic.notif-win-admin-email', compact('participation'));
|
||||
return $this->subject($this->settings->name . " : un lot a été gagné")
|
||||
->view('front.basic.notif-win-admin-email', compact('participation'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,11 @@ class WinningProof extends Mailable implements ShouldQueue
|
|||
{
|
||||
$participation = $this->participation;
|
||||
$user = $this->user;
|
||||
return $this->subject($this->settings->name . " : Preuves de gain de " . $this->user->lastname . " " . $this->user->firstname)
|
||||
->view('front.basic.winning-proof-email', compact('participation', 'user'))->attach($this->sticker)->attach($this->ticket)->attach($this->barcode);
|
||||
return $this->subject(
|
||||
$this->settings->name . " : Preuves de gain de " . $this->user->lastname . " " . $this->user->firstname
|
||||
)->view(
|
||||
'front.basic.winning-proof-email',
|
||||
compact('participation', 'user')
|
||||
)->attach($this->sticker)->attach($this->ticket)->attach($this->barcode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BannedIP extends Model
|
||||
{
|
||||
|
||||
protected $table = "banned_ip";
|
||||
|
||||
protected $fillable = ['ip'];
|
||||
|
||||
public $timestamps = false;
|
||||
}
|
||||
22
app/Models/BannedIp.php
Normal file
22
app/Models/BannedIp.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BannedIp extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['ip'];
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ namespace App\Models;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Kwaadpepper\Serial\SerialCaster;
|
||||
|
||||
class Codes extends Model
|
||||
class Code extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
27
app/Models/CodeEan.php
Normal file
27
app/Models/CodeEan.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CodeEan extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['code', 'product'];
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
public function participations()
|
||||
{
|
||||
return $this->hasMany(Participation::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CodesEAN extends Model
|
||||
{
|
||||
|
||||
protected $table = "codes_ean";
|
||||
|
||||
protected $fillable = ['code', 'product'];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function participations()
|
||||
{
|
||||
return $this->hasMany('App\Models\Participation', 'code_ean_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,4 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class Content extends Model
|
||||
{
|
||||
|
||||
protected $table = "content";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,16 +4,21 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FaqQuestions extends Model
|
||||
class FaqQuestion extends Model
|
||||
{
|
||||
|
||||
protected $table = "faq_questions";
|
||||
|
||||
protected $fillable = ["question", "answer", "positive_vote", "negative_vote", "theme_id"];
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'question', 'answer', 'positive_vote',
|
||||
'negative_vote', 'theme_id'
|
||||
];
|
||||
|
||||
public function theme()
|
||||
{
|
||||
return $this->belongsTo('App\Models\FaqThemes', 'theme_id');
|
||||
return $this->belongsTo(FaqTheme::class, 'theme_id');
|
||||
}
|
||||
|
||||
public function getUtilityAttribute()
|
||||
27
app/Models/FaqTheme.php
Normal file
27
app/Models/FaqTheme.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FaqTheme extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['name'];
|
||||
|
||||
/**
|
||||
* The relations to eager load on every query.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $with = ['questions'];
|
||||
|
||||
public function questions()
|
||||
{
|
||||
return $this->hasMany(FaqQuestion::class, 'theme_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FaqThemes extends Model
|
||||
{
|
||||
|
||||
protected $table = "faq_themes";
|
||||
|
||||
protected $fillable = ["name"];
|
||||
|
||||
protected $with = ['questions'];
|
||||
|
||||
public function questions()
|
||||
{
|
||||
return $this->hasMany('App\Models\FaqQuestions', 'theme_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -6,11 +6,15 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class GainView extends Model
|
||||
{
|
||||
|
||||
protected $fillable = ["name", "file_name"];
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['name', 'file_name'];
|
||||
|
||||
public function prizes()
|
||||
{
|
||||
return $this->hasMany('App\Models\Prizes', 'gain_view_id');
|
||||
return $this->hasMany(Prize::class, 'gain_view_id');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,20 +6,46 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class InstantWin extends Model
|
||||
{
|
||||
|
||||
protected $table = "instant_win";
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The relations to eager load on every query.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $with = ['prize'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'won' => 'bool'
|
||||
];
|
||||
|
||||
/**
|
||||
* BelongsTo Prize relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function prize()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Prizes', 'prize_id');
|
||||
return $this->belongsTo(Prize::class, 'prize_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* One to one relation participation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function participation()
|
||||
{
|
||||
return $this->hasOne('App\Models\Participation', 'instant_win_id');
|
||||
return $this->belongsTo(Participation::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,37 +6,63 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class Participation extends Model
|
||||
{
|
||||
|
||||
protected $table = "participation";
|
||||
|
||||
/**
|
||||
* BelongsTo User relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User', 'user_id');
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsTo Codes relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function code()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Codes', 'code_unique_id');
|
||||
return $this->belongsTo(Code::class, 'code_unique_id');
|
||||
}
|
||||
|
||||
public function code_ean()
|
||||
/**
|
||||
* BelongsTo CodesEAN relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function codeEan()
|
||||
{
|
||||
return $this->belongsTo('App\Models\CodesEAN', 'code_ean_id');
|
||||
return $this->belongsTo(CodeEan::class);
|
||||
}
|
||||
|
||||
public function instant_win()
|
||||
/**
|
||||
* One to one InstantWin relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function instantWin()
|
||||
{
|
||||
return $this->hasOne('App\Models\InstantWin', 'participation_id');
|
||||
return $this->hasOne(InstantWin::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* One to one Reduction relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function reduction()
|
||||
{
|
||||
return $this->hasOne('App\Models\Reductions', 'reduction_id');
|
||||
return $this->hasOne(Reduction::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* ean_code_value accessor
|
||||
*
|
||||
* @return integer|null
|
||||
*/
|
||||
public function getCodeEanValueAttribute()
|
||||
{
|
||||
$code = CodesEAN::find($this->code_ean_id)->code;
|
||||
return $code;
|
||||
return optional($this->codeEan)->code;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Prizes extends Model
|
||||
class Prize extends Model
|
||||
{
|
||||
public function gain_view()
|
||||
{
|
||||
return $this->belongsTo('App\Models\GainView', 'gain_view_id');
|
||||
return $this->belongsTo(GainView::class, 'gain_view_id');
|
||||
}
|
||||
|
||||
public function instant_wins()
|
||||
{
|
||||
return $this->hasMany('App\Models\InstantWin', 'prize_id');
|
||||
return $this->hasMany(InstantWin::class, 'prize_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,11 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class Range extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['name'];
|
||||
|
||||
public function products()
|
||||
|
|
|
|||
18
app/Models/Reduction.php
Normal file
18
app/Models/Reduction.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Reduction extends Model
|
||||
{
|
||||
/**
|
||||
* One to one Participation relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function participation()
|
||||
{
|
||||
return $this->belongsTo(Participation::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Reductions extends Model
|
||||
{
|
||||
public function participation()
|
||||
{
|
||||
return $this->hasOne('App\Models\Participation', 'participation_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class Settings extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
|
@ -49,8 +49,13 @@ class User extends Authenticatable
|
|||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* Has Many Participation relation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function participations()
|
||||
{
|
||||
return $this->hasMany('App\Models\Participation', 'user_id');
|
||||
return $this->hasMany(Participation::class, 'user_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -2,25 +2,19 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Prizes;
|
||||
use App\Models\Prize;
|
||||
use App\Models\Settings;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
|
|
@ -28,11 +22,32 @@ class AppServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
if (config('app.env') !== 'local') {
|
||||
\URL::forceScheme('https');
|
||||
// * LOCAL HTTPS FIX.
|
||||
if (!in_array(config('app.env'), ['local', 'testing'])) {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
// * HA PROXY FIX.
|
||||
App::singleton('clientIp', function () {
|
||||
if (
|
||||
config('app.env') === 'local'
|
||||
) {
|
||||
return request()->getClientIp();
|
||||
} else {
|
||||
return request()->server('HTTP_X_FORWARDED_FOR') ??
|
||||
request()->getClientIp();
|
||||
}
|
||||
});
|
||||
// * LOCAL FORCE eg: for Carbon.
|
||||
setlocale(LC_ALL, \sprintf(
|
||||
'%s_%s.UTF-8',
|
||||
config('app.locale'),
|
||||
\strtoupper(config('app.locale'))
|
||||
));
|
||||
Carbon::setLocale(config('app.locale'));
|
||||
// * FORCE BOOTSTRAP PAGINATOR.
|
||||
if (!app()->runningInConsole()) {
|
||||
Paginator::useBootstrap();
|
||||
}
|
||||
|
||||
setlocale(LC_TIME, config('app.locale') . "_" . strtoupper(config('app.locale')) . '.utf8');
|
||||
|
||||
app()->singleton(Settings::class, function () {
|
||||
if (!($settings = Settings::find(1))) {
|
||||
|
|
@ -42,18 +57,20 @@ class AppServiceProvider extends ServiceProvider
|
|||
});
|
||||
|
||||
if (!app()->runningInConsole()) {
|
||||
// On ramène le nom du jeu et le nom de la société sur toute les pages
|
||||
// On ramène le nom du jeu et le nom de la société sur toute les pages.
|
||||
$settingsGlobal = Cache::get('settingsGlobal');
|
||||
if (!$settingsGlobal) {
|
||||
$settingsGlobal = app(Settings::class)->select('name', 'company', 'analytics', 'start_date', 'end_date')->first();
|
||||
$settingsGlobal = app(Settings::class)
|
||||
->select('name', 'company', 'analytics', 'start_date', 'end_date')
|
||||
->first();
|
||||
Cache::put('settingsGlobal', $settingsGlobal);
|
||||
}
|
||||
View::share('settingsGlobal', $settingsGlobal);
|
||||
|
||||
// On ramène aussi tout les prix car on en a besoin sur le header
|
||||
// On ramène aussi tout les prix car on en a besoin sur le header.
|
||||
$prizesGlobal = Cache::get('prizesGlobal');
|
||||
if (!$prizesGlobal) {
|
||||
$prizesGlobal = Prizes::all();
|
||||
$prizesGlobal = Prize::all();
|
||||
Cache::put('prizesGlobal', $prizesGlobal);
|
||||
}
|
||||
View::share('prizesGlobal', $prizesGlobal);
|
||||
|
|
@ -62,6 +79,6 @@ class AppServiceProvider extends ServiceProvider
|
|||
Blade::if('superadmin', function () {
|
||||
return auth()->user() && auth()->user()->role == 1;
|
||||
});
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,15 +6,12 @@ use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvid
|
|||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
// 'App\Model' => 'App\Policies\ModelPolicy',
|
||||
];
|
||||
protected $policies = [];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
|
|
@ -24,7 +21,5 @@ class AuthServiceProvider extends ServiceProvider
|
|||
public function boot()
|
||||
{
|
||||
$this->registerPolicies();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvi
|
|||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
|
|
@ -19,16 +18,4 @@ class EventServiceProvider extends ServiceProvider
|
|||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* This namespace is applied to your controller routes.
|
||||
*
|
||||
|
|
@ -15,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
protected $namespace = null;
|
||||
|
||||
/**
|
||||
* The path to the "home" route for your application.
|
||||
|
|
@ -31,51 +33,38 @@ class RouteServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
$this->configureRateLimiting();
|
||||
|
||||
parent::boot();
|
||||
}
|
||||
$this->routes(function () {
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web-bo.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web-re7.php'));
|
||||
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
* Configure the rate limiters for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapApiRoutes()
|
||||
protected function configureRateLimiting()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
RateLimiter::for('api', function (Request $request) {
|
||||
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,24 +8,25 @@
|
|||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.2.5",
|
||||
"php": "^7.3",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"fideloper/proxy": "^4.2",
|
||||
"fruitcake/laravel-cors": "^2.0",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"kwaadpepper/exception-handler": "^0.0.6",
|
||||
"kwaadpepper/serial-int-caster": "^1.0",
|
||||
"laravel/framework": "^7.24",
|
||||
"laravel/framework": "^8.0",
|
||||
"laravel/tinker": "^2.0",
|
||||
"laravel/ui": "2.4"
|
||||
"laravel/ui": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/dbal": "^2.0",
|
||||
"facade/ignition": "^2.0",
|
||||
"facade/ignition": "^2.3.6",
|
||||
"fzaninotto/faker": "^1.9.1",
|
||||
"mockery/mockery": "^1.3.1",
|
||||
"nunomaduro/collision": "^4.1",
|
||||
"phpunit/phpunit": "^8.5",
|
||||
"nunomaduro/collision": "^5.0",
|
||||
"phpunit/phpunit": "^9.0",
|
||||
"slevomat/coding-standard": "^7.0",
|
||||
"squizlabs/php_codesniffer": "^3.6"
|
||||
},
|
||||
|
|
@ -41,11 +42,11 @@
|
|||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/"
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
},
|
||||
"classmap": [
|
||||
"database/seeds",
|
||||
"database/factories",
|
||||
"class"
|
||||
]
|
||||
},
|
||||
|
|
|
|||
2590
composer.lock
generated
2590
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -68,7 +68,7 @@ return [
|
|||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => App\User::class,
|
||||
'model' => App\Models\User::class,
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
17
config/exception-handler.php
Normal file
17
config/exception-handler.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
/**
|
||||
* Send mail when app debug is turn off
|
||||
* so you can be warned if an unhandled exception occurs
|
||||
*/
|
||||
'enableMaiLog' => !config('app.debug'),
|
||||
|
||||
/**
|
||||
* Put a developper secured mailbox in here
|
||||
* so you can receive email if things go mad
|
||||
*/
|
||||
'contactsList' => [
|
||||
env('MAIL_LIST_SERVICEWEB', 'equipe.web@ldc.fr')
|
||||
]
|
||||
];
|
||||
|
|
@ -1,28 +1,26 @@
|
|||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\User;
|
||||
use Faker\Generator as Faker;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Factories
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This directory should contain each of the model factory definitions for
|
||||
| your application. Factories provide a convenient way to generate new
|
||||
| model instances for testing / seeding your application's database.
|
||||
|
|
||||
*/
|
||||
|
||||
$factory->define(User::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
'email_verified_at' => now(),
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
});
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name(),
|
||||
'email' => $this->faker->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
// * password
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class CreateFailedJobsTable extends Migration
|
|||
{
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->nullable()->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ class CreateSettings extends Migration
|
|||
$table->integer('nb_participation_player');
|
||||
$table->integer('nb_participation_ip');
|
||||
$table->integer('nb_unique_code_use');
|
||||
$table->smallInteger('code_length')
|
||||
->default(config('codes.codeLength'));
|
||||
$table->boolean('use_ean_codes');
|
||||
$table->boolean('activated_teaser');
|
||||
$table->dateTime('teaser_end_activity')->nullable();
|
||||
|
|
@ -37,11 +39,11 @@ class CreateSettings extends Migration
|
|||
$table->text('notification_emails')->nullable();
|
||||
$table->boolean('winning_proof');
|
||||
$table->string('company');
|
||||
$table->text('analytics')->nullable();
|
||||
$table->string('analytics', strlen('UA-XXXXXXXX-1'))->nullable();
|
||||
$table->timestamps();
|
||||
$table->collation = 'utf8mb4_unicode_ci';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateGainView extends Migration
|
||||
class CreateGainViews extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateInstantWin extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('instant_win', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId("prize_id")->constrained("prizes");
|
||||
$table->dateTime("appear_date");
|
||||
$table->boolean("won")->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('instant_win');
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,6 @@ class CreateCodes extends Migration
|
|||
{
|
||||
Schema::create('codes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code_unique')->unique();
|
||||
$table->boolean('code_used')->default(0);
|
||||
$table->boolean('code_exported')->default(0);
|
||||
$table->date('date_creation');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCodesEan extends Migration
|
||||
class CreateCodeEans extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
|
@ -13,7 +13,7 @@ class CreateCodesEan extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('codes_ean', function (Blueprint $table) {
|
||||
Schema::create('code_eans', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code');
|
||||
$table->string('product');
|
||||
|
|
@ -28,6 +28,6 @@ class CreateCodesEan extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('codes_ean');
|
||||
Schema::dropIfExists('code_eans');
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateBannedIp extends Migration
|
||||
class CreateBannedIps extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
|
@ -13,7 +13,7 @@ class CreateBannedIp extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('banned_ip', function (Blueprint $table) {
|
||||
Schema::create('banned_ips', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('ip');
|
||||
$table->unique('ip');
|
||||
|
|
@ -27,6 +27,6 @@ class CreateBannedIp extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('banned_ip');
|
||||
Schema::dropIfExists('banned_ips');
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateContent extends Migration
|
||||
class CreateContents extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
|
@ -13,7 +13,7 @@ class CreateContent extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('content', function (Blueprint $table) {
|
||||
Schema::create('contents', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('key');
|
||||
$table->text('value');
|
||||
|
|
@ -16,7 +16,7 @@ class CreateFaqQuestions extends Migration
|
|||
Schema::create('faq_questions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('question');
|
||||
$table->string('answer');
|
||||
$table->text('answer');
|
||||
$table->unsignedInteger('positive_vote')->nullable();
|
||||
$table->unsignedInteger('negative_vote')->nullable();
|
||||
$table->foreignId('theme_id')->constrained('faq_themes');
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ class CreateReductions extends Migration
|
|||
{
|
||||
Schema::create('reductions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('participation_id')->constrained('participation');
|
||||
$table->string('link');
|
||||
$table->string('basket_id');
|
||||
$table->string('verification');
|
||||
|
|
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParticipation extends Migration
|
||||
class CreateParticipations extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
|
@ -13,16 +13,16 @@ class CreateParticipation extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('participation', function (Blueprint $table) {
|
||||
Schema::create('participations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained('users');
|
||||
$table->foreignId('code_unique_id')->constrained('codes');
|
||||
$table->foreignId('code_ean_id')->nullable()->constrained('codes_ean');
|
||||
$table->foreignId('instant_win_id')->nullable()->constrained('instant_win');
|
||||
$table->string('ip');
|
||||
$table->string('sticker')->nullable();
|
||||
$table->string('ticket')->nullable();
|
||||
$table->string('barcode')->nullable();
|
||||
$table->foreignId('user_id')->constrained('users');
|
||||
$table->foreignId('code_unique_id')->constrained('codes');
|
||||
$table->foreignId('code_ean_id')->nullable()->constrained('code_eans');
|
||||
$table->foreignId('reduction_id')->nullable()->constrained('reductions');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
@ -34,6 +34,6 @@ class CreateParticipation extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('participation');
|
||||
Schema::dropIfExists('participations');
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,6 @@ class CreatePrizes extends Migration
|
|||
{
|
||||
Schema::create('prizes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger("arcadia_id");
|
||||
$table->string("label_one");
|
||||
$table->string("label_many");
|
||||
$table->integer("quantity");
|
||||
|
|
@ -23,6 +22,7 @@ class CreatePrizes extends Migration
|
|||
$table->integer("arcadia_support_code");
|
||||
$table->string("pdf_winning_proof")->nullable();
|
||||
$table->boolean("need_proof");
|
||||
$table->unsignedBigInteger("arcadia_id");
|
||||
$table->foreignId("gain_view_id")->constrained("gain_views");
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateInstantWins extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('instant_wins', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->dateTime('appear_date');
|
||||
$table->boolean('won')->default(0);
|
||||
$table->foreignId('prize_id')->constrained('prizes');
|
||||
$table->foreignId('participation_id')->nullable()
|
||||
->constrained('participations')->unique();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('instant_wins');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ParticipationAddReductionId extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table("participation", function(Blueprint $table) {
|
||||
$table->foreignId('reduction_id')->after("instant_win_id")->nullable()->constrained('reductions');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table("participation", function(Blueprint $table) {
|
||||
$table->dropForeign(["reduction_id"]);
|
||||
$table->dropColumn("reduction_id");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateInstantWinParticipationId extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table("instant_win", function(Blueprint $table) {
|
||||
$table->foreignId('participation_id')->nullable()->constrained('participation');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table("instant_win", function(Blueprint $table) {
|
||||
$table->dropForeign(["participation_id"]);
|
||||
$table->dropColumn("participation_id");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ExtendAnswerFieldInFaqQuestions extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('faq_questions', function (Blueprint $table) {
|
||||
$table->text('answer')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('faq_questions', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateModelsRangesTable extends Migration
|
||||
class CreateModelRangesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
|
@ -13,7 +13,7 @@ class CreateModelsRangesTable extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('models_ranges', function (Blueprint $table) {
|
||||
Schema::create('model_ranges', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
@ -26,6 +26,6 @@ class CreateModelsRangesTable extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('models_ranges');
|
||||
Schema::dropIfExists('model_ranges');
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ class CreateRangesTable extends Migration
|
|||
Schema::create('ranges', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('picture')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddRangeIdToProductsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->foreignId('range_id')->before('created_at')->references('id')
|
||||
->on('ranges')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropForeign(['range_id']);
|
||||
$table->dropColumn('range_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,9 @@ class CreateProductsTable extends Migration
|
|||
$table->string('name');
|
||||
$table->unsignedInteger('no_art')->nullable();
|
||||
$table->string('picture')->nullable();
|
||||
$table->string('code_ean');
|
||||
$table->foreignId('range_id')->before('created_at')->references('id')
|
||||
->on('ranges')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddImageToRangesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('ranges', function (Blueprint $table) {
|
||||
$table->string('picture')->nullable()->before('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ranges', function (Blueprint $table) {
|
||||
$table->dropColumn('picture');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEanToProductsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->string('code_ean')->before('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropColumn('code_ean');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class MakeInstantWinUniqueInParticipation extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('participation', function (Blueprint $table) {
|
||||
$table->unique('instant_win_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('participation', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RemoveCodeUniqueFromCodes extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('codes', function (Blueprint $table) {
|
||||
$table->dropColumn('code_unique');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('codes', function (Blueprint $table) {
|
||||
$table->string('code_unique')->unique();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCodeLengthToSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->smallInteger('code_length')
|
||||
->default(config('codes.codeLength'))->after('nb_unique_code_use');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->dropColumn('code_length');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Content;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
|
|
@ -12,16 +14,16 @@ class ContentSeeder extends Seeder
|
|||
*/
|
||||
public function run()
|
||||
{
|
||||
$mentions = new Content();
|
||||
$mentions->key = "mentions legales";
|
||||
$mentions = new Content();
|
||||
$mentions->key = "mentions legales";
|
||||
$mentions->value = "...";
|
||||
|
||||
$charte = new Content();
|
||||
$charte->key = "charte";
|
||||
$charte = new Content();
|
||||
$charte->key = "charte";
|
||||
$charte->value = "...";
|
||||
|
||||
$reglement = new Content();
|
||||
$reglement->key = "reglement";
|
||||
$reglement = new Content();
|
||||
$reglement->key = "reglement";
|
||||
$reglement->value = "...";
|
||||
|
||||
$mentions->save();
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
37
database/seeders/SettingsSeeder.php
Normal file
37
database/seeders/SettingsSeeder.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Settings;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SettingsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$settings = new Settings();
|
||||
$settings->name = "Nom du jeu";
|
||||
$settings->start_date = now();
|
||||
$settings->end_date = new Carbon(strtotime("+30 days"));
|
||||
$settings->nb_participation_player = 30;
|
||||
$settings->nb_participation_ip = 30;
|
||||
$settings->nb_unique_code_use = 0;
|
||||
$settings->use_ean_codes = false;
|
||||
$settings->activated_teaser = false;
|
||||
$settings->activated_close_page = false;
|
||||
$settings->redirect_close = "https://example.test";
|
||||
$settings->reductions_activated = false;
|
||||
$settings->facebook_activated = false;
|
||||
$settings->notification_emails = "[]";
|
||||
$settings->winning_proof = 0;
|
||||
$settings->company = "Société";
|
||||
$settings->web_coupons = "[]";
|
||||
$settings->save();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Settings;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SettingsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$settings = new Settings();
|
||||
$settings->name = "Nom du jeu";
|
||||
$settings->start_date = now();
|
||||
$settings->end_date = new Carbon(strtotime("+30 days"));
|
||||
$settings->nb_participation_player = 30;
|
||||
$settings->nb_participation_ip = 30;
|
||||
$settings->nb_unique_code_use = 0;
|
||||
$settings->use_ean_codes = false;
|
||||
$settings->activated_teaser = false;
|
||||
$settings->activated_close_page = false;
|
||||
$settings->redirect_close = "https://example.test";
|
||||
$settings->reductions_activated = false;
|
||||
$settings->facebook_activated = false;
|
||||
$settings->notification_emails = "[]";
|
||||
$settings->winning_proof = 0;
|
||||
$settings->company = "Société";
|
||||
$settings->web_coupons = "[]";
|
||||
$settings->save();
|
||||
}
|
||||
}
|
||||
295
public/css/app.css
vendored
295
public/css/app.css
vendored
|
|
@ -633,13 +633,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-1{
|
||||
flex:0 0 8.3333333333%;
|
||||
max-width:8.3333333333%;
|
||||
flex:0 0 8.33333333%;
|
||||
max-width:8.33333333%;
|
||||
}
|
||||
|
||||
.col-2{
|
||||
flex:0 0 16.6666666667%;
|
||||
max-width:16.6666666667%;
|
||||
flex:0 0 16.66666667%;
|
||||
max-width:16.66666667%;
|
||||
}
|
||||
|
||||
.col-3{
|
||||
|
|
@ -648,13 +648,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-4{
|
||||
flex:0 0 33.3333333333%;
|
||||
max-width:33.3333333333%;
|
||||
flex:0 0 33.33333333%;
|
||||
max-width:33.33333333%;
|
||||
}
|
||||
|
||||
.col-5{
|
||||
flex:0 0 41.6666666667%;
|
||||
max-width:41.6666666667%;
|
||||
flex:0 0 41.66666667%;
|
||||
max-width:41.66666667%;
|
||||
}
|
||||
|
||||
.col-6{
|
||||
|
|
@ -663,13 +663,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-7{
|
||||
flex:0 0 58.3333333333%;
|
||||
max-width:58.3333333333%;
|
||||
flex:0 0 58.33333333%;
|
||||
max-width:58.33333333%;
|
||||
}
|
||||
|
||||
.col-8{
|
||||
flex:0 0 66.6666666667%;
|
||||
max-width:66.6666666667%;
|
||||
flex:0 0 66.66666667%;
|
||||
max-width:66.66666667%;
|
||||
}
|
||||
|
||||
.col-9{
|
||||
|
|
@ -678,13 +678,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-10{
|
||||
flex:0 0 83.3333333333%;
|
||||
max-width:83.3333333333%;
|
||||
flex:0 0 83.33333333%;
|
||||
max-width:83.33333333%;
|
||||
}
|
||||
|
||||
.col-11{
|
||||
flex:0 0 91.6666666667%;
|
||||
max-width:91.6666666667%;
|
||||
flex:0 0 91.66666667%;
|
||||
max-width:91.66666667%;
|
||||
}
|
||||
|
||||
.col-12{
|
||||
|
|
@ -753,11 +753,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-1{
|
||||
margin-left:8.3333333333%;
|
||||
margin-left:8.33333333%;
|
||||
}
|
||||
|
||||
.offset-2{
|
||||
margin-left:16.6666666667%;
|
||||
margin-left:16.66666667%;
|
||||
}
|
||||
|
||||
.offset-3{
|
||||
|
|
@ -765,11 +765,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-4{
|
||||
margin-left:33.3333333333%;
|
||||
margin-left:33.33333333%;
|
||||
}
|
||||
|
||||
.offset-5{
|
||||
margin-left:41.6666666667%;
|
||||
margin-left:41.66666667%;
|
||||
}
|
||||
|
||||
.offset-6{
|
||||
|
|
@ -777,11 +777,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-7{
|
||||
margin-left:58.3333333333%;
|
||||
margin-left:58.33333333%;
|
||||
}
|
||||
|
||||
.offset-8{
|
||||
margin-left:66.6666666667%;
|
||||
margin-left:66.66666667%;
|
||||
}
|
||||
|
||||
.offset-9{
|
||||
|
|
@ -789,11 +789,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-10{
|
||||
margin-left:83.3333333333%;
|
||||
margin-left:83.33333333%;
|
||||
}
|
||||
|
||||
.offset-11{
|
||||
margin-left:91.6666666667%;
|
||||
margin-left:91.66666667%;
|
||||
}
|
||||
|
||||
@media (min-width: 576px){
|
||||
|
|
@ -840,13 +840,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-sm-1{
|
||||
flex:0 0 8.3333333333%;
|
||||
max-width:8.3333333333%;
|
||||
flex:0 0 8.33333333%;
|
||||
max-width:8.33333333%;
|
||||
}
|
||||
|
||||
.col-sm-2{
|
||||
flex:0 0 16.6666666667%;
|
||||
max-width:16.6666666667%;
|
||||
flex:0 0 16.66666667%;
|
||||
max-width:16.66666667%;
|
||||
}
|
||||
|
||||
.col-sm-3{
|
||||
|
|
@ -855,13 +855,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-sm-4{
|
||||
flex:0 0 33.3333333333%;
|
||||
max-width:33.3333333333%;
|
||||
flex:0 0 33.33333333%;
|
||||
max-width:33.33333333%;
|
||||
}
|
||||
|
||||
.col-sm-5{
|
||||
flex:0 0 41.6666666667%;
|
||||
max-width:41.6666666667%;
|
||||
flex:0 0 41.66666667%;
|
||||
max-width:41.66666667%;
|
||||
}
|
||||
|
||||
.col-sm-6{
|
||||
|
|
@ -870,13 +870,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-sm-7{
|
||||
flex:0 0 58.3333333333%;
|
||||
max-width:58.3333333333%;
|
||||
flex:0 0 58.33333333%;
|
||||
max-width:58.33333333%;
|
||||
}
|
||||
|
||||
.col-sm-8{
|
||||
flex:0 0 66.6666666667%;
|
||||
max-width:66.6666666667%;
|
||||
flex:0 0 66.66666667%;
|
||||
max-width:66.66666667%;
|
||||
}
|
||||
|
||||
.col-sm-9{
|
||||
|
|
@ -885,13 +885,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-sm-10{
|
||||
flex:0 0 83.3333333333%;
|
||||
max-width:83.3333333333%;
|
||||
flex:0 0 83.33333333%;
|
||||
max-width:83.33333333%;
|
||||
}
|
||||
|
||||
.col-sm-11{
|
||||
flex:0 0 91.6666666667%;
|
||||
max-width:91.6666666667%;
|
||||
flex:0 0 91.66666667%;
|
||||
max-width:91.66666667%;
|
||||
}
|
||||
|
||||
.col-sm-12{
|
||||
|
|
@ -964,11 +964,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-sm-1{
|
||||
margin-left:8.3333333333%;
|
||||
margin-left:8.33333333%;
|
||||
}
|
||||
|
||||
.offset-sm-2{
|
||||
margin-left:16.6666666667%;
|
||||
margin-left:16.66666667%;
|
||||
}
|
||||
|
||||
.offset-sm-3{
|
||||
|
|
@ -976,11 +976,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-sm-4{
|
||||
margin-left:33.3333333333%;
|
||||
margin-left:33.33333333%;
|
||||
}
|
||||
|
||||
.offset-sm-5{
|
||||
margin-left:41.6666666667%;
|
||||
margin-left:41.66666667%;
|
||||
}
|
||||
|
||||
.offset-sm-6{
|
||||
|
|
@ -988,11 +988,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-sm-7{
|
||||
margin-left:58.3333333333%;
|
||||
margin-left:58.33333333%;
|
||||
}
|
||||
|
||||
.offset-sm-8{
|
||||
margin-left:66.6666666667%;
|
||||
margin-left:66.66666667%;
|
||||
}
|
||||
|
||||
.offset-sm-9{
|
||||
|
|
@ -1000,11 +1000,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-sm-10{
|
||||
margin-left:83.3333333333%;
|
||||
margin-left:83.33333333%;
|
||||
}
|
||||
|
||||
.offset-sm-11{
|
||||
margin-left:91.6666666667%;
|
||||
margin-left:91.66666667%;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px){
|
||||
|
|
@ -1051,13 +1051,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-md-1{
|
||||
flex:0 0 8.3333333333%;
|
||||
max-width:8.3333333333%;
|
||||
flex:0 0 8.33333333%;
|
||||
max-width:8.33333333%;
|
||||
}
|
||||
|
||||
.col-md-2{
|
||||
flex:0 0 16.6666666667%;
|
||||
max-width:16.6666666667%;
|
||||
flex:0 0 16.66666667%;
|
||||
max-width:16.66666667%;
|
||||
}
|
||||
|
||||
.col-md-3{
|
||||
|
|
@ -1066,13 +1066,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-md-4{
|
||||
flex:0 0 33.3333333333%;
|
||||
max-width:33.3333333333%;
|
||||
flex:0 0 33.33333333%;
|
||||
max-width:33.33333333%;
|
||||
}
|
||||
|
||||
.col-md-5{
|
||||
flex:0 0 41.6666666667%;
|
||||
max-width:41.6666666667%;
|
||||
flex:0 0 41.66666667%;
|
||||
max-width:41.66666667%;
|
||||
}
|
||||
|
||||
.col-md-6{
|
||||
|
|
@ -1081,13 +1081,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-md-7{
|
||||
flex:0 0 58.3333333333%;
|
||||
max-width:58.3333333333%;
|
||||
flex:0 0 58.33333333%;
|
||||
max-width:58.33333333%;
|
||||
}
|
||||
|
||||
.col-md-8{
|
||||
flex:0 0 66.6666666667%;
|
||||
max-width:66.6666666667%;
|
||||
flex:0 0 66.66666667%;
|
||||
max-width:66.66666667%;
|
||||
}
|
||||
|
||||
.col-md-9{
|
||||
|
|
@ -1096,13 +1096,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-md-10{
|
||||
flex:0 0 83.3333333333%;
|
||||
max-width:83.3333333333%;
|
||||
flex:0 0 83.33333333%;
|
||||
max-width:83.33333333%;
|
||||
}
|
||||
|
||||
.col-md-11{
|
||||
flex:0 0 91.6666666667%;
|
||||
max-width:91.6666666667%;
|
||||
flex:0 0 91.66666667%;
|
||||
max-width:91.66666667%;
|
||||
}
|
||||
|
||||
.col-md-12{
|
||||
|
|
@ -1175,11 +1175,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-md-1{
|
||||
margin-left:8.3333333333%;
|
||||
margin-left:8.33333333%;
|
||||
}
|
||||
|
||||
.offset-md-2{
|
||||
margin-left:16.6666666667%;
|
||||
margin-left:16.66666667%;
|
||||
}
|
||||
|
||||
.offset-md-3{
|
||||
|
|
@ -1187,11 +1187,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-md-4{
|
||||
margin-left:33.3333333333%;
|
||||
margin-left:33.33333333%;
|
||||
}
|
||||
|
||||
.offset-md-5{
|
||||
margin-left:41.6666666667%;
|
||||
margin-left:41.66666667%;
|
||||
}
|
||||
|
||||
.offset-md-6{
|
||||
|
|
@ -1199,11 +1199,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-md-7{
|
||||
margin-left:58.3333333333%;
|
||||
margin-left:58.33333333%;
|
||||
}
|
||||
|
||||
.offset-md-8{
|
||||
margin-left:66.6666666667%;
|
||||
margin-left:66.66666667%;
|
||||
}
|
||||
|
||||
.offset-md-9{
|
||||
|
|
@ -1211,11 +1211,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-md-10{
|
||||
margin-left:83.3333333333%;
|
||||
margin-left:83.33333333%;
|
||||
}
|
||||
|
||||
.offset-md-11{
|
||||
margin-left:91.6666666667%;
|
||||
margin-left:91.66666667%;
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px){
|
||||
|
|
@ -1262,13 +1262,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-lg-1{
|
||||
flex:0 0 8.3333333333%;
|
||||
max-width:8.3333333333%;
|
||||
flex:0 0 8.33333333%;
|
||||
max-width:8.33333333%;
|
||||
}
|
||||
|
||||
.col-lg-2{
|
||||
flex:0 0 16.6666666667%;
|
||||
max-width:16.6666666667%;
|
||||
flex:0 0 16.66666667%;
|
||||
max-width:16.66666667%;
|
||||
}
|
||||
|
||||
.col-lg-3{
|
||||
|
|
@ -1277,13 +1277,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-lg-4{
|
||||
flex:0 0 33.3333333333%;
|
||||
max-width:33.3333333333%;
|
||||
flex:0 0 33.33333333%;
|
||||
max-width:33.33333333%;
|
||||
}
|
||||
|
||||
.col-lg-5{
|
||||
flex:0 0 41.6666666667%;
|
||||
max-width:41.6666666667%;
|
||||
flex:0 0 41.66666667%;
|
||||
max-width:41.66666667%;
|
||||
}
|
||||
|
||||
.col-lg-6{
|
||||
|
|
@ -1292,13 +1292,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-lg-7{
|
||||
flex:0 0 58.3333333333%;
|
||||
max-width:58.3333333333%;
|
||||
flex:0 0 58.33333333%;
|
||||
max-width:58.33333333%;
|
||||
}
|
||||
|
||||
.col-lg-8{
|
||||
flex:0 0 66.6666666667%;
|
||||
max-width:66.6666666667%;
|
||||
flex:0 0 66.66666667%;
|
||||
max-width:66.66666667%;
|
||||
}
|
||||
|
||||
.col-lg-9{
|
||||
|
|
@ -1307,13 +1307,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-lg-10{
|
||||
flex:0 0 83.3333333333%;
|
||||
max-width:83.3333333333%;
|
||||
flex:0 0 83.33333333%;
|
||||
max-width:83.33333333%;
|
||||
}
|
||||
|
||||
.col-lg-11{
|
||||
flex:0 0 91.6666666667%;
|
||||
max-width:91.6666666667%;
|
||||
flex:0 0 91.66666667%;
|
||||
max-width:91.66666667%;
|
||||
}
|
||||
|
||||
.col-lg-12{
|
||||
|
|
@ -1386,11 +1386,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-lg-1{
|
||||
margin-left:8.3333333333%;
|
||||
margin-left:8.33333333%;
|
||||
}
|
||||
|
||||
.offset-lg-2{
|
||||
margin-left:16.6666666667%;
|
||||
margin-left:16.66666667%;
|
||||
}
|
||||
|
||||
.offset-lg-3{
|
||||
|
|
@ -1398,11 +1398,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-lg-4{
|
||||
margin-left:33.3333333333%;
|
||||
margin-left:33.33333333%;
|
||||
}
|
||||
|
||||
.offset-lg-5{
|
||||
margin-left:41.6666666667%;
|
||||
margin-left:41.66666667%;
|
||||
}
|
||||
|
||||
.offset-lg-6{
|
||||
|
|
@ -1410,11 +1410,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-lg-7{
|
||||
margin-left:58.3333333333%;
|
||||
margin-left:58.33333333%;
|
||||
}
|
||||
|
||||
.offset-lg-8{
|
||||
margin-left:66.6666666667%;
|
||||
margin-left:66.66666667%;
|
||||
}
|
||||
|
||||
.offset-lg-9{
|
||||
|
|
@ -1422,11 +1422,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-lg-10{
|
||||
margin-left:83.3333333333%;
|
||||
margin-left:83.33333333%;
|
||||
}
|
||||
|
||||
.offset-lg-11{
|
||||
margin-left:91.6666666667%;
|
||||
margin-left:91.66666667%;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px){
|
||||
|
|
@ -1473,13 +1473,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-xl-1{
|
||||
flex:0 0 8.3333333333%;
|
||||
max-width:8.3333333333%;
|
||||
flex:0 0 8.33333333%;
|
||||
max-width:8.33333333%;
|
||||
}
|
||||
|
||||
.col-xl-2{
|
||||
flex:0 0 16.6666666667%;
|
||||
max-width:16.6666666667%;
|
||||
flex:0 0 16.66666667%;
|
||||
max-width:16.66666667%;
|
||||
}
|
||||
|
||||
.col-xl-3{
|
||||
|
|
@ -1488,13 +1488,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-xl-4{
|
||||
flex:0 0 33.3333333333%;
|
||||
max-width:33.3333333333%;
|
||||
flex:0 0 33.33333333%;
|
||||
max-width:33.33333333%;
|
||||
}
|
||||
|
||||
.col-xl-5{
|
||||
flex:0 0 41.6666666667%;
|
||||
max-width:41.6666666667%;
|
||||
flex:0 0 41.66666667%;
|
||||
max-width:41.66666667%;
|
||||
}
|
||||
|
||||
.col-xl-6{
|
||||
|
|
@ -1503,13 +1503,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-xl-7{
|
||||
flex:0 0 58.3333333333%;
|
||||
max-width:58.3333333333%;
|
||||
flex:0 0 58.33333333%;
|
||||
max-width:58.33333333%;
|
||||
}
|
||||
|
||||
.col-xl-8{
|
||||
flex:0 0 66.6666666667%;
|
||||
max-width:66.6666666667%;
|
||||
flex:0 0 66.66666667%;
|
||||
max-width:66.66666667%;
|
||||
}
|
||||
|
||||
.col-xl-9{
|
||||
|
|
@ -1518,13 +1518,13 @@ pre code{
|
|||
}
|
||||
|
||||
.col-xl-10{
|
||||
flex:0 0 83.3333333333%;
|
||||
max-width:83.3333333333%;
|
||||
flex:0 0 83.33333333%;
|
||||
max-width:83.33333333%;
|
||||
}
|
||||
|
||||
.col-xl-11{
|
||||
flex:0 0 91.6666666667%;
|
||||
max-width:91.6666666667%;
|
||||
flex:0 0 91.66666667%;
|
||||
max-width:91.66666667%;
|
||||
}
|
||||
|
||||
.col-xl-12{
|
||||
|
|
@ -1597,11 +1597,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-xl-1{
|
||||
margin-left:8.3333333333%;
|
||||
margin-left:8.33333333%;
|
||||
}
|
||||
|
||||
.offset-xl-2{
|
||||
margin-left:16.6666666667%;
|
||||
margin-left:16.66666667%;
|
||||
}
|
||||
|
||||
.offset-xl-3{
|
||||
|
|
@ -1609,11 +1609,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-xl-4{
|
||||
margin-left:33.3333333333%;
|
||||
margin-left:33.33333333%;
|
||||
}
|
||||
|
||||
.offset-xl-5{
|
||||
margin-left:41.6666666667%;
|
||||
margin-left:41.66666667%;
|
||||
}
|
||||
|
||||
.offset-xl-6{
|
||||
|
|
@ -1621,11 +1621,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-xl-7{
|
||||
margin-left:58.3333333333%;
|
||||
margin-left:58.33333333%;
|
||||
}
|
||||
|
||||
.offset-xl-8{
|
||||
margin-left:66.6666666667%;
|
||||
margin-left:66.66666667%;
|
||||
}
|
||||
|
||||
.offset-xl-9{
|
||||
|
|
@ -1633,11 +1633,11 @@ pre code{
|
|||
}
|
||||
|
||||
.offset-xl-10{
|
||||
margin-left:83.3333333333%;
|
||||
margin-left:83.33333333%;
|
||||
}
|
||||
|
||||
.offset-xl-11{
|
||||
margin-left:91.6666666667%;
|
||||
margin-left:91.66666667%;
|
||||
}
|
||||
}
|
||||
.table{
|
||||
|
|
@ -1975,10 +1975,6 @@ pre code{
|
|||
background-color:transparent;
|
||||
border:0;
|
||||
}
|
||||
.form-control:-moz-focusring{
|
||||
color:transparent;
|
||||
text-shadow:0 0 0 #495057;
|
||||
}
|
||||
.form-control:focus{
|
||||
color:#495057;
|
||||
background-color:#fff;
|
||||
|
|
@ -2012,6 +2008,10 @@ input[type=month].form-control{
|
|||
appearance:none;
|
||||
}
|
||||
|
||||
select.form-control:-moz-focusring{
|
||||
color:transparent;
|
||||
text-shadow:0 0 0 #495057;
|
||||
}
|
||||
select.form-control:focus::-ms-value{
|
||||
color:#495057;
|
||||
background-color:#fff;
|
||||
|
|
@ -2175,7 +2175,7 @@ textarea.form-control{
|
|||
|
||||
.was-validated .form-control:valid, .form-control.is-valid{
|
||||
border-color:#38c172;
|
||||
padding-right:calc(1.6em + 0.75rem);
|
||||
padding-right:calc(1.6em + 0.75rem) !important;
|
||||
background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2338c172' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
|
||||
background-repeat:no-repeat;
|
||||
background-position:right calc(0.4em + 0.1875rem) center;
|
||||
|
|
@ -2186,6 +2186,11 @@ textarea.form-control{
|
|||
box-shadow:0 0 0 0.2rem rgba(56, 193, 114, 0.25);
|
||||
}
|
||||
|
||||
.was-validated select.form-control:valid, select.form-control.is-valid{
|
||||
padding-right:3rem !important;
|
||||
background-position:right 1.5rem center;
|
||||
}
|
||||
|
||||
.was-validated textarea.form-control:valid, textarea.form-control.is-valid{
|
||||
padding-right:calc(1.6em + 0.75rem);
|
||||
background-position:top calc(0.4em + 0.1875rem) right calc(0.4em + 0.1875rem);
|
||||
|
|
@ -2193,7 +2198,7 @@ textarea.form-control{
|
|||
|
||||
.was-validated .custom-select:valid, .custom-select.is-valid{
|
||||
border-color:#38c172;
|
||||
padding-right:calc(0.75em + 2.3125rem);
|
||||
padding-right:calc(0.75em + 2.3125rem) !important;
|
||||
background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right 0.75rem center/8px 10px no-repeat, #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2338c172' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") center right 1.75rem/calc(0.8em + 0.375rem) calc(0.8em + 0.375rem) no-repeat;
|
||||
}
|
||||
.was-validated .custom-select:valid:focus, .custom-select.is-valid:focus{
|
||||
|
|
@ -2271,7 +2276,7 @@ textarea.form-control{
|
|||
|
||||
.was-validated .form-control:invalid, .form-control.is-invalid{
|
||||
border-color:#e3342f;
|
||||
padding-right:calc(1.6em + 0.75rem);
|
||||
padding-right:calc(1.6em + 0.75rem) !important;
|
||||
background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23e3342f' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23e3342f' stroke='none'/%3e%3c/svg%3e");
|
||||
background-repeat:no-repeat;
|
||||
background-position:right calc(0.4em + 0.1875rem) center;
|
||||
|
|
@ -2282,6 +2287,11 @@ textarea.form-control{
|
|||
box-shadow:0 0 0 0.2rem rgba(227, 52, 47, 0.25);
|
||||
}
|
||||
|
||||
.was-validated select.form-control:invalid, select.form-control.is-invalid{
|
||||
padding-right:3rem !important;
|
||||
background-position:right 1.5rem center;
|
||||
}
|
||||
|
||||
.was-validated textarea.form-control:invalid, textarea.form-control.is-invalid{
|
||||
padding-right:calc(1.6em + 0.75rem);
|
||||
background-position:top calc(0.4em + 0.1875rem) right calc(0.4em + 0.1875rem);
|
||||
|
|
@ -2289,7 +2299,7 @@ textarea.form-control{
|
|||
|
||||
.was-validated .custom-select:invalid, .custom-select.is-invalid{
|
||||
border-color:#e3342f;
|
||||
padding-right:calc(0.75em + 2.3125rem);
|
||||
padding-right:calc(0.75em + 2.3125rem) !important;
|
||||
background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right 0.75rem center/8px 10px no-repeat, #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23e3342f' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23e3342f' stroke='none'/%3e%3c/svg%3e") center right 1.75rem/calc(0.8em + 0.375rem) calc(0.8em + 0.375rem) no-repeat;
|
||||
}
|
||||
.was-validated .custom-select:invalid:focus, .custom-select.is-invalid:focus{
|
||||
|
|
@ -3328,18 +3338,24 @@ input[type=button].btn-block{
|
|||
display:flex;
|
||||
align-items:center;
|
||||
}
|
||||
.input-group > .custom-file:not(:last-child) .custom-file-label, .input-group > .custom-file:not(:first-child) .custom-file-label{
|
||||
.input-group > .custom-file:not(:last-child) .custom-file-label, .input-group > .custom-file:not(:last-child) .custom-file-label::after{
|
||||
border-top-right-radius:0;
|
||||
border-bottom-right-radius:0;
|
||||
}
|
||||
.input-group > .custom-file:not(:first-child) .custom-file-label{
|
||||
border-top-left-radius:0;
|
||||
border-bottom-left-radius:0;
|
||||
}
|
||||
.input-group:not(.has-validation) > .form-control:not(:last-child),
|
||||
.input-group:not(.has-validation) > .custom-select:not(:last-child),
|
||||
.input-group:not(.has-validation) > .custom-file:not(:last-child) .custom-file-label,
|
||||
.input-group:not(.has-validation) > .custom-file:not(:last-child) .custom-file-label::after{
|
||||
border-top-right-radius:0;
|
||||
border-bottom-right-radius:0;
|
||||
}
|
||||
.input-group.has-validation > .form-control:nth-last-child(n+3),
|
||||
.input-group.has-validation > .custom-select:nth-last-child(n+3),
|
||||
.input-group.has-validation > .custom-file:nth-last-child(n+3) .custom-file-label,
|
||||
.input-group.has-validation > .custom-file:nth-last-child(n+3) .custom-file-label::after{
|
||||
border-top-right-radius:0;
|
||||
border-bottom-right-radius:0;
|
||||
|
|
@ -5904,8 +5920,11 @@ a.close.disabled{
|
|||
align-items:center;
|
||||
justify-content:center;
|
||||
width:15%;
|
||||
padding:0;
|
||||
color:#fff;
|
||||
text-align:center;
|
||||
background:none;
|
||||
border:0;
|
||||
opacity:0.5;
|
||||
transition:opacity 0.15s ease;
|
||||
}
|
||||
|
|
@ -6013,7 +6032,7 @@ a.close.disabled{
|
|||
display:inline-block;
|
||||
width:2rem;
|
||||
height:2rem;
|
||||
vertical-align:text-bottom;
|
||||
vertical-align:-0.125em;
|
||||
border:0.25em solid currentColor;
|
||||
border-right-color:transparent;
|
||||
border-radius:50%;
|
||||
|
|
@ -6050,7 +6069,7 @@ a.close.disabled{
|
|||
display:inline-block;
|
||||
width:2rem;
|
||||
height:2rem;
|
||||
vertical-align:text-bottom;
|
||||
vertical-align:-0.125em;
|
||||
background-color:currentColor;
|
||||
border-radius:50%;
|
||||
opacity:0;
|
||||
|
|
@ -6555,7 +6574,7 @@ button.bg-dark:focus{
|
|||
}
|
||||
|
||||
.embed-responsive-21by9::before{
|
||||
padding-top:42.8571428571%;
|
||||
padding-top:42.85714286%;
|
||||
}
|
||||
|
||||
.embed-responsive-16by9::before{
|
||||
|
|
@ -7363,6 +7382,7 @@ button.bg-dark:focus{
|
|||
}
|
||||
|
||||
.position-sticky{
|
||||
position:-webkit-sticky !important;
|
||||
position:sticky !important;
|
||||
}
|
||||
|
||||
|
|
@ -7382,8 +7402,9 @@ button.bg-dark:focus{
|
|||
z-index:1030;
|
||||
}
|
||||
|
||||
@supports (position: sticky){
|
||||
@supports ((position: -webkit-sticky) or (position: sticky)){
|
||||
.sticky-top{
|
||||
position:-webkit-sticky;
|
||||
position:sticky;
|
||||
top:0;
|
||||
z-index:1020;
|
||||
|
|
@ -9928,10 +9949,6 @@ blockquote{
|
|||
page-break-inside:avoid;
|
||||
}
|
||||
|
||||
thead{
|
||||
display:table-header-group;
|
||||
}
|
||||
|
||||
tr,
|
||||
img{
|
||||
page-break-inside:avoid;
|
||||
|
|
@ -10451,7 +10468,7 @@ body.compensate-for-scrollbar{
|
|||
z-index:99996;
|
||||
}
|
||||
|
||||
@supports (padding: max(0px)){
|
||||
@supports (padding: 0px){
|
||||
.fancybox-caption{
|
||||
padding:75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));
|
||||
}
|
||||
|
|
@ -10615,7 +10632,7 @@ body.compensate-for-scrollbar{
|
|||
padding-right:12px;
|
||||
}
|
||||
|
||||
@supports (padding: max(0px)){
|
||||
@supports (padding: 0px){
|
||||
.fancybox-caption{
|
||||
padding-left:max(12px, env(safe-area-inset-left));
|
||||
padding-right:max(12px, env(safe-area-inset-right));
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue