<style>
    .card
    {

        padding: 30px;
    }
    .row{
        margin: 0;
    }
    .form-check{
        padding-top: 5px;
    }
    .form-label{
        font-size: 15px;
    }
</style>

<div class="card">
    <div class="cardbody">
        <h3 class="">ENDOCAPTURE Department </h3>
        <input type="hidden" name="user_type" value="{{$type}}">

        <div class="row">
            <div class="col-lg">
                <label for="name_endo" class="form-label">Endocapture Name</label>
                <input type="text" name="user_firstname" class="form-control" id="create_endo_firstname" placeholder="Name" value="{{@$data->user_firstname}}" required>
            </div>

        </div>
        <div class="row mt-4">
            <div class="col-lg">
                <label for="" class="form-label">Phone</label>
                <div class="input-group mt-3">
                    <span class="input-group-text" id="inputGroup-sizing-default"><i class="fas fa-phone-alt"></i> </span>
                    <input type="text" class="form-control" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-default" placeholder="Phone" id="edit_endo_phone" name="phone"  value="{{@$data->phone}}">
                </div>
            </div>
            <div class="col-lg">
                <div class="form-group m-0">
                    <label>Color</label>
                    <div class="input-group">
                        <input id="create_endo_color" name="color" type="color" class="form-control p-0" value="{{@$data->color}}"/>
                        <div class="input-group-append"><span class="input-group-text"><i class="fas fa-palette"></i></span></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row mt-4">
            <div class="col-lg">
                <label for="exampleFormControlInput1" class="form-label">RFID</label>
                <input id="create_endo_rfid" type="text" name="user_rfid" class="form-control" placeholder="rfid"  value="{{@$data->user_rfid}}"/>
            </div>
        </div>
        <div class="row">
            <div class="col-lg">
                <label for="exampleFormControlInput1" class="form-label">Department</label>
                @foreach ($department_all as $dpma)
                @if(isset($id))
                    @php
                        $check = array_search("$id",json_decode($dpma->department_user));
                    @endphp
                @endif
                <div class="form-check">
                    <input class="form-check-input" type="checkbox" id="edit_department_endo{{$dpma->department_id}}" name="department[{{$dpma->department_id}}]"
                        @if($_GET['department'] == $dpma->department_id || @$check!=null) checked @endif
                    >
                    <label class="form-check-label" for="edit_department_endo{{$dpma->department_id}}">
                        {{$dpma->department_name}}
                    </label>
                </div>
                @endforeach
            </div>
        </div>
        <div class="row mt-4">
            <div class="col-lg">
                <label for="name_user" class="form-label">Username</label>
                <input id="name_user_insert" name="email" type="text" class="form-control name_user_insert" autocomplete="new-email"  value="{{@$data->email}}">
            </div>
            <div class="col-lg">
                <label for="name_pass" class="form-label">Password</label>
                <input id="create_endo_password" type="password" name="password"  class="form-control" autocomplete="new-password">
            </div>
        </div>
        <div class="row mt-4">
            <div class="col-lg-4"></div>
            <div class="col-lg-4" id="endo_img"></div>
            <div class="col-lg-4"></div>
        </div>
        <div class="row mt-3">
            <div class="col"></div>
            <div class="col text-center"><img src="{{$image}}" class="img-fluid" id="blah"></div>
            <div class="col"></div>
        </div>
        <div class="row mt-3">
            <div class="col-lg-6">
                <div class="custom-file">
                    <input type="file" class="custom-file-input" name="rfid_file" id="imgInp" accept="image/*"/>
                    <label class="custom-file-label" for="customFile">Choose file</label>
                </div>
            </div>
            <div class="col-lg-6 text-end">
                @if(isset($id))
                    <button id="btn_endo_edit_submit" type="submit" class="btn btn-warning">Edit</button>
                @else
                    <button id="btn_endo_edit_submit" type="submit" class="btn btn-success">Submit</button>
                @endif
            </div>
        </div>
    </div>
</div>
