<?php if (isset($component)) { $__componentOriginalfcbcb094a4e25784fc05a845b0fe2686439b0eb5 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\AdminPanelLayout::class, []); ?>
<?php $component->withName('admin-panel-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('title'); ?>
        ویرایش کاربر
     <?php $__env->endSlot(); ?>
     <?php $__env->slot('main'); ?>
        <!-- Checked checkbox -->
        <div class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1 class="m-0 text-dark">ویرایش کاربر : <?php echo e($user->name ?? $user->mobile); ?></h1>
                    </div><!-- /.col -->
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-left">

                            <li class="breadcrumb-item">مدیریت کاربران</li>
                            <li class="breadcrumb-item active">ویرایش کاربر</li>
                        </ol>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.container-fluid -->
        </div>
        <section class="content mt-sm-3">
            <div class="card p-0 card-primary col-md-8 mx-auto">
                <div class="card-header">
                    <h3 class="card-title">ویرایش کاربر</h3>
                </div>
                <!-- /.card-header -->
                <!-- form start -->
                <form class="mt-3 p-2" action="<?php echo e(route('users.update',$user->id)); ?>" method="post"
                      enctype="multipart/form-data">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PATCH'); ?>
                    <div class="form-group">
                        <p>موبایل</p>
                        <input type="number" name='mobile' class="form-control" id="mobile"
                               placeholder="موبایل *" value="<?php echo e(old('mobile',$user->mobile)); ?>" required>
                        <?php $__errorArgs = ['mobile'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="form-group">
                        <p>رمز عبور</p>
                        <input type="password" name='password' class="form-control" id="password"
                               placeholder="رمز عبور(تنها در صورت وارد کردن آپدیت میشود)" value="<?php echo e(old('password')); ?>">
                        <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="form-group">
                        <p>نام</p>
                        <input type="text" name='name' class="form-control" id="name"
                               placeholder="نام" value="<?php echo e(old('name',$user->name)); ?>">
                        <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="form-group">
                        <p>نام خانوادگی</p>
                        <input type="text" name='lname' class="form-control" id="lname"
                               placeholder="نام خانوادگی" value="<?php echo e(old('lname',$user->lname)); ?>">
                        <?php $__errorArgs = ['lname'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="form-group">
                        <p>کد ملی</p>
                        <input type="number" name='national_code' class="form-control" id="national_code"
                               placeholder="کد ملی" value="<?php echo e(old('national_code',$user->national_code)); ?>">
                        <?php $__errorArgs = ['national_code'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="form-group">
                        <p>ایمیل</p>
                        <input type="email" name='email' class="form-control" id="email"
                               placeholder="ایمیل" value="<?php echo e(old('email',$user->email)); ?>">
                        <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <p>وضعیت اکانت</p>
                    <div class="form-group">
                        <select name='status' class="form-control" id="status">
                            <?php $__currentLoopData = Mehrab\User\Models\User::$status; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($status); ?>" <?php echo e($user->status == $status ? 'selected' : ''); ?>>
                                    <?php echo app('translator')->get($status); ?>
                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                        <?php $__errorArgs = ['status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="form-group">
                        <p>موجودی</p>
                        <input type="number" name='amount' class="form-control" id="amount"
                               placeholder="موجودی کیف پول پیشفرض 0" value="<?php echo e(old('amount',$user->amount)); ?>">
                        <?php $__errorArgs = ['amount'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <?php if($user->address): ?>
                        <?php $__currentLoopData = $user->address; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $address): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <p>ادرس <?php echo e(++$loop->index); ?></p>
                            <div class="form-group">
                                <input type="number" name='<?php echo e('zip_code['.$loop->index.']'); ?>' class="form-control" id="zip_code"
                                       placeholder="کد پستی <?php echo e($loop->index); ?>"
                                       value="<?php echo e(old('zip_code',$address['zip_code'])); ?>">
                                <?php $__errorArgs = ['zip_code'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid">
                                    <p class="text-danger"
                                       style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                                </div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                <?php $__errorArgs = ['zip_code.*'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid">
                                    <p class="text-danger"
                                       style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                                </div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="form-group">
                                 <textarea name='<?php echo e('address['.$loop->index.']'); ?>' class="form-control" id="address"
                                  placeholder="آدرس کد پستی <?php echo e($loop->index); ?>"><?php echo e(old('address',$address['address'])); ?></textarea>
                                <?php $__errorArgs = ['address'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid">
                                    <p class="text-danger"
                                       style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                                </div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                <?php $__errorArgs = ['address.*'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid">
                                    <p class="text-danger"
                                       style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                                </div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                    <div class="form-group mx-auto my-2 d-flex justify-content-center">
                        <?php if($user->profile_pic): ?>
                            <img src="<?php echo e($user->thumb()); ?>" class="mx-auto" style="width: 10rem;height: 10rem" />
                        <?php else: ?>
                            بدون تصویر پروفایل
                        <?php endif; ?>
                    </div>
                    <?php if($user->profile_pic): ?>
                        <div class="form-group form-check mx-auto d-flex">
                            <input type="checkbox" name="delـprofile_pic" class="form-check-input"
                                   id="del_profile_pic_pic">
                            <label class="form-check-label" for="delPic">حذف تصویر پروفایل</label>
                        </div>
                    <?php endif; ?>
                    <div class="custom-file mb-sm-2 mb-5 withImgProf mx-auto">
                        <input type="file" name="profile_pic"
                               class="custom-file-input <?php $__errorArgs = ['profile_pic'];
$__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); ?> "
                               id="customFile" accept="image/*" value="<?php echo e(old('profile_pic')); ?>">
                        <?php $__errorArgs = ['profile_pic'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        <label class="custom-file-label paddingRight text-muted small" for="customFile">انتخاب
                            عکس پروفایل
                            (اختیاری)</label>

                    </div>
                    <div class="form-group mx-auto my-2 d-flex justify-content-center">
                        <?php if($user->certificate_pic): ?>
                            <img src="<?php echo e($user->DownloadLink_certificate_pic()); ?>" class="mx-auto"
                                 style="width: 6rem;height: 6rem">
                        <?php else: ?>
                            بدون تصویر شناسنامه
                        <?php endif; ?>
                    </div>
                    <?php if($user->certificate_pic): ?>
                        <div class="form-group form-check mx-auto d-flex">
                            <input type="checkbox" name="delـcertificate_pic" class="form-check-input"
                                   id="del_certificate_pic">
                            <label class="form-check-label" for="delPic">حذف تصویر شناسنامه</label>
                        </div>
                    <?php endif; ?>
                    <div class="custom-file mb-sm-2 mb-5 withImgProf mx-auto">
                        <input type="file" name="certificate_card_pic"
                               class="custom-file-input <?php $__errorArgs = ['certificate_card_pic'];
$__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); ?>"
                               id="customFile" accept="image/*" value="<?php echo e(old('certificate_card_pic')); ?>">
                        <?php $__errorArgs = ['certificate_card_pic'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        <label class="custom-file-label paddingRight text-muted small" for="customFile">انتخاب
                            تصویر شناسنامه
                            (اختیاری)</label>

                    </div>
                    <div class="form-group mx-auto my-2 d-flex justify-content-center">
                        <?php if($user->national_pic): ?>
                            <img src="<?php echo e($user->DownloadLink_national_pic()); ?>" class="mx-auto"
                                 style="width: 10rem;height: 10rem">
                        <?php else: ?>
                            بدون تصویر کارت ملی
                        <?php endif; ?>
                    </div>
                    <?php if($user->national_card_pic_id): ?>
                        <div class="form-group form-check mx-auto d-flex">
                            <input type="checkbox" name="del_national_card_pic_id" class="form-check-input"
                                   id="del_national_card_pic_id">
                            <label class="form-check-label" for="delPic">حذف تصویر کارت ملی</label>
                        </div>
                    <?php endif; ?>
                    <div class="custom-file mb-sm-2 mb-5 withImgProf mx-auto">
                        <input type="file" name="national_card_pic"
                               class="custom-file-input <?php $__errorArgs = ['national_card_pic'];
$__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); ?>"
                               id="customFile" accept="image/*" value="<?php echo e(old('national_card_pic')); ?>">
                        <?php $__errorArgs = ['national_card_pic'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        <label class="custom-file-label paddingRight text-muted small" for="customFile">انتخاب
                            تصویر کارت ملی
                            (اختیاری)</label>

                    </div>
                    <button type="submit" class="btn btn-primary btn-block mt-3">ثبت</button>
                </form>
            </div>
        </section>
     <?php $__env->endSlot(); ?>
    <?php if(session()->get('status') == 'updated'): ?>
         <?php $__env->slot('linkScript'); ?>
            <script>
                Swal.fire({
                    icon: 'success',
                    text: 'ویرایش کاربر با موفقیت انجام شد',
                })
            </script>
         <?php $__env->endSlot(); ?>
    <?php endif; ?>
 <?php if (isset($__componentOriginalfcbcb094a4e25784fc05a845b0fe2686439b0eb5)): ?>
<?php $component = $__componentOriginalfcbcb094a4e25784fc05a845b0fe2686439b0eb5; ?>
<?php unset($__componentOriginalfcbcb094a4e25784fc05a845b0fe2686439b0eb5); ?>
<?php endif; ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php /**PATH /home/foroshg1/laravel/Modules/Mehrab/User/Providers/../Resources/Views//Admin/edit_user.blade.php ENDPATH**/ ?>
