Commit 1322f5fe authored by Andgel Brissaud's avatar Andgel Brissaud
Browse files

Merge branch 'master' into password-changer

parents 86556269 aa59b41c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ public function register()
    {
        $this->renderable(function(QueryException $queryException, Request $request){
            if ($queryException->getCode()==45000)
            return response()->view('erreur-page',['message'=>$queryException->getMessage()]);
            return response()->view('error-page',['message'=>$queryException->getMessage()]);
        });
        $this->reportable(function (Throwable $e) {
            //
+17 −5
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
use App\Models\User;
use App\Models\DivingSession;
use App\Models\Registration;
use App\Models\Prerogative;
use App\Http\Controllers\ModificationDives;
use Illuminate\View\View;

@@ -12,14 +13,15 @@

class AdherentController extends Controller
{
    static function index($ds_code, $level): View
    static function index($ds_code, $pre_code): View
    {

        $adherents = User::selectRaw('US_FIRST_NAME,US_NAME,US_LICENCE_ID, CAR_USER.US_ID')
        $adherents = User::selectRaw('US_FIRST_NAME,US_NAME,US_LICENCE_ID, CAR_USER.US_ID, PRE_MAX_DEPTH')
        ->join('CAR_PREROGATIVE','CAR_PREROGATIVE.PRE_CODE','=','CAR_USER.PRE_CODE')
        ->where('CAR_PREROGATIVE.PRE_LEVEl','>=',$level)
        ->where('PRE_MAX_DEPTH', '>=', AdherentController::getMaxDepthByPrerogativeCode($pre_code))
        ->get();


        $sessionplongee = DivingSession::selectRaw('CAR_DIVING_SESSION.DS_CODE, CAR_DIVING_SESSION.DS_DATE, CAR_DIVING_LOCATION.DL_NAME, CAR_DIVING_SESSION.CAR_SCHEDULE, CAR_DIVING_SESSION.DS_LEVEL')
        ->join('CAR_DIVING_LOCATION', 'CAR_DIVING_SESSION.DL_ID', '=', 'CAR_DIVING_LOCATION.DL_ID')
        ->where('ds_code', '=', $ds_code)
@@ -32,7 +34,15 @@ static function index($ds_code, $level): View
        ]);    
    }

    static function getMaxDepthByPrerogativeCode(string $pre_code)
    {
        $query = Prerogative::selectRaw('PRE_MAX_DEPTH')
        ->where('PRE_CODE', '=', $pre_code)
        ->get();

        return $query[0]['PRE_MAX_DEPTH'];

    }



@@ -51,12 +61,14 @@ static function addUserToDive($ds_code, $us_id): View



    static function searchByName($ds_code, $level, Request $request){
    static function searchByName($ds_code, $pre_code, Request $request){

        $nom = $request['nom'];
        $prenom = $request['prenom'];

        $request = User::selectRaw('US_FIRST_NAME,US_NAME,US_LICENCE_ID, CAR_USER.US_ID')
        $request = User::selectRaw('US_FIRST_NAME,US_NAME,US_LICENCE_ID, CAR_USER.US_ID, PRE_MAX_DEPTH')
        ->join('CAR_PREROGATIVE','CAR_PREROGATIVE.PRE_CODE','=','CAR_USER.PRE_CODE')
        ->where('PRE_MAX_DEPTH', '>=', AdherentController::getMaxDepthByPrerogativeCode($pre_code))
        ->where('US_NAME', 'LIKE', "%".$nom."%")
        ->where('US_FIRST_NAME', 'LIKE', "%".$prenom."%")
        ->get();
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@ public function login(Request $request)

        $user = User::where('US_EMAIL', $request->mail)->first();

        /*if ($user == null || !$user->checkPassword(hash("sha256",$request->password))) {
            return view('login', ['wrongPassword' => true]);
        }*/

        if ($user == null || !$user->checkPassword($request->password)) {
            return view('login', ['wrongPassword' => true]);
        }
+16 −0
Original line number Diff line number Diff line
<?php

namespace App\Http\Controllers\DataController;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Boat;

class DataBoatController extends Controller
{
    public static function fetch()
    {
        $boatData = Boat::all();
        return $boatData;
    }
}
+16 −0
Original line number Diff line number Diff line
<?php

namespace App\Http\Controllers\DataController;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\DivingGroup;

class DataDivingGroupController extends Controller
{
    public static function fetch()
    {
        $divingGroupData = DivingGroup::all();
        return $divingGroupData;
    }
}
Loading