
<?php $__env->startSection('title'); ?> Appoinment | Beauty Parlour <?php $__env->stopSection(); ?>
<?php $__env->startSection('appoinment'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content_section'); ?>
<div class="row py-3 ps-2">
    <div class="heading d-flex justify-content-start align-items-center">
        <h3 class="mb-0"><span> Appoinment List</span></h3>
    </div>
</div>

<div class="table_wrapper py-1 card">
    <div class="row my-2 aggregate-section-div">
        <div class="px-3 ">
            <div class=" d-flex justify-content-between align-items-center aggregate-section border">
                <div class="d-flex align-items-center">
                    <p class="mb-0"><a href="<?php echo e(route('appoinment.index')); ?>"
                            class="text-primary py-2 px-3 active">All(<?php echo e($allAppoinmentCount); ?>)</a>
                    </p>
                </div>
                <div class="d-none d-sm-block">
                    <?php if(Auth::user()->can('appoinment-create')): ?>
                    <a href="javascript:void(0)"
                        class="btn btn-success rounded-0 d-flex align-items-center px-2 border-0" data-bs-toggle="modal"
                        data-bs-target="#addAppoinment"><span class="">New Appoinment</span></a>
                    <?php endif; ?>
                </div>
            </div>

            <?php if(Auth::user()->can('appoinment-create')): ?>
            <div class="mt-2 btn btn-success d-block rounded-0 d-sm-none" data-bs-toggle="modal"
                data-bs-target="#addAppoinment">
                New Appoinment</div>
            <?php endif; ?>
        </div>
    </div>



    <div class="row px-3">
        <div class="table-container table-responsive">
            <table id="" class="table table-bordered">
                <thead class="text-uppercase">
                    <tr class="me-3">
                        <th class="text-center" scope="col"><span>Serial No</span></th>
                        <th class="text-center" scope="col"><span>Patient Ino</span></th>
                        <th class="text-center" scope="col"><span>Patient Issue</span></th>
                        <th class="text-center" scope="col"><span>Creation Of Date/Time</span></th>
                    </tr>
                </thead>
                <tbody class="text-center">

                    <?php $__currentLoopData = $appoinmentData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($item) && $item != null): ?>
                    <tr class="">

                        <td>
                            <b># <?php echo e(strlen($item->appoinment_id) > 2 ? $item->appoinment_id : '00'.$item->appoinment_id); ?></b>
                        </td>
                        <td class="text-start">
                            <div class="row_title">
                                <b>Name: </b><?php echo e($item->name); ?> <br>
                                <b>Phone: </b><?php echo e($item->phone); ?> <br>
                                <b>Gender: </b><?php echo e($item->gender); ?> <br>
                            </div>
                            <div class="row-actions mt-2">

                                <?php if(Auth::user()->can('appoinment-edit')): ?>
                                <span><button class="edit_class_modal border-0 bg-transparent text-primary fw-bolder" value="<?php echo e($item->id); ?>"
                                        onclick="updateAppoinment(<?php echo e($item->id); ?>)"> Edit </button></span>
                                <?php endif; ?>

                                <?php if(Auth::user()->can('appoinment-delete')): ?>
                                <span> | <a class="text-danger fw-bolder"
                                        href="<?php echo e(route('appoinment-delete', $item->id)); ?>">Delete</a>
                                </span>
                                <?php endif; ?>
                            </div>
                        </td>
                        
                        <td class="text-start">
                            <b>Service: </b><?php echo e($item->serviceData->service_name); ?> <br>
                            <b>Problem: </b><?php echo e($item->problem); ?>

                        </td>

                        <td class="text-start">
                            <b>Date: </b><?php echo e(Carbon\Carbon::parse($item->appoinment_date)->format('d-m-Y')); ?> <br>
                            <b>Time: </b><?php echo e(Carbon\Carbon::create($item->created_at->toTimeString())->format('h:i')); ?>

                        </td>

                    </tr>

                    
                    <div class="modal fade" id="updateAppoinment<?php echo e($item->id); ?>" tabindex="-1"
                        aria-labelledby="oneInputModalLabel" aria-hidden="true" data-bs-backdrop='static'>
                        <div class="modal-dialog modal-dialog-centered max-width-900px">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h1 class="modal-title fs-5" id="oneInputModalLabel">Update Appoinment</h1>
                                    <button type="button" class="btn-close" data-bs-dismiss="modal"
                                        aria-label="Close"></button>
                                </div>
                                <form action="<?php echo e(route('appoinment.update', $item->id)); ?>" method="post"
                                    enctype="multipart/form-data">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('put'); ?>
                                    <div class="modal-body p-0">
                                        <div class="row px-4 my-4">
                                            <div class="col-md-6 mb-3">
                                                <div class="form-group custom-select2-form">
                                                    <label for="provider_id">Service Provider <span
                                                            class=" text-danger">(required)</span>
                                                    </label>
                                                    <select name="provider_id" id="provider_id<?php echo e($item->id); ?>"
                                                        class="form-select select2" required>
                                                        <?php $__currentLoopData = $providerData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleProvider): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($singleProvider->id); ?>"
                                                            <?php echo e($singleProvider->id == $item->provider_id ? "selected":""); ?>>
                                                            <?php echo e($singleProvider->provider_name); ?>

                                                        </option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </select>
                                                </div>

                                                <?php $__errorArgs = ['provider_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>
                                            
                                            <div class="col-md-6 mb-3">
                                                <div class="form-group custom-select2-form">
                                                    <label for="branch_id">Select Branch <span
                                                            class=" text-danger">(required)</span>
                                                    </label>
                                                    <select name="branch_id" id="branch_id<?php echo e($item->id); ?>"
                                                        class="form-select select2" required>
                                                        <?php $__currentLoopData = $branchData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleBranch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($singleBranch->id); ?>"
                                                            <?php echo e($singleBranch->id == $item->branch_id ? "selected":""); ?>>
                                                            <?php echo e($singleBranch->branch_title); ?>

                                                        </option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </select>
                                                </div>

                                                <?php $__errorArgs = ['branch_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>
                                            
                                            <div class="col-md-6 mb-3">
                                                <div class="form-group custom-select2-form">
                                                    <label for="service_id">Select Service <span
                                                            class=" text-danger">(required)</span>
                                                    </label>
                                                    <select name="service_id" id="service_id<?php echo e($item->id); ?>"
                                                        class="form-select select2" required>
                                                        <?php $__currentLoopData = $serviceData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleSDFU): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($singleSDFU->id); ?>"
                                                            <?php echo e($singleSDFU->id == $item->service_id ? "selected":""); ?>>
                                                            <?php echo e($singleSDFU->service_name); ?>

                                                        </option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </select>
                                                </div>

                                                <?php $__errorArgs = ['service_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>

                                            <div class="col-md-6 mb-3">
                                                <div class="form-group custom-select2-form">
                                                    <label for="gender">Select Gender <span class=" text-danger">(required)</span>
                                                    </label>
                                                    <select name="gender" id="gender<?php echo e($item->id); ?>" class="form-select select2" required>
                                                        <option value="male" <?php echo e($item->gender == 'male' ? 'selected' : ''); ?>> Male</option>
                                                        <option value="female" <?php echo e($item->gender == 'female' ? 'selected' : ''); ?>> Female</option>
                                                        <option value="other" <?php echo e($item->gender == 'other' ? 'selected' : ''); ?>> Other</option>
                                                    </select>
                                                </div>
                                            
                                                <?php $__errorArgs = ['gender'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>

                                            <div class="col-md-6 mb-3">
                                                <div class="form-group">
                                                    <label for="name">Name<span class="text-danger">(required)</span>
                                                    </label>
                                                    <input type="text" name="name" required
                                                        class="form-control form-control-solid" value="<?php echo e($item->name); ?>"
                                                        placeholder="Name">
                                                </div>

                                                <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>

                                            <div class="col-md-6 mb-3">
                                                <div class="form-group">
                                                    <label for="phone">Phone<span class="text-danger">(required)</span>
                                                    </label>
                                                    <input type="number" name="phone" id="phone<?php echo e($item->id); ?>" required
                                                        class="form-control form-control-solid" value="<?php echo e($item->phone); ?>"
                                                        placeholder="Phone">
                                                </div>

                                                <?php $__errorArgs = ['phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>
                                            
                                            <div class="col-md-6 mb-3">
                                                <div class="form-group">
                                                    <label for="email">Email<span class="text-danger"></span>
                                                    </label>
                                                    <input type="email" name="email" id="email<?php echo e($item->id); ?>"
                                                        class="form-control form-control-solid" value="<?php echo e($item->email); ?>"
                                                        placeholder="Email">
                                                </div>

                                                <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>

                                            <div class="col-md-6 mb-3">
                                                <div class="form-group">
                                                    <label for="appoinment_date">Appoinment Date<span
                                                            class="text-danger">(required)</span>
                                                    </label>
                                                    <input type="text"
                                                        class=" form-control custom-readonly-bg-color flatpickr-basic custom-date-picker"
                                                        name="appoinment_date" id="appoinment_date<?php echo e($item->id); ?>"
                                                        placeholder="DD-MM-YYYY" value="<?php echo e(Carbon\Carbon::parse($item->appoinment_date)->format('d-m-Y')); ?>" required>
                                                </div>

                                                <?php $__errorArgs = ['appoinment_date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>

                                            <div class="col-md-12 mb-3">
                                                <div class="form-group">
                                                    <label for="problem">Problem<span
                                                            class="text-danger">(required)</span>
                                                    </label>
                                                    <textarea class="form-control" cols="2" rows="2" name="problem"
                                                        id="problem" placeholder="Enter Problem"
                                                        required><?php echo e($item->problem); ?></textarea>
                                                </div>

                                                <?php $__errorArgs = ['problem'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="submit" class="btn btn-success" onclick="return checkValidateFU(<?php echo e($item->id); ?>)">Update</button>
                                        <button type="button" class="btn btn-danger"
                                            data-bs-dismiss="modal">Cancel</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>

                    <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                </tbody>
            </table>
        </div>

        <?php if(isset($allAppoinmentCount) && $allAppoinmentCount > 10): ?>
        <div class="clearfix d-flex">
            <div class="float-left">
                <p class="text-muted">
                    <?php echo e(__('Showing')); ?>

                    <span class="font-weight-bold"><?php echo e($appoinmentData->firstItem()); ?></span>
                    <?php echo e(__('to')); ?>

                    <span class="font-weight-bold"><?php echo e($appoinmentData->lastItem()); ?></span>
                    <?php echo e(__('of')); ?>

                    <span class="font-weight-bold"><?php echo e($appoinmentData->total()); ?></span>
                    <?php echo e(__('results')); ?>

                </p>
            </div>

            <div class="float-right custom-table-pagination">
                <?php echo $appoinmentData->links('pagination::bootstrap-4'); ?>

            </div>
        </div>
        <?php endif; ?>
    </div>
</div>




<div class="modal fade" id="addAppoinment" tabindex="-1" aria-labelledby="oneInputModalLabel" aria-hidden="true"
    data-bs-backdrop='static'>
    <div class="modal-dialog modal-dialog-centered max-width-900px">
        <div class="modal-content">
            <div class="modal-header">
                <h1 class="modal-title fs-5" id="oneInputModalLabel">New Service</h1>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-header">
                <p class="fs-5 text-center mb-0" id="oneInputModalLabel">সার্ভিস একবার তৈরী হয়ে গেলে Delete করা সম্ভব না
                    , প্রয়োজনে
                    edit বা inactive করতে পারবেন। তাই অপ্রয়োজনীয় সার্ভিস তৈরী থেকে বিরত
                    থাকুন।</p>
            </div>
            <form action="<?php echo e(route('appoinment.store')); ?>" method="post" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <div class="modal-body p-0">
                    <div class="row px-4 my-4">

                        <div class="col-md-6 mb-3">
                            <div class="form-group custom-select2-form 
                            <?php echo e($providerData->count() > 0 ? '' : 'custom-null-select2-body'); ?>

                            ">
                                <label for="provider_id">Service Provider <span class=" text-danger">(required)</span>
                                </label>
                                <select name="provider_id" id="provider_id" class="form-select select2">
                                    <option value="" selected disabled> Select Provider</option>
                                    <?php $__currentLoopData = $providerData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleProvider): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($singleProvider->id); ?>"
                                        <?php echo e($singleProvider->is_default == true ? 'selected' : ''); ?>>
                                        <?php echo e($singleProvider->provider_name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>

                            <?php $__errorArgs = ['provider_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="col-md-6 mb-3">
                            <div class="form-group custom-select2-form">
                                <label for="branch_id">Select Branch <span class=" text-danger">(required)</span>
                                </label>
                                <select name="branch_id" id="branch_id" class="form-select select2" required>
                                    <option value="" selected disabled> Select Branch</option>
                                    <?php $__currentLoopData = $branchData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleBranch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($singleBranch->id); ?>" 
                                        <?php echo e($singleBranch->is_default == true ? 'selected' : ''); ?>>
                                        <?php echo e($singleBranch->branch_title); ?>

                                    </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        
                            <?php $__errorArgs = ['branch_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div class="form-group custom-select2-form">
                                <label for="service_id">Select Service <span class=" text-danger">(required)</span>
                                </label>
                                <select name="service_id" id="service_id" class="form-select select2" required>
                                    <option value="" selected disabled> Select Service</option>
                                    <?php $__currentLoopData = $serviceData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleSD): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($singleSD->id); ?>">
                                        <?php echo e($singleSD->service_name); ?>

                                    </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        
                            <?php $__errorArgs = ['service_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="col-md-6 mb-3">
                            <div class="form-group custom-select2-form">
                                <label for="gender">Select Gender <span class=" text-danger">(required)</span>
                                </label>
                                <select name="gender" id="gender" class="form-select select2" required>
                                    <option value="male"> Male</option>
                                    <option value="female"> Female</option>
                                    <option value="other"> Other</option>
                                </select>
                            </div>
                        
                            <?php $__errorArgs = ['gender'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="col-md-6 mb-3">
                            <div class="form-group">
                                <label for="name">Name<span class="text-danger">(required)</span>
                                </label>
                                <input type="text" name="name" required class="form-control form-control-solid"
                                    value="<?php echo e(old('name')); ?>" placeholder="Name">
                            </div>

                            <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="col-md-6 mb-3">
                            <div class="form-group">
                                <label for="phone">Phone<span class="text-danger">(required)</span>
                                </label>
                                <input type="number" name="phone" id="phone" required class="form-control form-control-solid"
                                    value="<?php echo e(old('phone')); ?>" placeholder="Phone">
                            </div>

                            <?php $__errorArgs = ['phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                        
                        <div class="col-md-6 mb-3">
                            <div class="form-group">
                                <label for="email">Email<span class="text-danger"></span>
                                </label>
                                <input type="email" name="email" id="email" required class="form-control form-control-solid"
                                    value="<?php echo e(old('email')); ?>" placeholder="Email">
                            </div>

                            <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="col-md-6 mb-3">
                            <div class="form-group">
                                <label for="appoinment_date">Appoinment Date<span class="text-danger">(required)</span>
                                </label>
                                <input type="text" class=" form-control custom-readonly-bg-color flatpickr-basic custom-date-picker"
                                    name="appoinment_date" id="appoinment_date" placeholder="DD-MM-YYYY" value="<?php echo e(Carbon\Carbon::parse($todayDate)->format('d-m-Y')); ?>"
                                    required>
                            </div>
                        
                            <?php $__errorArgs = ['appoinment_date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                        
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label for="problem">Problem<span class="text-danger">(required)</span>
                                </label>
                                <textarea class="form-control" cols="2" rows="2" name="problem" id="problem" placeholder="Enter Problem"
                                    required></textarea>
                            </div>
                        
                            <?php $__errorArgs = ['problem'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-success" onclick="return checkValidate()">Save</button>
                    <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Cancel</button>
                </div>
            </form>
        </div>
    </div>
</div>


<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>

<script>
    $(document).ready(function(){
        $("#provider_id").select2({
            dropdownParent: $('#addAppoinment')
        });
        
        $("#branch_id").select2({
            dropdownParent: $('#addAppoinment')
        });
        
        $("#service_id").select2({
            dropdownParent: $('#addAppoinment')
        });
        
        $("#gender").select2({
            dropdownParent: $('#addAppoinment')
        });

        $("#appoinment_date").flatpickr({
            allowInput: true,
            dateFormat: "d-m-Y",
        });
    });
    
    //To show update modal...
    function updateAppoinment(id) {
        $("#updateAppoinment"+id).modal('show');
        $("#provider_id"+id).select2({
            dropdownParent: $('#updateAppoinment'+id)
        });
        $("#branch_id"+id).select2({
            dropdownParent: $('#updateAppoinment'+id)
        });
        $("#service_id"+id).select2({
            dropdownParent: $('#updateAppoinment'+id)
        });
        $("#gender"+id).select2({
            dropdownParent: $('#updateAppoinment'+id)
        });

        $("#appoinment_date"+id).flatpickr({
            allowInput: true,
            dateFormat: "d-m-Y",
        });
    }

    //To check validate...
    function checkValidate() {
        let mobileNumber1 = $("#phone").val();
        if (mobileNumber1 != '' && mobileNumber1.length != 11) {
            event.preventDefault();
            toastr.error("Mobile number must be 11 digit.");
        }
        
        return true; 
    }
    
    //To check validate for update...
    function checkValidateFU(id) {
        let mobileNumber1 = $("#phone"+id).val();
        if (mobileNumber1 != '' && mobileNumber1.length != 11) {
            event.preventDefault();
            toastr.error("Mobile number must be 11 digit.");
        }
        
        return true; 
    }
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Personal-Project\Office-Project\update\skin-care\resources\views/admin/appoinment/index.blade.php ENDPATH**/ ?>