@extends('layout')
@section('title', 'ڈرائیورز')
@section('page_title', 'ڈرائیورز')


@section('content')
    <div class="row">
        @if(auth()->user()->hasPermissionTo('create driver'))
            <div class="col-md-4">
                <div class="panel panel-card margin-b-30">
                    <div class="panel-body">

                        <form id="add_driver_form">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="name">نام <span class="text-danger">*</span></label>
                                        <input type="text" id="name" autofocus class="form-control" name="name">
                                        <span class="text-danger error" id="name_error"></span>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="cnic">شناختی کارڈ نمبر <span class="text-danger">*</span></label>
                                        <input type="text" id="cnic" autofocus class="form-control" name="cnic">
                                        <span class="text-danger error" id="cnic_error"></span>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="mobile_number">موبائل نمبر: <span
                                                class="text-danger">*</span></label>
                                        <input type="text" id="mobile_number" autofocus class="form-control"
                                               name="mobile_number">
                                        <span class="text-danger error" id="mobile_number_error"></span>
                                    </div>
                                </div>

                            </div>
                            <div class="row mt-2">
                                <div class="col-md-12">
                                    <label for="joining_date">شامل ہونے کی تاریخ:</label>
                                    <input type="date" class="form-control" id="joining_date" name="joining_date"
                                           value="{{ date('Y-m-d') }}">
                                    <span class="text-danger error" id="joining_date_error"></span>
                                </div>

                            </div>
                            <div class="row mt-2">
                                <div class="col-md-12">
                                    <label for="joining_date">تنخواہ:</label>
                                    <input type="text" class="form-control" id="" name="salary">
                                    <span class="text-danger error" id="salary_error"></span>
                                </div>

                            </div>
                            <div class="row mt-2">
                                <div class="col-md-6">
                                    <label for="cnic_front">شناختی کارڈ سامنے:</label>
                                    <input type="file" id="cnic_front" class="form-control" name="front_cnic"><br>
                                    <span class="text-danger error" id="front_cnic_error"></span>
                                </div>
                                <div class="col-md-6">
                                    <label for="cnic_back">شناختی کارڈ پیچھے:</label>
                                    <input type="file" class="form-control" id="cnic_back" name="back_cnic"><br>
                                    <span class="text-danger error" id="back_cnic_error"></span>
                                </div>

                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="">
                                        @csrf
                                        <button name="createCitySubmit" id="submit_btn"
                                                class="btn btn-sm btn-primary btn-lg"
                                                type="submit">
                                            محفوظ
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        @endif
        <div class="{{ auth()->user()->hasPermissionTo('create driver')?'col-md-8': 'col-md-12' }}">
            <div class="panel panel-card ">
                <div class="panel-body">
                    <table id="driver_table" class="table table-bordered" cellspacing="0" width="100%">
                        <thead class="bg-gold text-white">
                        <tr style="white-space: nowrap">
                            <th>#</th>
                            <th>نام</th>
                            <th>مونائل</th>
                            <th>شناختی کارڈ نمبر</th>
                            <th>شناختی کارڈ تصاویر</th>
                            <th>تنخواہ</th>
                            <th>سٹیٹس</th>
                            <th>ایکشن</th>
                        </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="editDriverModal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-lg">
            <div class="modal-content panel-card" id="editDriverData">

            </div>
        </div>
    </div>

@endsection
@section('javascript')
    @include('drivers.js')
@endsection
