@extends('layout.app')


@section('content')

    <div class="card">
        <div class="card-body">

            <form action="{{ route('accoutningServer.store') }}" method="POST">

                @csrf

                <div class="card">
                    <div class="card-body">
                        <div class="row">
                        <div class="form-group col-md-4">
                            <label for="reseller_id" class="block text-sm font-medium text-gray-700">
                               Name*
                            </label>
                            <input type="text" name="name" id="name" class="form-control" placeholder=" name"
                            value="{{ old('name') }}" autocomplete="off" required>
                        </div>

                        <div class="form-group col-md-4">
                            <label> Select POP </label>
                            <select name="is_enable" id="is_enable" class="select2 form-control ">
                                <option value="1" selected>1</option>
                                <option value="0">0</option>
                            </select>
                        </div>

                    </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn-primary float-right">
                                Save
                            </button>
                        </div>
                    </div>

                </div>

            </form>
            <div class="table-responsive">
                <table id="dataTable" class="display">
                    <thead class="bg-gray-50">
                        <tr>
                            <th scope="col">
                                ID
                            </th>
                            <th scope="col">
                                Name
                            </th>
                            <th scope="col">
                                Status
                            </th>

                            <th scope="col">

                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($servers as $server)
                            <tr>
                                <td>
                                    {{ $server->id }}
                                </td>
                                <td>
                                    {{ $server->name ?? '' }}
                                </td>
                                <td>
                                    {{ $server->is_enable ?? '' }}
                                </td>

                                <td>
                                    <a href="{{ route('accoutningServer.edit', $server->id) }}"
                                        class="btn btn-primary pull-right">Edit</a>
                                </td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>

    </div>


@endsection
