@extends('layout.app')
@section('content')
    <div class="card">

        <div class="card-body">

                <form action="{{ route('global-settings.store') }}" method="POST">
                    <div class="row">
                        @csrf
                        @foreach ($list as $r)
                            <div class="form-group col-md-3">
                                <label for="">{{ $r->name }}</label>
                                <select name="action[{{$r->id}}]"
                                    class="form-control @if ($r->status == 'enable') bg-success @endif">
                                    <option value="enable" @if ($r->status == 'enable') selected @endif>Enable</option>
                                    <option value="disable" @if ($r->status == 'disable') selected @endif>Disable
                                    </option>
                                </select>
                            </div>
                        @endforeach

                        <div class="col-md-12">
                            <button class="btn btn-info float-right" type="submit">Update</button>
                        </div>
                    </div>

                </form>

                {{-- <table class="table table-bordered table-striped">
                    <thead class="bg-gray-50">
                        <tr>
                            <th>SL</th>
                            <th>Global Name</th>
                            <th>Status</th>
                            <th>Action</th>
                        </tr>

                    </thead>
                    <tbody>

                        @foreach ($list as $r)
                            <tr>
                                <td>{{ $r->id }}</td>
                                <td>{{ $r->name }}</td>
                                <td class="text-center">
                                    @if ($r->status == 'enable')
                                        <span class="text-green-300">Enabled</span>
                                    @elseif($r->status == 'disable')
                                        <span class="text-red-300">Disabled</span>
                                    @endif
                                </td>
                                <td class="text-center">

                                    <a href="{{ route('global-settings.edit', $r->id) }}" class="btn btn-primary">
                                        Edit</a>
                                </td>
                            </tr>
                        @endforeach

                        <!-- More items... -->
                    </tbody>
                </table> --}}

            
        </div>

        <style>
            a.btn.btn-primary {
                width: 200px;
            }
        </style>
    @endsection
