<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel"><?php echo e($title); ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
                    <svg> ... </svg>
                </button>
            </div>
            <div class="modal-body">
                <div id="error_message"></div>

                <div class="row">
                    <div class="col-md-6">


                        <?php if(Auth::user()->user_type_id != 1): ?>
                            <?php
                                $clients = \App\Models\User::where('user_type_id', 1)->get();
                            ?>

                            <div class="row mb-3">
                                <label for="qty" class="col-sm-4 col-form-label">Clients<span
                                        class="text-danger">*</span></label>
                                <div class="col">
                                    <select type="text" class="form-control" id="client_id" required>
                                        <option value="0">Select Client</option>
                                        <?php $__currentLoopData = $clients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($item->id); ?>"
                                                <?php echo e($address && $address->client_id == $item->id ? 'selected' : ''); ?>>
                                                <?php echo e($item->full_name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>


                        <?php endif; ?>



                        <div class="row mb-3">
                            <label for="full_name" class="col-sm-4 col-form-label">Contact Name<span
                                    class="text-danger">*</span></label>
                            <div class="col">
                                <input type="text" class="form-control" id="name"
                                    value="<?php echo e($address ? $address->name : ''); ?>" required>
                            </div>
                        </div>

                        <div class="row mb-3">
                            <label for="qty" class="col-sm-4 col-form-label">Contact Email<span
                                    class="text-danger">*</span></label>
                            <div class="col">
                                <input type="email" class="form-control" id="contact_email"
                                    value="<?php echo e($address ? $address->contact_email : ''); ?>" required>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="qty" class="col-sm-4 col-form-label">Contact Phone<span
                                    class="text-danger">*</span></label>
                            <div class="col">

                                <div class="input-group mb-3">
                                    <select class="input-group-text" name="country_code_id" id="country_code_id"
                                        style="text-align: left">
                                        <?php $__currentLoopData = $country; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($item->id); ?>"
                                                <?php echo e($address && $address->countryCode->id == $item->id ? 'selected' : ''); ?>>
                                                <?php echo e($item->short_code); ?> (<?php echo e($item->country_code); ?>)
                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                    </select>
                                    <input type="number" class="form-control" name="contact_phone" required
                                        id="contact_phone" value="<?php echo e($address ? $address->contact_phone : ''); ?>">

                                </div>

                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="qty" class="col-sm-4 col-form-label">Note</label>
                            <div class="col">
                                <input type="text" class="form-control" id="note"
                                    value="<?php echo e($address ? $address->note : ''); ?>">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="row mb-3">
                            <label for="qty" class="col-sm-4 col-form-label">Address<span
                                    class="text-danger">*</span></label>
                            <div class="col">
                                <input type="text" class="form-control" id="address"
                                    value="<?php echo e($address ? $address->address : ''); ?>" required>
                            </div>
                        </div>

                        <div class="row mb-3">
                            <label for="qty" class="col-sm-4 col-form-label">City<span
                                    class="text-danger">*</span></label>
                            <div class="col">
                                <input type="text" class="form-control" id="city"
                                    value="<?php echo e($address ? $address->city : ''); ?>" required>
                            </div>
                        </div>

                        <div class="row mb-3">
                            <label for="qty" class="col-sm-4 col-form-label">Province/State<span
                                    class="text-danger">*</span></label>
                            <div class="col">
                                <input type="text" class="form-control" id="province"
                                    value="<?php echo e($address ? $address->province : ''); ?>" required>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="qty" class="col-sm-4 col-form-label">Country<span
                                    class="text-danger">*</span></label>
                            <div class="col">

                                <select type = "text" class="form-control" id="country_id" required>
                                    <?php $__currentLoopData = $country; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($item->id); ?>"
                                            <?php echo e($address && $address->country->id == $item->id ? 'selected' : ''); ?>>
                                            <?php echo e($item->country_name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>

                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="qty" class="col-sm-4 col-form-label">Postal Code<span
                                    class="text-danger">*</span></label>
                            <div class="col">
                                <input type="email" class="form-control" id="postal_code"
                                    value="<?php echo e($address ? $address->postal_code : ''); ?>" required>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal-footer">
                <button class="btn btn btn-light-dark" data-bs-dismiss="modal"><i class="flaticon-cancel-12"></i>
                    Discard</button>
                <?php if($action == 'create'): ?>
                    <button type="button" class="btn btn-primary" id="create">Add</button>
                <?php elseif($action == 'update'): ?>
                    <input type="hidden" id="address_id" value="<?php echo e($address->id); ?>">
                    <button type="button" class="btn btn-primary" id="update">Update</button>
                <?php endif; ?>
            </div>
        </div>
    </div>
<?php /**PATH /home/ferdous-ahmed-khan/Project/rent-a-mailbox/resources/views/app/address-book/form.blade.php ENDPATH**/ ?>