<?php $__env->startSection('content'); ?>
<style type="text/css">
    .col-6 {
        margin-top: 10px;
    }

    .required {
        font-weight: 800;
        color: red;
    }

    label {
        font-weight: 600;
    }
</style>
<div class="content-wrapper">
    <div class="content-body">
        <form method="GET">
            <div class="row">
                <div class="col-md-2">
                    <div class="form-group">
                        <input type="text" name="name" value="<?php echo e(($request->name)?: ''); ?>"
                            class="form-control" placeholder="Enter Name">
                    </div>
                </div>
                <div class="col-md-2">
                    <div class="form-group">
                        <input type="email" name="email"
                            value="<?php echo e(($request->email)?: ''); ?>" class="form-control"
                            placeholder="Enter Email">
                    </div>
                </div>
                <div class="col-md-2">
                    <div class="form-group">
                        <input type="text" name="phone" value="<?php echo e(($request->phone)?: ''); ?>"
                            class="form-control" placeholder="Enter Phone">
                    </div>
                </div>
                <div class="col-md-1">
                    <div class="form-group">
                        <select class="form-control" name="type">
                            <option value="">All Type</option>
                            <option value="1"
                                <?php echo e(($request->type == 1)? 'selected' : ''); ?>>
                                UK</option>
                            <option value="2"
                                <?php echo e(($request->type == 2)? 'selected' : ''); ?>>
                                BD</option>
                        </select>
                    </div>
                </div>
                <div class="col-md-2">
                    <div class="form-inline">
                        <button type="submit" class="btn btn-success"><i class="fa fa-search"></i></button>
                        <a href="<?php echo e(url('employee')); ?>"><button type="button"
                                style="margin-left: 5px;" class="btn btn-warning"><i
                                    class="fa fa-refresh"></i></button></a>
                    </div>
                </div>
            </div>
        </form>
        <!-- Table Hover Animation start -->
        <div class="row" id="table-hover-animation">
            <div class="col-12">
                <div class="card">
                    <div class="card-header">
                        <h4 class="card-title"><?php echo e($title); ?> List</h4>
                        <button class="btn btn-info btn-sm" style="float: right;" data-toggle="modal"
                            data-target="#large"><i class="fa fa-plus"></i> Add <?php echo e($title); ?></button>

                    </div>

                    <div class="card-content">
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-bordered table-striped table-hover-animation mb-0">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Web Status</th>
                                            <th>Employee Type</th>
                                            <th>Name</th>
                                            <th>User Name</th>
                                            <th>Password</th>
                                            <th>Office Phone</th>
                                            <th>Email</th>
                                            <th>Status</th>
                                            <th>Photo</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__currentLoopData = $employess; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td><?php echo e(++$key); ?></td>
                                                <td>
                                                    <?php if($list->user): ?>
                                                        <?php if($list->user->isOnline()): ?>
                                                            <span>
                                                                <div class="bullet bullet-sm bullet-success"></div>
                                                                Online
                                                            </span>
                                                        <?php else: ?>
                                                            <span>
                                                                <div class="bullet bullet-sm bullet-danger"></div>
                                                                Offline
                                                            </span>
                                                            <?php if($list->user->last_seen): ?>
                                                                <br>
                                                                <small>Last Seen:
                                                                    <?php echo e(\Carbon\Carbon::parse($list->user->last_seen)->diffForHumans()); ?></small>
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                    <?php endif; ?>
                                                </td>
                                                <td>
                                                    <?php if($list->type == 1): ?>
                                                        <button class="btn btn-primary btn-sm">UK Employee</button>
                                                    <?php elseif($list->type == 2): ?>
                                                        <button class="btn btn-warning btn-sm">BD Employee</button>
                                                    <?php else: ?>
                                                        --
                                                    <?php endif; ?>
                                                </td>
                                                <td><?php echo e($list->name); ?></td>
                                                <td><?php echo e($list->user->username); ?></td>
                                                <td><?php echo e($list->user->temp_password); ?></td>
                                                <td><?php echo e($list->office_phone); ?></td>
                                                <td><?php echo e($list->office_email); ?></td>
                                                <td>
                                                    <?php if($list->status == 1): ?>
                                                        <button class="btn btn-success btn-sm">Active</button>
                                                    <?php elseif($list->status == 2): ?>
                                                        <button class="btn btn-danger btn-sm">Proccessing</button>
                                                    <?php else: ?>
                                                        --
                                                    <?php endif; ?>
                                                </td>
                                                <td><img src="<?php echo e(asset('storage/uploads/'.$list->user->photo)); ?>"
                                                        width="50"></td>
                                                <td>
                                                    <button
                                                        onclick="return editData( <?php echo e(json_encode($list)); ?> , <?php echo e(json_encode($list->emg_contact)); ?>)"
                                                        class="btn btn-primary btn-sm"><i
                                                            class="fa fa-edit"></i></button>
                                                    
                                                </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            </div>
                            <div class="paginate" style="float: right;">
                                <?php echo $employess->links(); ?>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Table head options end -->

        <!-- Modal -->
        <div class="modal fade" id="large" role="dialog" aria-labelledby="myModalLabel17" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="myModalLabel17">Add <?php echo e($title); ?></h4>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <form method="POST" action="<?php echo e(url('employee')); ?>" enctype="multipart/form-data">
                        <?php echo csrf_field(); ?>
                        <div class="modal-body">
                            <!-- col -->
                            <hr>
                            <h4 class="text-center">Particullar Infomration</h4>
                            <hr>
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Employee Type <span class="required">*</span></label>
                                    <select name="type" class="form-control" required="">
                                        <option value="">Select Employee Type</option>
                                        <option value="1">UK Employee</option>
                                        <option value="2">BD Employee</option>
                                    </select>
                                </div>
                                <div class="col-6 form group">
                                    <label>Employee Name <span class="required">*</span></label>
                                    <input type="text" name="name" class="form-control"
                                        placeholder="Enter Employee Name" required="">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Personal Contact Number <span class="required">*</span></label>
                                    <input type="text" name="contact_number" class="form-control"
                                        placeholder="Enter Personal Contact Number" required="">
                                </div>
                                <div class="col-6 form group">
                                    <label>Office Contact Number <span class="required">*</span></label>
                                    <input type="text" name="office_contact_number" class="form-control"
                                        placeholder="Enter Office Contact Number" required="">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Personal Email <span class="required">*</span></label>
                                    <input type="email" name="email" class="form-control"
                                        placeholder="Enter Personal Email" required="">
                                </div>
                                <div class="col-6 form group">
                                    <label>Office Email <span class="required">*</span></label>
                                    <input type="email" name="office_email" class="form-control"
                                        placeholder="Enter Office Email" required="">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Present Address <span class="required">*</span></label>
                                    <textarea name="pre_address" class="form-control"
                                        placeholder="Enter Present Address" required=""></textarea>
                                </div>
                                <div class="col-6 form group">
                                    <label>Permanet Addres <span class="required">*</span></label>
                                    <textarea name="per_address" class="form-control"
                                        placeholder="Enter Permanet Addres" required=""></textarea>
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-4 form group">
                                    <label>Marital Status<span class="required">*</span></label>
                                    <select name="marital_status" class="form-control" required="">
                                        <option value="">Select Marital Status</option>
                                        <option value="1">Married</option>
                                        <option value="2">UnMarried</option>
                                    </select>
                                </div>
                                <div class="col-4 form group">
                                    <label>Gender<span class="required">*</span></label>
                                    <select name="gender" class="form-control" required="">
                                        <option value="">Select Gender</option>
                                        <option value="1">Male</option>
                                        <option value="2">FeMale</option>
                                        <option value="3">Others</option>
                                    </select>
                                </div>
                                <div class="col-4 form group">
                                    <label>Religion<span class="required">*</span></label>
                                    <select name="religion" class="form-control" required="">
                                        <option value="">Select Religion</option>
                                        <option value="Islam" selected="selected">Islam</option>
                                        <option value="Hinduism">Hinduism</option>
                                        <option value="Christian">Christian</option>
                                        <option value="Buddhist">Buddhist</option>
                                        <option value="Others">Others</option>
                                    </select>
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Father Name</label>
                                    <textarea name="f_name" class="form-control"
                                        placeholder="Enter Father Name"></textarea>
                                </div>
                                <div class="col-6 form group">
                                    <label>Father Nid </label>
                                    <textarea name="f_nid" class="form-control"
                                        placeholder="Enter Father NID"></textarea>
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Mother Name</label>
                                    <textarea name="m_name" class="form-control"
                                        placeholder="Enter Mother Name"></textarea>
                                </div>
                                <div class="col-6 form group">
                                    <label>Mother Nid </label>
                                    <textarea name="m_nid" class="form-control"
                                        placeholder="Enter Mother NID"></textarea>
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Spouse Name</label>
                                    <textarea name="spouse_name" class="form-control"
                                        placeholder="Enter Spouse Name"></textarea>
                                </div>
                                <div class="col-6 form group">
                                    <label>Spouse Nid </label>
                                    <textarea name="spouse_nid" class="form-control"
                                        placeholder="Enter Spouse NID"></textarea>
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Date of joining</label>
                                    <input type="date" name="doj" class="form-control">
                                </div>
                                <div class="col-6 form group">
                                    <label>Date of Birth<span class="required">*</span></label>
                                    <input type="date" name="dob" class="form-control" required="">
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Department<span class="required">*</span></label>
                                    <select name="department" class="form-control" required="">
                                        <option value="">Select Department</option>
                                        <?php $__currentLoopData = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($val->id); ?>"><?php echo e($val->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                                <div class="col-6 form group">
                                    <label>Designation<span class="required">*</span></label>
                                    <select name="designation" class="form-control" required="">
                                        <option value="">Select Designation</option>
                                        <?php $__currentLoopData = $designastion; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $design): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($design->id); ?>"><?php echo e($design->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                            <div class="row">

                                <div class="col-6 form group">
                                    <label>Projects<span class="required">*</span></label>
                                    <select name="project_id[]" class="form-control select2" required=""
                                        multiple="multiple">
                                        <?php $__currentLoopData = $projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($project->id); ?>"><?php echo e($project->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>

                                <div class="col-6 form group">
                                    <label>Deserved holiday</label>
                                    <input type="text" name="holiday" class="form-control">
                                </div>


                            </div>
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Photo</label>
                                    <input type="file" class="form-control" name="image">
                                </div>
                                <div class="col-6 form group">
                                    <label>Status<span class="required">*</span></label>
                                    <select class="form-control" name="status" required="">
                                        <option value="1">Active</option>
                                        <option value="2">InActive</option>
                                    </select>
                                </div>
                            </div>
                            <!-- col -->
                            <div class="form-group">
                                <label>Education<span class="required">*</span></label>
                                <textarea class="form-control" name="education"
                                    placeholder="Enter Educational Qualification"></textarea>
                            </div>
                            <!-- col -->
                            <hr>
                            <h4 class="text-center">Emergency Contact Person</h4>
                            <hr>
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Contact Person Name</label>
                                    <input type="text" name="emg_con_name" class="form-control"
                                        placeholder="Enter Contact Person Name">
                                </div>
                                <div class="col-6 form group">
                                    <label>Contact Person NID</label>
                                    <input type="text" name="emg_con_nid" class="form-control"
                                        placeholder="Enter Contact Person NID">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Contact Person Phone</label>
                                    <input type="text" name="emg_con_phone" class="form-control"
                                        placeholder="Enter Contact Person Phone">
                                </div>
                                <div class="col-6 form group">
                                    <label>Contact Person Email</label>
                                    <input type="email" name="emg_con_email" class="form-control"
                                        placeholder="Enter Contact Person Email">
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Relation With you</label>
                                    <input type="text" name="emg_relation" class="form-control"
                                        placeholder="Enter Relation With you">
                                </div>
                                <div class="col-6 form group">
                                    <label>Contact Person Photo</label>
                                    <input type="file" class="form-control" name="emg_image">
                                </div>
                            </div>
                            <!-- col -->
                            <hr>
                            <h4 class="text-center">Login Info</h4>
                            <hr>
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>User Name<span class="required">*</span></label>
                                    <input type="text" name="username" class="form-control"
                                        placeholder="Enter User Name" required="">
                                </div>
                                <div class="col-6 form group">
                                    <label>Password <span class="required">*</span></label>
                                    <input type="password" class="form-control" name="password"
                                        placeholder="Enter Password" required="">
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>User Role<span class="required">*</span></label>
                                    <select class="form-control" name="role">
                                        <option value="">Select User Role</option>
                                        <option value="1">Admin</option>
                                        <option value="2">General Employee</option>
                                        <option value="3">DP Head</option>
                                        <option value="4">HR</option>
                                    </select>
                                </div>
                                <div class="col-6 form group">
                                    <label>User Status<span class="required">*</span></label>
                                    <select class="form-control" name="user_status" required="">
                                        <option value="1">Active</option>
                                        <option value="2">InActive</option>
                                    </select>
                                </div>
                            </div>
                            <!-- col -->
                        </div>
                        <div class="modal-footer">
                            <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <!-- Modal -->
        <div class="modal fade" id="editModal" role="dialog" aria-labelledby="myModalLabel17" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="myModalLabel17">Update <?php echo e($title); ?></h4>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <form method="POST" action="<?php echo e(url('employee-update')); ?>"
                        enctype="multipart/form-data">
                        <?php echo csrf_field(); ?>
                        <div class="modal-body">
                            <!-- col -->
                            <hr>
                            <h4 class="text-center">Particular Infomration</h4>
                            <hr>
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Employee Type <span class="required">*</span></label>
                                    <select name="type" id="type" class="form-control" required="">
                                        <option value="">Select Employee Type</option>
                                        <option value="1">UK Employee</option>
                                        <option value="2">BD Employee</option>
                                    </select>
                                </div>
                                <div class="col-6 form group">
                                    <label>Employee Name <span class="required">*</span></label>
                                    <input type="text" name="name" id="name" class="form-control"
                                        placeholder="Enter Employee Name" required="">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Personal Contact Number <span class="required">*</span></label>
                                    <input type="text" name="contact_number" id="contact_number" class="form-control"
                                        placeholder="Enter Personal Contact Number" required="">
                                </div>
                                <div class="col-6 form group">
                                    <label>Office Contact Number <span class="required">*</span></label>
                                    <input type="text" name="office_contact_number" id="office_contact_number"
                                        class="form-control" placeholder="Enter Office Contact Number" required="">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Personal Email <span class="required">*</span></label>
                                    <input type="email" name="email" id="email" class="form-control"
                                        placeholder="Enter Personal Email" required="">
                                </div>
                                <div class="col-6 form group">
                                    <label>Office Email <span class="required">*</span></label>
                                    <input type="email" name="office_email" id="office_email" class="form-control"
                                        placeholder="Enter Office Email" required="">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Present Address <span class="required">*</span></label>
                                    <textarea name="pre_address" id="pre_address" class="form-control"
                                        placeholder="Enter Present Address" required=""></textarea>
                                </div>
                                <div class="col-6 form group">
                                    <label>Permanet Addres <span class="required">*</span></label>
                                    <textarea name="per_address" id="per_address" class="form-control"
                                        placeholder="Enter Permanet Addres" required=""></textarea>
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-4 form group">
                                    <label>Marital Status<span class="required">*</span></label>
                                    <select name="marital_status" id="marital_status" class="form-control" required="">
                                        <option value="">Select Marital Status</option>
                                        <option value="1">Married</option>
                                        <option value="2">UnMarried</option>
                                    </select>
                                </div>
                                <div class="col-4 form group">
                                    <label>Gender<span class="required">*</span></label>
                                    <select name="gender" id="gender" class="form-control" required="">
                                        <option value="">Select Gender</option>
                                        <option value="1">Male</option>
                                        <option value="2">FeMale</option>
                                        <option value="3">Others</option>
                                    </select>
                                </div>
                                <div class="col-4 form group">
                                    <label>Religion<span class="required">*</span></label>
                                    <select name="religion" id="religion" class="form-control" required="">
                                        <option value="">Select Religion</option>
                                        <option value="Islam" selected="selected">Islam</option>
                                        <option value="Hinduism">Hinduism</option>
                                        <option value="Christian">Christian</option>
                                        <option value="Buddhist">Buddhist</option>
                                        <option value="Others">Others</option>
                                    </select>
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Father Name</label>
                                    <textarea name="f_name" id="f_name" class="form-control"
                                        placeholder="Enter Father Name"></textarea>
                                </div>
                                <div class="col-6 form group">
                                    <label>Father Nid </label>
                                    <textarea name="f_nid" id="f_nid" class="form-control"
                                        placeholder="Enter Father NID"></textarea>
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Mother Name</label>
                                    <textarea name="m_name" id="m_name" class="form-control"
                                        placeholder="Enter Mother Name"></textarea>
                                </div>
                                <div class="col-6 form group">
                                    <label>Mother Nid </label>
                                    <textarea name="m_nid" id="m_nid" class="form-control"
                                        placeholder="Enter Mother NID"></textarea>
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Spouse Name</label>
                                    <textarea name="spouse_name" id="spouse_name" class="form-control"
                                        placeholder="Enter Spouse Name"></textarea>
                                </div>
                                <div class="col-6 form group">
                                    <label>Spouse Nid </label>
                                    <textarea name="spouse_nid" id="spouse_nid" class="form-control"
                                        placeholder="Enter Spouse NID"></textarea>
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Date of joining</label>
                                    <input type="date" name="doj" id="doj" class="form-control">
                                </div>
                                <div class="col-6 form group">
                                    <label>Date of Birth<span class="required">*</span></label>
                                    <input type="date" name="dob" id="dob" class="form-control" required="">
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Department<span class="required">*</span></label>
                                    <select name="department" id="department" class="form-control" required="">
                                        <option value="">Select Department</option>
                                        <?php $__currentLoopData = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($val->id); ?>"><?php echo e($val->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                                <div class="col-6 form group">
                                    <label>Designation<span class="required">*</span></label>
                                    <select name="designation" id="designation" class="form-control" required="">
                                        <option value="">Select Designation</option>
                                        <?php $__currentLoopData = $designastion; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $design): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($design->id); ?>"><?php echo e($design->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                            <div class="row">

                                <div class="col-6 form group">
                                    <label>Projects<span class="required">*</span></label>

                                    <select name="project_id[]" id="project_ids" class="form-control select2" required="" multiple="multiple">
                                        <?php $__currentLoopData = $projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($project->id); ?>"><?php echo e($project->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>

                                </div>

                                <div class="col-6 form group">
                                    <label>Deserved holiday</label>
                                    <input type="text" name="holiday" class="form-control" id="holiday">
                                </div>

                            </div>
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <img src="" width="60" id="emp_imgage">
                                    <br>
                                    <label>Photo</label>
                                    <input type="file" class="form-control" name="image">
                                </div>
                                <div class="col-6 form group">
                                    <label>Status<span class="required">*</span></label>
                                    <select class="form-control" id="status" name="status" required="">
                                        <option value="1">Active</option>
                                        <option value="2">InActive</option>
                                    </select>
                                </div>
                            </div>
                            <!-- col -->
                            <div class="form-group">
                                <label>Education<span class="required">*</span></label>
                                <textarea class="form-control" id="education" name="education"
                                    placeholder="Enter Educational Qualification"></textarea>
                            </div>
                            <!-- col -->
                            <hr>
                            <h4 class="text-center">Emergency Contact Person</h4>
                            <hr>
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Contact Person Name</label>
                                    <input type="text" id="emg_con_name" name="emg_con_name" class="form-control"
                                        placeholder="Enter Contact Person Name">
                                </div>
                                <div class="col-6 form group">
                                    <label>Contact Person NID</label>
                                    <input type="text" id="emg_con_nid" name="emg_con_nid" class="form-control"
                                        placeholder="Enter Contact Person NID">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Contact Person Phone</label>
                                    <input type="text" id="emg_con_phone" name="emg_con_phone" class="form-control"
                                        placeholder="Enter Contact Person Phone">
                                </div>
                                <div class="col-6 form group">
                                    <label>Contact Person Email</label>
                                    <input type="email" id="emg_con_email" name="emg_con_email" class="form-control"
                                        placeholder="Enter Contact Person Email">
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>Relation With you</label>
                                    <input type="text" id="emg_relation" name="emg_relation" class="form-control"
                                        placeholder="Enter Relation With you">
                                </div>
                                <div class="col-6 form group">
                                    <label>Contact Person Photo</label>
                                    <input type="file" class="form-control" name="emg_image">
                                </div>
                            </div>
                            <!-- col -->

                            <!-- col -->
                            <hr>
                            <h4 class="text-center">Login Info</h4>
                            <hr>
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>User Name<span class="required">*</span></label>
                                    <input type="text" name="username" id="username" class="form-control"
                                        placeholder="Enter User Name" required="">
                                </div>
                                <div class="col-6 form group">
                                    <label>Password <span class="required">*</span></label>
                                    <input type="password" class="form-control" id="password" name="password"
                                        placeholder="Enter Password" required="">
                                </div>
                            </div>
                            <!-- col -->
                            <!-- col -->
                            <div class="row">
                                <div class="col-6 form group">
                                    <label>User Role<span class="required">*</span></label>
                                    <select class="form-control" id="role" name="role">
                                        <option value="">Select User Role</option>
                                        <option value="1">Admin</option>
                                        <option value="2">General Employee</option>
                                        <option value="3">DP Head</option>
                                        <option value="4">HR</option>
                                    </select>
                                </div>
                                <div class="col-6 form group">
                                    <label>User Status<span class="required">*</span></label>
                                    <select class="form-control" id="user_status" name="user_status" required="">
                                        <option value="1">Active</option>
                                        <option value="2">InActive</option>
                                    </select>
                                </div>
                            </div>
                            <!-- col -->
                        </div>
                        <input type="hidden" name="employee_id" id="employee_id">
                        <div class="modal-footer">
                            <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>

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

