
<?php $__env->startSection('title'); ?> Profile | Beauty Parlour <?php $__env->stopSection(); ?>
<?php $__env->startSection('admin/profile'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('admin/profile'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<style>
    .setting-custom-select2-form .select2-container--default .select2-selection--single{
        padding-top: 5px;
        padding-bottom: 5px;
    }
</style>
<?php $__env->stopSection(); ?>

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

<!-- BEGIN: Content-->
<div class="app-content content">
    <div class=" d-flex align-items-center justify-content-between my-3">
        <div class="align-items-center">
            <h3 class="mb-0 pb-0">Personal Profile<span class="divider"></span></h3>
        </div>
    </div>

    <div class="content-wrapper container-xxl p-0">
        <div class="content-body">
            <section class="app-user-view-account">
                <div class="row">
                    <!-- User Sidebar -->
                    <div class="col-xl-4 col-lg-5 col-md-5">
                        <!-- User Card -->
                        
                        <!-- /User Card -->
                        <div class="card">
                            <div class="card-header text-start">
                                <h4 class="mb-0 pb-0">User Details</h4>
                            </div>
                            <div class="card-body">
                                <div class="user-avatar-section pb-3">
                                    <div class="d-flex align-items-center flex-column">
                                        <?php if(Auth::user()->image != null): ?>
                                        <a href="<?php echo e(asset('uploads/user_img/'. Auth::user()->image )); ?>" data-rel="lightcase">
                                        <img class="img-fluid rounded mt-3 mb-2" src="<?php echo e(asset('uploads/user_img/'. Auth::user()->image )); ?>"
                                            height="110" width="110" alt="User avatar" />
                                        </a>
                                        <?php else: ?>
                                        <a href="<?php echo e(asset('backend/app-assets/images/avatars/11.png')); ?>" data-rel="lightcase">
                                        <img class="rounded" src="<?php echo e(asset('backend/app-assets/images/avatars/11.png')); ?>" alt="avatar"
                                            height="110" width="110">
                                        </a>
                                        <?php endif; ?>
                        
                                        <div class="user-info text-center mt-3">
                                            <h4 class="mb-0"><?php echo e(Auth::guard()->user()->name); ?></h4>
                                            <span class="badge bg-secondary text-light"><?php echo e(Auth::guard()->user()->role); ?></span>
                                        </div>
                                    </div>
                                </div>

                                <div class="info-container">
                                    <ul class="list-unstyled">
                                        <li class="mb-2">
                                            <span class="fw-bolder me-25">Name:</span>
                                            <span><?php echo e(Auth::guard()->user()->name); ?></span>
                                        </li>
                        
                                        <li class="mb-2">
                                            <span class="fw-bolder me-25">Email:</span>
                                            <span><?php echo e(Auth::user()->email); ?></span>
                                        </li>
                        
                                        <li class="mb-2">
                                            <span class="fw-bolder me-25">Mobile:</span>
                                            <span><?php echo e(Auth::user()->mobile); ?></span>
                                        </li>
                        
                                    </ul>
                                </div>
                            </div>

                            <div class="card-footer">
                                <a href="#" class="btn btn-primary custom-profile-security w-100" data-bs-toggle="modal"
                                    data-bs-target="#updateSecurity">Password Change</a>
                            </div>
                            
                        </div>
                        
                        
                        <div class="modal fade" id="updateSecurity" tabindex="-1" 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">Password Update</h1>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                                    </div>
                                    <form action="<?php echo e(route('admin.security.update')); ?>" method="post">
                                        <?php echo csrf_field(); ?>
                                        <div class="modal-body">
                                            <div class="row">
                        
                                                <div class="col-12 mb-2">
                                                    <div class="form-group">
                                                        <label for="old_password">Old Password <span
                                                                class=" text-danger">(required)</span></label>
                                                        <input type="password" name="old_password" class="form-control"
                                                            placeholder="Old Password" required>
                                                    </div>
                        
                                                    <?php $__errorArgs = ['old_password'];
$__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-2">
                                                    <div class="form-group">
                                                        <label for="new_password">New Password <span
                                                                class=" text-danger">(required)</span></label>
                                                        <input type="password" name="new_password" class="form-control"
                                                            placeholder="New Password" required>
                                                    </div>
                        
                                                    <?php $__errorArgs = ['new_password'];
$__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-2">
                                                    <div class="form-group">
                                                        <label for="confirm_password">Confirm Password <span
                                                                class=" text-danger">(required)</span></label>
                                                        <input type="password" name="confirm_password" class="form-control"
                                                            placeholder="Confirm Password" required>
                                                    </div>
                        
                                                    <?php $__errorArgs = ['confirm_password'];
$__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">Update</button>
                                            <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Cancel</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--/ User Sidebar -->

                    <!-- User Content -->
                    <div class="col-xl-8 col-lg-7 col-md-7">
                        <div class="card shadow">
                            <h4 class="card-header">Update Profile Basic</h4>

                            <form action="<?php echo e(route('admin.profile.update', Auth::user()->id )); ?>" method="post" enctype="multipart/form-data">
                                <?php echo csrf_field(); ?>
                                <div class="card-body">
                                        <div class="row">
                    
                                            <div class="col-md-8 mb-2">
                                                <div class="mb-2">
                                                    <div class="form-group">
                                                        <label for="name">Name <span class=" text-danger">(required)</span></label>
                                                        <input type="text" name="name" class="form-control" value="<?php echo e(Auth::user()->name); ?>"
                                                            placeholder="Name" required>
                                                    </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="mb-2">
                                                    <div class="form-group">
                                                        <label for="mobile">Mobile <span class=" text-danger">(required)</span></label>
                                                        <input type="number" name="mobile" id="mobile" class="form-control" value="<?php echo e(Auth::user()->mobile); ?>"
                                                            placeholder="Mobile" required>
                                                    </div>
                                                
                                                    <?php $__errorArgs = ['mobile'];
$__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="mb-2">
                                                    <div class="form-group">
                                                        <label for="email">Email <span class=" text-danger">(required)</span></label>
                                                        <input type="email" name="email" class="form-control" value="<?php echo e(Auth::user()->email); ?>"
                                                            placeholder="Email" required>
                                                    </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>

                                            <div class="col-md-4 mb-2">
                                                <div class="form-group">
                                                    <label for="name">Profile Photo <span class=" text-danger"></span></label> <br>
                                                    <div class=" position-relative custom-soft-setting dropzone">
                                                        <div class="select_imgWith_preview py-2">
                                                            <?php if(Auth::user()->image != null): ?>
                                                            <img id="uploadPreview1" src="<?php echo e(asset('uploads/user_img/'.Auth::user()->image)); ?>">
                                                            <?php else: ?>
                                                            <img id="uploadPreview1" src="<?php echo e(asset('backend/template-assets/')); ?>/images/img_preview.png">
                                                
                                                            <div id="dropzone-block" class="custom-media-upload-block mt-3">
                                                                
                                                            </div>
                                                            <?php endif; ?>
                                                            <input id="uploadImage1" type="file" name="image"
                                                                onchange="PreviewImageFP('uploadImage1','uploadPreview1');" />
                                                        </div>
                                                    </div>
                                                
                                                    <?php $__errorArgs = ['image'];
$__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 class="col-md-12">
                                                <div class="mb-2">
                                                    <div class="form-group custom-select2-form setting-custom-select2-form">
                                                        <label for="roles">Role <span class="text-danger">(required)</span>
                                                        </label>
                                                        <select name="roles" id="roles" class="form-select select2 mt-2" disabled required>
                                                            <option value="" selected disabled> <?php echo e(Str::title(Auth::user()->role)); ?> </option>
                                                        </select>
                                                    </div>
                                                
                                                    <?php $__errorArgs = ['roles'];
$__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>

                                <div class="card-footer text-end">
                                    <button type="submit" class="btn btn-success w-100" onclick="return checkValidate()">Update Profile</button>
                                </div>

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

                    <!--/ User Pills -->

                </div>
                <!--/ User Content -->
            </section>
        </div>
    </div>
</div>
<!-- END: Content-->

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

<?php $__env->startSection('scripts'); ?>
<script>
    $("#branch_id").select2()

    function checkValidate() {
        var mobileNumber = $("#mobile").val();

        if (mobileNumber != '' && mobileNumber.length != 11) { 
            event.preventDefault();
            toastr.error("Mobile number must be 11 digit."); 
        }

        return true;
    }

    $(document).ready(function(){
        $('#pills-security').css('display', 'none');
        $(document).on('click','#pills-account-tab', function(){
            $('#pills-security').css('display', 'none');
        })
        $(document).on('click','#pills-security-tab', function(){
            $('#pills-security').css('display', 'block');
        })
    })

    //For image preview...
    function PreviewImageFP(selectFile, previewImg) {
        // $("#dropzone-block").css('display','none');
        var oFReader = new FileReader();
        oFReader.readAsDataURL(document.getElementById(selectFile).files[0]);

        oFReader.onload = function (oFREvent) {
            document.getElementById(previewImg).src = oFREvent.target.result;
        };
    }

    function cancelPreviewFP(selectFile, previewImg) {
        const img = document.getElementById(previewImg);
        img.src = window.location.origin + "/backend/template-assets/images/img_preview.png";
        $("#" + selectFile).val('');
    }
</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\Next-Web-Service\mastering-dashboard\resources\views/admin/profile/index.blade.php ENDPATH**/ ?>