 
<?php $__env->startSection('title', $user->name); ?>
<?php $__env->startSection('content'); ?>
    <!-- push external head elements to head -->
    <?php $__env->startPush('head'); ?>
        <link rel="stylesheet" href="<?php echo e(asset('plugins/select2/dist/css/select2.min.css')); ?>">
        <link href='https://fonts.googleapis.com/css?family=Josefin Sans' rel='stylesheet'>
    <?php $__env->stopPush(); ?>

<?php 
    $getstatecodedata = DB::table('state_master')->get();
    $getdistrictcodedata = DB::table('district_master')->where('state_code',$user->state_code)->get();
    $getartcenterdata = DB::table('art_centre_master')->where('dist_code',$user->dist_code)->get();
?>
    
    <div class="container-fluid">
        <div class="page-header">
            <div class="row align-items-end">
                <div class="col-lg-8">
                    <div class="page-header-title">
                        <i class="ik ik-user-plus bg-blue"></i>
                        <div class="d-inline">
                            <h5><?php echo e(__('Edit User')); ?></h5>
                            <span><?php echo e(__('Create new user, assign roles & permissions')); ?></span>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <nav class="breadcrumb-container" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="<?php echo e(route('dashboard')); ?>"><i class="ik ik-home"></i></a>
                            </li>
                            <li class="breadcrumb-item">
                                <a href="<?php echo e(route('users')); ?>"><?php echo e(__('Users')); ?></a>
                            </li>
                            <li class="breadcrumb-item">
                                <!-- clean unescaped data is to avoid potential XSS risk -->
                                <?php echo e(clean($user->name, 'titles')); ?>

                            </li>

                        </ol>
                    </nav>
                </div>
            </div>
        </div>
        <div class="row">
            <!-- start message area-->
            <?php echo $__env->make('include.message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            <!-- end message area-->
            <div class="col-md-12">
                <div class="card">
                    <div class="card-body">
                        <form class="forms-sample" method="POST" action="<?php echo e(url('user/update')); ?>" >
                        <?php echo csrf_field(); ?>
                            <input type="hidden" name="id" value="<?php echo e($user->id); ?>">
                            <div class="row">
                                <div class="col-sm-6">

                                    <div class="form-group">
                                        <label for="name"><?php echo e(__('Username')); ?><span class="text-red">*</span></label>
                                        <input id="name" type="text" class="form-control <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="name" value="<?php echo e(clean($user->name, 'titles')); ?>" required>
                                        <div class="help-block with-errors"></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="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                    </div>
                                    <div class="form-group">
                                        <label for="email"><?php echo e(__('Email')); ?><span class="text-red">*</span></label>
                                        <input id="email" type="email" class="form-control <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="email" value="<?php echo e(clean($user->email, 'titles')); ?>" required>
                                        <div class="help-block with-errors"></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="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                    </div>

                                   
                                    <div class="form-group">
                                        <label for="password"><?php echo e(__('Password')); ?></label>
                                        <input id="password" type="password" class="form-control <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="password"  >
                                        <div class="help-block with-errors"></div>

                                        <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                    </div>
                                    <div class="form-group">
                                        <label for="password-confirm"><?php echo e(__('Confirm Password')); ?></label>
                                        <input id="password-confirm" type="password" class="form-control" name="password_confirmation">
                                        <div class="help-block with-errors"></div>
                                    </div>
                                    <div class="form-group">
                                        <label for="emp_code"><?php echo e(__('Employee Code')); ?></label>
                                        <input type="text" class="form-control" id="emp_code" name='emp_code' value="<?php echo e(clean($user->emp_code, 'titles')); ?>" placeholder="Enter Employee Code" required>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label for="role"><?php echo e(__('Assign Role')); ?><span class="text-red">*</span></label>
                                        <?php echo Form::select('role', $roles, $user_role->id??'' ,[ 'class'=>'form-control select2', 'placeholder' => 'Select Role','id'=> 'role', 'required'=>'required']); ?>

                                    </div>
                                    <div class="form-group">
                                        <label for="state_code"><?php echo e(__('State Code')); ?></label>
                                        <select name='state_code' id="state_code" class='form-control' value='Select Option'>
                                            <option value="">Select State Code</option>
                                            <?php foreach($getstatecodedata as $getstatecode){ ?>
                                             <option value='<?php echo $getstatecode->state_code; ?>' <?php if(!empty($user)): ?> <?php echo e($user->state_code == $getstatecode->state_code ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $getstatecode->state_code; ?></option>
                                             <?php } ?>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label for="dist_code"><?php echo e(__('District Code')); ?></label>
                                        <select name='dist_code' id="dist_code" class='form-control' value='Select Option'>
                                            <option value="">Select District Code</option>
                                            <?php foreach($getdistrictcodedata as $getdistrictcode){ ?>
                                             <option value='<?php echo $getdistrictcode->district_code; ?>' <?php if(!empty($user)): ?><?php echo e($user->dist_code == $getdistrictcode->district_code ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $getdistrictcode->district_code; ?></option>
                                             <?php } ?>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label for="art_centre_code"><?php echo e(__('ART Center')); ?></label>
                                        <select name='art_centre_code[]' id="art_centre_code" class='form-control' value='Select Option' multiple="">
                                            <option>Select ART Center</option>
                                            <?php $__currentLoopData = $getartcenterdata; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $getartcenter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php $artcenters = explode(', ',$user->art_centre_code); ?>
                                            <option value="<?php echo e($getartcenter->art_centre_code); ?>" <?php if(!empty($artcenters)): ?> <?php if(in_array($getartcenter->art_centre_code, $artcenters)): ?> SELECTED='SELECTED' <?php endif; ?> <?php endif; ?>><?php echo e($getartcenter->art_centre_code); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                    <input type="hidden" id="token" name="token" value="<?php echo e(csrf_token()); ?>">
                                </div>

                                <div class="col-md-12 table-responsive">
                                    <label><?php echo e(__('Permissions')); ?></label>
                                    <table class="table table-bordered p-3">
                                        <tr>
                                            <th style="width: 20%">Form Name</th>
                                            <th style="width: 20%">Add</th>
                                            <th style="width: 20%">View</th>
                                            <th style="width: 20%">Modify</th>
                                            <th style="width: 20%">Delete</th>
                                        </tr>
                                        <tr>
                                            <td>Client Registration</td>
                                            <td style="min-width: 100px;">
                                                <select name='client_reg_add' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_reg_add == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_reg_add == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td style="min-width: 100px;">
                                                <select name='client_reg_view' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_reg_view == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_reg_view == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td style="min-width: 100px;">
                                                <select name='client_reg_modify' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_reg_modify == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_reg_modify == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td style="min-width: 100px;">
                                                <select name='client_reg_delete' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_reg_delete == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_reg_delete == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Client Mapping</td>
                                            <td>
                                                <select name='client_map_add' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_map_add == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_map_add == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='client_map_view' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_map_view == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_map_view == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='client_map_modify' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_map_modify == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_map_modify == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='client_map_delete' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_map_delete == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->client_map_delete == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Outreach Input</td>
                                            <td>
                                                <select name='outreach_add' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->outreach_add == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->outreach_add == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='outreach_view' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->outreach_view == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->outreach_view == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='outreach_modify' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->outreach_modify == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->outreach_modify == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='outreach_delete' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->outreach_delete == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->outreach_delete == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Calling Input</td>
                                            <td>
                                                <select name='calling_add' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->calling_add == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->calling_add == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='calling_view' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->calling_view == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->calling_view == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='calling_modify' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->calling_modify == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->calling_modify == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='calling_delete' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->calling_delete == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->calling_delete == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>EAC Input</td>
                                            <td>
                                                <select name='eac_add' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->eac_add == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->eac_add == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='eac_view' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->eac_view == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->eac_view == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='eac_modify' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->eac_modify == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->eac_modify == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='eac_delete' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->eac_delete == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->eac_delete == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Data Entry Operator</td>
                                            <td>
                                                <select name='doe_add' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->doe_add == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->doe_add == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='doe_view' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->doe_view == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->doe_view == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='doe_modify' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->doe_modify == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->doe_modify == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td>
                                                <select name='doe_delete' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->doe_delete == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->doe_delete == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Report</td>
                                            <td>
                                                <select name='report_view' class='form-control permission_select' required>
                                                    <option value="Yes" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->report_view == "Yes" ? 'selected' : ''); ?> <?php endif; ?>>Yes</option>
                                                    <option value="No" <?php if(!empty($user_permission)): ?> <?php echo e($user_permission[0]->report_view == "No" ? 'selected' : ''); ?> <?php endif; ?>>No</option>
                                                </select>
                                            </td>
                                            <td class="text-center"></td>
                                            <td></td>
                                            <td></td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <button type="submit" class="btn btn-primary form-control-right"><?php echo e(__('Update')); ?></button>
                                    </div>
                                </div>
                            </div>
                        
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- push external js -->
    <?php $__env->startPush('script'); ?> 
        <script src="<?php echo e(asset('plugins/select2/dist/js/select2.min.js')); ?>"></script>
        <!--get role wise permissiom ajax script-->
        <script src="<?php echo e(asset('js/get-role.js')); ?>"></script>
        <script type="text/javascript">
            $( "#role" ).change(function() { 
                var role = $(this).val();
                var state_code = $('#state_code').val();
                var dist_code = $('#dist_code').val();
                $.ajax({
                    type: "POST",
                    url: "<?php echo e(url('getdistrict')); ?>",
                    data: {dist_code:dist_code,state_code:state_code,role:role, _token: '<?php echo e(csrf_token()); ?>' },
                    dataType: "json",
                    success: function(res) { 
                        $('#art_centre_code').html(res.arthtml);
                    },
                    error: function (jqXHR, exception) {

                    }
                });
            });
            $( "#state_code" ).change(function() { 
                var state_code = $(this).val();
                var role = $('#role').val();
                $.ajax({
                    type: "POST",
                    url: "<?php echo e(url('getdistrict')); ?>",
                    data: {state_code:state_code,role:role, _token: '<?php echo e(csrf_token()); ?>' },
                    dataType: "json",
                    success: function(res) { 
                        $('#dist_code').html(res.html);
                        $('#art_centre_code').html(res.arthtml);
                    },
                    error: function (jqXHR, exception) {

                    }
                });
            });
            $( "#dist_code" ).change(function() { 
                var dist_code = $(this).val();
                var role = $('#role').val();
                var state_code = $('#state_code').val();
                $.ajax({
                    type: "POST",
                    url: "<?php echo e(url('getartcenter')); ?>",
                    data: {dist_code:dist_code,state_code:state_code,role:role, _token: '<?php echo e(csrf_token()); ?>' },
                    dataType: "json",
                    success: function(res) { 
                        $('#art_centre_code').html(res.html);
                    },
                    error: function (jqXHR, exception) {

                    }
                });
            });
        </script>
    <?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/virutha/treatbuddy.virutha.xyz/resources/views/user-edit.blade.php ENDPATH**/ ?>