Commit 32a4dd1f authored by Julien Sailly's avatar Julien Sailly
Browse files

fix: getParticipants issue

parent dccf97db
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -22,13 +22,11 @@ class DivingSession extends Model
    public function getParticipants(): array{
        $registrations = DB::table('CAR_REGISTRATION')->where('DS_CODE', $this->DS_CODE)->get();
        $participants = [];

        foreach($registrations as $registration){
            if($registration->REG_ACTIVE === 1){
                $participants[] = User::find($registration->US_ID)->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID')->where('CAR_REGISTRATION.DS_CODE', $this->DS_CODE)->first();
                $participants[] = User::find($registration->US_ID);
            }
        }

        return $participants;
    }

+12 −7
Original line number Diff line number Diff line
@@ -6,14 +6,14 @@ .container {
  }

  .change-my-color {
    fill: #575757;
    fill: #9b9b9b;
  }

  .button {
    gap: 1.5rem;
    height: 65px;
    background: #e5e5e5;
    border: #a8a8a8 solid 1px;
    background: #f9fafb;
    border: #dcdcdc solid 1px;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
@@ -28,7 +28,7 @@ .container {
  .nav {
    opacity: 1;
    transition: all 0.5s ease-in-out;
      background: #e5e5e5;
    background: #f9fafb;
    width: 100%;
    border-radius: 5px;
    padding: 10px;
@@ -44,10 +44,10 @@ .container {
      }

      input:hover {
          background-color: #bdbdbd;
          background-color: #e0e0e0;
      }

    li {
    .nav.li {
      opacity: 0;
      list-style: none;
      &:nth-child(1) {
@@ -66,6 +66,11 @@ .container {
            transform-origin: bottom;
            animation: itop 300ms 600ms linear forwards;
        }
        &:nth-child(5) {
            transform-origin: bottom;
            animation: itop 300ms 700ms linear forwards;
            background-color: transparent;
        }
    }
    li {
        flex: 1;
@@ -81,7 +86,7 @@ .container {
      margin: 0 10px 0 0;

      &:hover {
        background: #bdbdbd;
        background: #e0e0e0;
      }
    }
  }
+9 −1
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
                <label class="button" for="toggle">
                    <svg class="change-my-color" xmlns="http://www.w3.org/2000/svg" height="19" width="19" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M3.9 54.9C10.5 40.9 24.5 32 40 32H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9V448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6V320.9L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"/></svg>
                <div class="nav">
                    <form action="{{ route('dives_filter') }}" method="POST">
                        <!-- @csrf -->
                    <ul>
                        <li>
                            <label for="underline_select" class="sr-only">Choisir un lieux</label>
@@ -40,7 +42,7 @@
                            <label class="hidden" for="start">Date de départ</label>
                            <input type="date" name="date-dive" />
                        </li>
                        <li>
                        <!--<li>
                            <label class="hidden" for="participant_filter">Participant</label>
                            <select id="participant_filter" class="block py-2.5 px-0 w-full text-sm text-gray-500 bg-transparent appearance-none focus:outline-none focus:ring-0 focus:border-orange-600 peer">
                                <option selected>Niveau</option>
@@ -48,8 +50,14 @@
                                    <option value="{{$dive->CAR_SCHEDULE}}">{{$dive->DL_DEPTH}}</option>
                                @endforeach
                            </select>
                        </li>-->
                        <li class="hover:bg-transparent bg-transparent">
                            <button type="submit" class="w-full py-2.5 px-4 text-sm bg-gray-300 rounded-md focus:outline-none focus:bg-gray-400">
                                Rechercher
                            </button>
                        </li>
                    </ul>
                    </form>
                </div>
                </label>
            </div>
+6 −4
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@
    ->get('/dives', [DivingSignUpController::class, 'show'])
    ->name('dives');

Route::middleware('App\Http\Middleware\rightChecker')
    ->get('/dives/filter', [DivesList::class, 'filter'])
    ->name('dives_filter');

Route::get('/test', function () {
    return view('test');
});
@@ -103,8 +107,7 @@
 * Only accessible to the diving section manager.
 */
Route::middleware('App\Http\Middleware\rightChecker')
    ->get('/create/dive', function()
{
    ->get('/create/dive', function () {
        return view('create_dive', ['locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all()->skip(3), 'users' => User::all(), 'previousDives' => session()->get('previousDives')]);
    })->name('create_dive');

@@ -113,8 +116,7 @@
 * Only accessible to the diving section manager.
 */
Route::middleware('App\Http\Middleware\rightChecker')
    ->post('/create/dive', function(Request $request)
{
    ->post('/create/dive', function (Request $request) {
        return DiveCreation::index($request);
    });