Commit e4268b43 authored by cyprien's avatar cyprien
Browse files
parents f0b87488 ebf83120
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ class AdherentController extends Controller
    static function index($ds_code, $pre_code): View
    {

        $adherents = User::selectRaw('US_FIRST_NAME,US_NAME,US_LICENCE_ID, CAR_USER.US_ID, PRE_MAX_DEPTH')
        $adherents = User::selectRaw('US_FIRST_NAME,US_NAME,US_LICENCE_ID, CAR_USER.US_ID, PRE_MAX_DEPTH, CAR_USER.PRE_CODE')
        ->join('CAR_PREROGATIVE','CAR_PREROGATIVE.PRE_CODE','=','CAR_USER.PRE_CODE')
        ->where('PRE_MAX_DEPTH', '>=', AdherentController::getMaxDepthByPrerogativeCode($pre_code))
        ->get();
+4 −1
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ static function modificationMembers(string $ds_code){
            'US_NAME' => $pilote_temp[0]['US_NAME'],
            'US_LICENCE_ID' => $pilote_temp[0]['US_LICENCE_ID'],
            'US_ID' => $pilote_temp[0]['US_ID'],
            'PRE_CODE' => '',
            'ROL_LABEL' => "Pilote"
        ];

@@ -94,6 +95,7 @@ static function modificationMembers(string $ds_code){
            'US_NAME' => $securite_temp[0]['US_NAME'],
            'US_LICENCE_ID' => $securite_temp[0]['US_LICENCE_ID'],
            'US_ID' => $securite_temp[0]['US_ID'],
            'PRE_CODE' => '',
            'ROL_LABEL' => "Sécurité de surface"
        ];

@@ -107,10 +109,11 @@ static function modificationMembers(string $ds_code){
            'US_NAME' => $directeur_temp[0]['US_NAME'],
            'US_LICENCE_ID' => $directeur_temp[0]['US_LICENCE_ID'],
            'US_ID' => $directeur_temp[0]['US_ID'],
            'PRE_CODE' => '',
            'ROL_LABEL' => "Directeur"
        ];

        $plongeurs = User::selectRaw('US_FIRST_NAME,US_NAME,US_LICENCE_ID, ROL_LABEL, CAR_USER.US_ID')
        $plongeurs = User::selectRaw('US_FIRST_NAME,US_NAME,US_LICENCE_ID, ROL_LABEL, CAR_USER.US_ID, CAR_USER.PRE_CODE')
        ->join('CAR_PREROGATIVE','CAR_PREROGATIVE.PRE_CODE','=','CAR_USER.PRE_CODE')
        ->join('CAR_ROLE_ATTRIBUTION','CAR_USER.US_ID','=','CAR_ROLE_ATTRIBUTION.US_ID')
        ->join('CAR_ROLE','CAR_ROLE_ATTRIBUTION.ROL_CODE','=','CAR_ROLE.ROL_CODE')
+22 −6
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@ function validateAllCombination() {
        );

        // console.log(zoneElement);
        if (zoneElement == null) return;
        if (zoneElement.hasChildNodes()) {
            if (
                zoneElement.childElementCount < 2 ||
@@ -386,6 +387,7 @@ function validateAllCombination() {
                zoneElement.style.backgroundColor = "rgb(254 202 202)";
                console.log("taille");
                valid = false;
                return;
            }
            zoneElement.childNodes.forEach((elementB) => {
                if (
@@ -395,6 +397,7 @@ function validateAllCombination() {
                    zoneElement.style.backgroundColor = "rgb(254 202 202)";
                    console.log("PB");
                    valid = false;
                    return;
                }
            });
            let children = zoneElement.childNodes;
@@ -403,9 +406,16 @@ function validateAllCombination() {
                    counterCheck++;
                    zoneElement.style.backgroundColor = "rgb(229 231 235)";
                    valid = true;
                    return;
                }
            }
            for (let i = 0; i < children.length; i++) {
                if (children[i].id.split(",")[1] === "PB" && children.length > 2) {
                    zoneElement.style.backgroundColor = "rgb(254 202 202)";
                    console.log("PB");
                    valid = false;
                    return;
                }
                let targetItemsSplit = children[i].id.split(",")[2];
                for (targetItemsSplit in validatePalanqueCombinate) {
                    for (let j = 0; j < children.length; j++) {
@@ -419,11 +429,13 @@ function validateAllCombination() {
                            zoneElement.style.backgroundColor =
                                "rgb(229 231 235)";
                            valid = true;
                            return;
                        }
                    }
                    zoneElement.style.backgroundColor = "rgb(254 202 202)";
                    console.log("combi ", targetItemsSplit);
                    valid = false;
                    return;
                }
            }

@@ -431,24 +443,28 @@ function validateAllCombination() {
            zoneElement.style.backgroundColor = "rgb(229 231 235)";
            console.log("vide");
            valid = false;
            return;
        }
    });
    if (zoneStart.childElementCount == 0 && valid == true) {
        disableVal = false;
    } else {
        disableVal = true;
    }
}

let interval = setInterval(function () {
    updateZoneList();
    validateAllCombination();
    console.log(disableVal);
    disableVal = false;
    document.querySelectorAll("#DropZone > div > div").forEach((element) => {
        if (element.style.backgroundColor === "rgb(254, 202, 202)" || zoneStart.childElementCount > 0) {
            disableVal = true;
            return;
        }
    });
}, 250);

validatePalanque.addEventListener("click", function () {
    if (!disableVal) {
        sendPalanque();
        clearInterval(interval);
        // clearInterval(interval);
    }
});

+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
                <th scope="col" class="px-6 py-4">Prénom</th>
                <th scope="col" class="px-6 py-4">Nom</th>
                <th scope="col" class="px-6 py-4">Rôle</th>
                <th scope="col" class="px-6 py-4">Prérogative</th>
            </tr>
            </thead>
            <tbody>
@@ -20,6 +21,7 @@
                    <td class="px-6 py-4">{{ $person['US_NAME'] }}</td>
                    <td class="px-6 py-4">{{ $person['US_FIRST_NAME'] }}</td>
                    <td class="px-6 py-4">{{$person['ROL_LABEL']}}</td>
                    <td class="px-6 py-4">{{$person['PRE_CODE']}}</td>


                    @if($person['ROL_LABEL'] == 'Plongeur')