<?php $__env->startPush('js'); ?>
    <script type="text/javascript">
        function editData(value, emg_contact) {
            $("#project_ids").val(null).trigger('change');
            $('#editModal').modal('show');
            $('#employee_id').val(value.id)
            $('#type').val(value.type)
            $('#name').val(value.name)
            $('#contact_number').val(value.phone)
            $('#office_contact_number').val(value.office_phone)
            $('#email').val(value.per_email)
            $('#office_email').val(value.office_email)
            $('#pre_address').val(value.pre_address)
            $('#mailing_address').val(value.name)
            $('#per_address').val(value.per_address)
            $('#marital_status').val(value.maritial_status)
            $('#gender').val(value.gender)
            $('#religion').val(value.religion_status)
            $('#f_name').val(value.f_name)
            $('#f_nid').val(value.f_nid)
            $('#m_name').val(value.m_name)
            $('#m_nid').val(value.m_nid)
            $('#spouse_name').val(value.spouse_name)
            $('#spouse_nid').val(value.spouse_nid)
            $('#dob').val(value.dob)
            $('#department').val(value.department_id)
            $('#designation').val(value.designastion)
            $('#doj').val(value.date_of_joining)
            $('#education').val(value.education)
            $('#status').val(value.status)
            $('#emp_imgage').attr('src', 'storage/uploads/' + value.photo)

            $('#emg_con_name').val(emg_contact.name)
            $('#emg_relation').val(emg_contact.relation)
            $('#emg_con_nid').val(emg_contact.nid)
            $('#emg_con_phone').val(emg_contact.number)
            $('#emg_con_email').val(emg_contact.email)

            $('#username').val(value.user.username)
            $('#password').val(value.user.temp_password)
            $('#role').val(value.user.role)
            $('#user_status').val(value.user.status)
            if(value.holiday){
                $('#holiday').val(value.holiday.holiday)
            }else{
                $('#holiday').val('')
            }
            var project_ids = [];
            if(value.projects.length){
                $.each(value.projects, function(i, item) {
                    project_ids.push(item.pivot.project_id)
                });
                $.each(project_ids, function(i,e){
                    $("#project_ids option[value='" + e + "']").prop("selected", true);
                });
            }
            $(".select2").select2();
            $('.select2-container').css('width', '100%');
        }
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/cdefsvx5gulk/public_html/urportals.com/app_doc/resources/views/pages/employee.blade.php ENDPATH**/ ?>