This commit is contained in:
Jérémy Munsch 2022-06-08 15:27:21 +02:00
parent e031475ad9
commit 939ecf85a6
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
127 changed files with 672 additions and 710 deletions

View file

@ -1,31 +0,0 @@
<?php
namespace App\Http\Controllers\Fo;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\TraceaEgg;
use Carbon\Carbon;
class AjaxController extends Controller
{
public function findMyBox(Request $request)
{
$code = $request->code;
$date = explode('/', $request->date);
$day = $date[0];
$month = $date[1];
$dateCarbon = Carbon::createFromDate(null, $month, $day)->toArray();
$year = $dateCarbon['year'];
$dcr = $year . '-' . $month . '-' . $day;
$moba = TraceaEgg::where(['code_ede' => $code, 'dcr' => $dcr])->orderBy('id', 'DESC')->first();
if (!$moba) {
return redirect()->route('erreur404');
}
return redirect()->route('FrontPage', ['id' => $moba->code_boite]);
}
}

View file

@ -4,24 +4,44 @@ namespace App\Http\Controllers\Fo;
use App\Http\Controllers\Controller;
use App\Models\CafelEggBreeder;
use App\Models\Aliment;
use App\Models\CafelEggMiseEnPlace;
use App\Models\CafelFood;
use Illuminate\Http\Request;
use App\Models\TraceaEgg;
use App\Models\VisuelLibelle;
use Carbon\Carbon;
class FrontController extends Controller
class EggController extends Controller
{
public function findMyBox(Request $request)
{
$code = $request->code;
$date = explode('/', $request->date);
$day = $date[0];
$month = $date[1];
$moba = TraceaEgg::where('ede_code', '=', $code)
->whereDate('dcr', Carbon::createFromDate(null, $month, $day)->toDate())
->orderBy('box_code', 'DESC')->first();
if (!$moba) {
return view('front.egg.notFound');
}
return redirect()->route('egg.FrontPage', ['id' => $moba->box_code]);
}
public function indexId($id)
{
$multiple = false;
$mobas = TraceaEgg::where('code_boite', $id)->orderBy('id', 'DESC')->first();
/** @var \App\Models\TraceaEgg|null */
$mobas = TraceaEgg::where('box_code', $id)->orderBy('box_code', 'DESC')->first();
if (!$mobas) {
return redirect('/search');
}
$edes = $mobas->code_edes;
$edes = $mobas->ede_code;
// * check if Bio or not
$code_ede = $mobas->code_ede;
@ -33,17 +53,16 @@ class FrontController extends Controller
session(['subColor' => 'blue']);
}
$datePonte = $mobas->date_de_ponte;
$dcr = $mobas->dcr;
$datePonte = $mobas->laying_date;
$date_emballage = $mobas->date_emballage;
// * Compare DCR et Today
$date_dcr = Carbon::createFromFormat('Y-m-d', $dcr);
$date_dcr = $mobas->dcr;
$date_today = Carbon::now();
$dcrGood = $date_today < $date_dcr;
$eleveurs = CafelEggBreeder::whereIn('code_ede', $edes)->get();
if (!$eleveurs) {
return redirect()->route('erreur404');
$eleveurs = CafelEggBreeder::whereEdeCode($edes)->get();
if (!$eleveurs->count()) {
return view('front.egg.notFound');
}
$uniqueEleveurs = $eleveurs->unique('code_ede');
@ -51,22 +70,25 @@ class FrontController extends Controller
$multiple = true;
}
$elevId = $eleveurs->pluck('id');
$inuavs = $eleveurs->pluck('inuavs')->flatten(1);
$mep = CafelEggMiseEnPlace::whereIn('inuav_code', $inuavs)
->where('transfert_date', '<', $datePonte)
->orderBy('transfert_date', 'DESC')->first();
$mep = CafelEggMiseEnPlace::whereIn('eleveur_id', $elevId)->where('date_transfert_poulettes', '<', $datePonte)->orderBy('id', 'DESC')->first();
if ($mep) {
$aliment = Aliment::where('code_lot', $mep->code_lot_pondeuse)->orderBy('id', 'DESC')->first();
$aliment = CafelFood::where('batch_code', $mep->batch_code)->orderBy('delivery_date', 'DESC')->first();
} else {
$mep = '';
$aliment = "";
}
$dataVisuel = VisuelLibelle::where('ean_13', $mobas->ean_13)->first();
return view('themes.loue.index_id', [
return view('front.egg.index_id', [
'id' => $id,
'multiple' => $multiple,
'datePonte' => $datePonte,
'dcr' => $dcr,
'dcr' => $date_dcr,
'dcrGood' => $dcrGood,
'eleveurs' => $eleveurs,
'mep' => $mep,
@ -81,7 +103,7 @@ class FrontController extends Controller
$dateToday = Carbon::now()->toArray();
$currentYear = $dateToday['year'];
$eleveur = CafelEggBreeder::where('id', $eleveurId)->first();
$eleveur = CafelEggBreeder::where('cafel_code', $eleveurId)->first();
if (isset($eleveur->naissance) && !empty($eleveur->naissance)) {
$date_naissance = Carbon::createFromFormat('d/m/Y', $eleveur->naissance)->toArray();
@ -128,6 +150,9 @@ class FrontController extends Controller
array_push($questions, array('Si je te dis Loué, ça te fait penser à quoi ?', $eleveur->loue_means));
}
return view('themes.loue.elevages.portrait', ['id' => $id, 'eleveur' => $eleveur, 'age' => $age, 'ageElevage' => $age_elevage, 'questions' => $questions]);
return view('front.egg.elevages.portrait', [
'id' => $id, 'eleveur' => $eleveur, 'age' => $age,
'ageElevage' => $age_elevage, 'questions' => $questions
]);
}
}

View file

@ -2,8 +2,8 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
class TraceaEgg extends Model
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View file

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View file

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 172 KiB

View file

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 172 KiB

View file

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View file

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View file

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View file

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View file

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View file

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 155 KiB

View file

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View file

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View file

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View file

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View file

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View file

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View file

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View file

Before

Width:  |  Height:  |  Size: 310 KiB

After

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -4,10 +4,10 @@
// Variables
@import 'variables';
// Bootstrap
@import '~bootstrap/scss/bootstrap';
body {
min-height: 100vh;

View file

@ -1,7 +1,7 @@
body {
background: url('~@/images/utilise/layout/body_bg.jpg');
font-family: 'Myriad Pro';
--bs-body-font-family: 'Myriad Pro';
& > header {
& > img {
@ -17,6 +17,11 @@ body {
box-shadow: -0.5rem 0px 0.4rem -0.4rem transparentize($color: $black, $amount: 0.6) inset, 0.5rem 0px 0.4rem -0.4rem transparentize($color: $black, $amount: 0.6) inset;
font-size: 1.2rem;
&.oldEgg {
background-color:inherit;
box-shadow:inherit;
}
& > .header {
background-image: url('~@/images/utilise/layout/header_matter_effet.png');
background-repeat: no-repeat;
@ -66,6 +71,9 @@ body {
.text-arial {
font-family: Arial, Helvetica, sans-serif !important;
}
.text-serif {
font-family: Georgia, serif !important;
}
.bg-loue-gray {
background-color: $greyBG !important;

View file

@ -60,12 +60,34 @@
font-style: normal;
font-display: swap;
}
// * To Refactor with f*** egg part
@font-face {
font-family: 'Albertsthal Typewriter';
src: url('~@/fonts/AlbertsthalTypewriter.woff2') format('woff2'),
url('~@/fonts/AlbertsthalTypewriter.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
font-family: 'MyriadProBlack';
src: url('~@/fonts/MyriadPro-Black.woff2') format('woff2'),
url('~@/fonts/MyriadPro-Black.woff') format('woff');
}
@font-face {
font-family: 'MyriadProBold';
src: url('~@/fonts/MyriadPro-Bold.woff2') format('woff2'),
url('~@/fonts/MyriadPro-Bold.woff') format('woff');
font-display: swap;
}
@font-face {
font-family: 'MyriadProBoldIt';
src: url('~@/fonts/MyriadPro-BoldIt.woff2') format('woff2'),
url('~@/fonts/MyriadPro-BoldIt.woff') format('woff');
font-display: swap;
}
@font-face {
font-family: 'MyriadProSemiBoldIt';
src: url('~@/fonts/MyriadPro-SemiboldIt.woff2') format('woff2'),
url('~@/fonts/MyriadPro-SemiboldIt.woff') format('woff');
}
@font-face {
font-family: 'MyriadProItalic';
src: url('~@/fonts/MyriadPro-It.woff2') format('woff2'),
url('~@/fonts/MyriadPro-It.woff') format('woff');
}

Some files were not shown because too many files have changed in this diff Show more