<?php $__env->startSection('css'); ?>
    <?php echo toastr_css(); ?>
    <link href="<?php echo e(URL::asset('assets/plugins/fileuploads/css/fileupload.css')); ?>" rel="stylesheet" type="text/css" />
    <!---Internal Fancy uploader css-->
    <link href="<?php echo e(URL::asset('assets/plugins/fancyuploder/fancy_fileupload.css')); ?>" rel="stylesheet" />
<?php $__env->startSection('title'); ?>
<?php echo e(trans('Users_trans.edit_user')); ?>

<?php $__env->stopSection(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-header'); ?>
  <!-- breadcrumb -->
<div class="page-title">
    <div class="row">
        <div class="col-sm-6">
            <h4 class="mb-0"> <?php echo e(trans('Users_trans.edit_user')); ?></h4>
        </div>
        <div class="col-sm-6">
            <ol class="breadcrumb pt-0 pr-0 float-left float-sm-right ">
                <li class="breadcrumb-item"><a href="#" class="default-color"><?php echo e(trans('main_trans.Dashboard')); ?></a></li>
                <li class="breadcrumb-item active"> <?php echo e(trans('Users_trans.edit_user')); ?></li>
            </ol>
        </div>
    </div>
</div>
 <!-- breadcrumb -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <!-- row -->
    <div class="row">
        <div class="col-md-12 mb-30">
            <div class="card card-statistics h-100">
                <div class="card-body">

                    <?php if($errors->any()): ?>
                        <div class="alert alert-danger">
                            <ul>
                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li><?php echo e($error); ?></li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo e(route('users.index')); ?>">
                        <button type="button" class="btn btn-primary l-t-20">
                            <?php echo e(trans('main_trans.back')); ?>

                        </button>
                        <br><br> 
                    </a>
                   
                            <?php echo Form::model($user, ['method' => 'PATCH','files' => 'ture','route' => ['users.update', $user->id]]); ?>

                            <?php echo csrf_field(); ?>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label><?php echo e(trans('Depts_trans.Name_Dept')); ?> : <span class="text-danger">*</span></label>
                                        <select name="dept_id" class="custom-select" <select class="custom-select"
                                            aria-label="Default select example" >
                                            <option selected ><?php echo e(trans('main_trans.Choose')); ?></option>
                                            <?php $__currentLoopData = $depts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dept): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value='<?php echo e($dept->id); ?>'<?php echo e($dept->id == $user->dept_id ? 'selected' : ''); ?>> <?php echo e($dept->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group col-md-4">
                                    <label for="title"><?php echo e(trans('main_trans.user_type')); ?></label>
                                    <select class="custom-select my-1 mr-sm-2" name="user_type">
                                        <option selected disabled><?php echo e(trans('Users_trans.Choose')); ?></option>
                                        <option value='emp'<?php echo e($user->user_type == 'emp' ? 'selected' : ''); ?>> <?php echo e(trans('main_trans.employee')); ?></option>
                                        <option value='stu'<?php echo e($user->user_type == 'stu' ? 'selected' : ''); ?>><?php echo e(trans('main_trans.student')); ?></option>
                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('isAdmin')): ?>
                                        <option value='admin'<?php echo e($user->user_type == 'admin' ? 'selected' : ''); ?>><?php echo e(trans('main_trans.admin')); ?></option>
                                         <?php endif; ?>
                                    </select>
                                    <?php $__errorArgs = ['user_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <div class="alert alert-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label><?php echo e(trans('Users_trans.full_name')); ?> : <span class="text-danger">*</span></label>
                                        <input  class="form-control" name="first_name" type="text" value="<?php echo e($user->first_name); ?>">
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label><?php echo e(trans('Users_trans.phone')); ?> : <span class="text-danger">*</span></label>
                                        <input  class="form-control" name="phone" type="text" value="<?php echo e($user->phone); ?>">
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label><?php echo e(trans('Users_trans.email')); ?> : <span class="text-danger">*</span></label>
                                        <input  class="form-control" name="email" type="text" value="<?php echo e($user->email); ?>">
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label><?php echo e(trans('Users_trans.password')); ?> : <span class="text-danger">*</span></label>
                                        <input  class="form-control" name="password" type="text" value="">
                                    </div>
                                </div>
                            </div>

                           
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <strong><?php echo e(trans('Users_trans.user_type')); ?></strong>
                                        <?php echo Form::select('roles[]', $roles,$userRole, array('class' => 'form-control','multiple')); ?>

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

                            <div class="d-flex justify-content-center">
                                <button type="submit" class="btn btn-primary btn-lg"><?php echo e(trans('Certificat_trans.Edit')); ?></button>
                            </div>
                            
                        </form>
                        <br><br>
                </div>
            </div>
        </div>
    </div>
    <!-- row closed -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <?php echo toastr_js(); ?>
    <?php echo app('toastr')->render(); ?>
    <script src="<?php echo e(URL::asset('assets/plugins/fileuploads/js/fileupload.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('assets/plugins/fileuploads/js/file-upload.js')); ?>"></script>
    <!--Internal Fancy uploader js-->
    <script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/jquery.ui.widget.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/jquery.fileupload.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/jquery.iframe-transport.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/jquery.fancy-fileupload.js')); ?>"></script>
    <script src="<?php echo e(URL::asset('assets/plugins/fancyuploder/fancy-uploader.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/eustedu/Certificates/resources/views/pages/users/edit.blade.php ENDPATH**/ ?>