<link rel="stylesheet" href="<?php echo base_url();?>assets/js/validationEngine.jquery.css" type="text/css" />
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/cust_paginition.css" type="text/css" />
<div class="" id="addUserProfile">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- Modal heading -->
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 class="modal-title" align="center">Update Users Details</h3>
            </div>
            <!-- // Modal heading END -->
            <!-- Modal body -->
            <div class="modal-body">
                <div class="innerAll">
                    <div class="innerLR">
                        <div class = "form-group mmar" id="all_msgs" style="text-align: center"></div>
                        <form class="form-horizontal" role="form" id="add_user" method="post" action="<?php echo base_url();?>index.php/users/update_user">
                            <div class="form-group mmar">
                                <label  class="col-sm-3 control-label text-center">First Name: </label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control validate[required,custom[onlyLetterSp]] text-input" value="<?php echo $user_information['first_name'] ?>" id="first_name" name="first_name"/>
                                </div>
                            </div>
                            <div class="form-group mmar">
                                <label  class="col-sm-3 control-label text-center">Last Name: </label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control validate[required,custom[onlyLetterSp]] text-input" value="<?php echo $user_information['last_name'] ?>" id="last_name" name="last_name"/>
                                </div>
                            </div>
                            <div class="form-group mmar">
                                <label  class="col-sm-3 control-label text-center">Username: </label>
                                <div class="col-sm-6">
                                    <input type="text" id="username" name="username" class="form-control validate[required] text-input" placeholder="Auto Generated" value="<?php echo $user_information['username'] ?>"/>
                                </div>

                            </div>
                            <div class="form-group mmar">
                                <label  class="col-sm-3 control-label text-center">Password: </label>
                                <div class="col-sm-6">
                                    <input type="password" id="password" name="password" class="form-control validate[required] text-input" placeholder="Auto Generated" value="<?php echo $user_information['password'] ?>"/>
                                </div>

                            </div>
                            <div class="form-group mmar">
                                <label  class="col-sm-3 control-label text-center">Confirm Password: </label>
                                <div class="col-sm-6">
                                    <input type="password" id="c_password" name="c_password" class="form-control validate[required,equals[password]] text-input" placeholder="Auto Generated" value="<?php echo $user_information['password'] ?>"/>
                                </div>

                            </div>

                            <div class="form-group mmar">
                                <!--<label  class="col-sm-3 control-label text-center">Designation: </label>
                                <div class="col-sm-3">
                                    <select class="cust_select col-md-3 marl-n validate[required] text-input" name="designation">
                                        <option value="">--Select--</option>
                                        <option value="1">Designation 1</option>
                                        <option value="2">Designation 2</option>
                                    </select>
                                </div> -->
                                <label  class="col-sm-3 control-label text-center">Access Role: </label>
                                <div class="col-sm-3">
                                    <select class="cust_select col-md-3 marl-n validate[required] text-input" name="access_roles">
                                        <option value="">--Select--</option>
                                        <?php foreach($access_roles as $role) {?>
                                            <option value="<?php echo $role['id'];?>"
                                               <?php if ($user_information['access_role'] == $role['id']) {?>
                                                        selected="selected"
                                                   <?php } ?>
                                                ><?php echo ucwords($role['name']);?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <!-- <label  class="col-sm-3 control-label text-center">Status: </label>
                            <div class="col-sm-3">
                                <select class="selectpicker col-md-3 marl-n validate[required] text-input">
                                    <option>Select Status</option>
                                    <option>Status 1</option>
                                    <option>Status 2</option>
                                </select>
                            </div> -->
                            </div>
                            <div class="form-group mmar">
                                <label  class="col-sm-3 control-label text-center">Phone: </label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control validate[required,custom[integer]] text-input" value="<?php echo $user_information['phone_number'] ?>" name="phone" id="phone" />
                                </div>

                            </div>
                            <div class="form-group mmar">
                                <label  class="col-sm-3 control-label text-center">Email ID: </label>
                                <div class="col-sm-6">
                                    <input type="email" id="email" name="email" class="form-control validate[required,custom[email]] text-input" value="<?php echo $user_information['email'] ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-offset-4 col-sm-8">
                                    <button type="submit" class="btn btn-primary" id="submit">Submit</button>
                                    <button type="submit" class="btn btn-primary">Cancel</button>
                                </div>
                            </div>
                            <input type="hidden" name="system_base_url" id="system_base_url" value="<?php echo base_url();?>" >
                            <input type="hidden" name="prev_username" id="prev_username" value="<?php echo $user_information['username'] ?>" >
                            <input type="hidden" name="prev_email" id="prev_email" value="<?php echo $user_information['email'] ?>" >
                            <input type="hidden" name="user_id" id="user_id" value="<?php echo base64_encode($intSelectedUser); ?>" >
                        </form>
                    </div>
                </div>
            </div>
            <!-- // Modal body END -->
        </div>
    </div>
</div>

<script src="<?php echo base_url();?>assets/js/main.js" type="text/javascript"></script>
<script src="<?php echo base_url(); ?>assets/js/users.js"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validationEngine.js" type="text/javascript"></script>

<script>
    $(document).ready(function() {
        $("#add_user").validationEngine();
    });
</script>