<?php echo $header; ?>
<div class="container-fluid">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">
                <?php echo $this->lang->line('user_edit_header'); ?>
            </h1>
            <ol class="breadcrumb">
                <li>
                    <i class="fa fa-dashboard"></i>
                    <a href="<?php echo BASE_URL; ?>/admin"><?php echo $this->lang->line('nav_dash'); ?></a>
                </li>
                <li>
                    <i class="fa fa-fw fa-user"></i>
                    <a href="<?php echo BASE_URL; ?>/admin/users"><?php echo $this->lang->line('user_header'); ?></a>
                </li>
                <li class="active">
                    <i class="fa fa-fw fa-pencil"></i>
                    <?php echo $this->lang->line('user_edit_header'); ?>
                </li>
            </ol>
        </div>
    </div>
</div>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        <i class="fa fa-pencil fa-fw"></i>
                        <?php echo $this->lang->line('user_edit_header'); ?>
                    </h3>
                </div>

                <div class="panel-body">
                    <?php foreach ($users as $u) {
			 echo form_open(BASE_URL.'/admin/users/edited/'.$this->uri->segment(4)); ?>

                    <div class="form-group">
                        <?php echo form_error('username', '<div class="alert alert-danger">', '</div>'); ?>
                        <label class="control-label"
                            for="username"><?php echo $this->lang->line('user_new_username'); ?></label>
                        <div class="controls">
                            <?php 	$data = array(
						  'name'        => 'username',
						  'id'          => 'username',
						  'class'       => 'form-control disabled',
						  'value'		=> set_value('username', $u['userName']),
						  'disabled'	=> ''
						);
			
						echo form_input($data); ?>

                            <p class="help-block"><?php echo $this->lang->line('user_new_message'); ?></p>
                        </div> <!-- /controls -->
                    </div> <!-- /form-group -->

                    <div class="form-group">
                        <?php echo form_error('role', '<div class="alert alert-danger">', '</div>'); ?>
                        <label class="control-label" for="role"><?php echo $this->lang->line('user_role'); ?></label>
                        <div class="controls">
                            <?php 	$data = array(
						  'name'        => 'role',
						  'id'          => 'role',
						  'class'       => 'form-control select2 ',
						  'value'		=> set_value('role', '', FALSE)
						);
			
						echo form_dropdown($data, $roles, $u['roleID']); ?>
                        </div> <!-- /controls -->
                    </div> <!-- /form-group -->

                    <div class="form-group">
                        <?php echo form_error('email', '<div class="alert alert-danger">', '</div>'); ?>
                        <label class="control-label"
                            for="email"><?php echo $this->lang->line('user_new_email'); ?></label>
                        <div class="controls">
                            <?php 	$data = array(
						  'name'        => 'email',
						  'id'          => 'email',
						  'class'       => 'form-control',
						  'value'		=> set_value('email', $u['email']),
						);
			
						echo form_input($data); ?>

                        </div> <!-- /controls -->
                    </div> <!-- /form-group -->

                    <div class="form-group">
                        <?php echo form_error('password', '<div class="alert alert-danger">', '</div>'); ?>
                        <label class="control-label"
                            for="password"><?php echo $this->lang->line('user_new_pass'); ?></label>
                        <div class="controls">
                            <?php 	$data = array(
						  'name'        => 'password',
						  'id'          => 'password',
						  'class'       => 'form-control',
						  'value'		=> set_value('password')
						);
			
						echo form_password($data); ?>
                        </div> <!-- /controls -->
                    </div> <!-- /form-group -->

                    <div class="form-group">
                        <?php echo form_error('con_password', '<div class="alert alert-danger">', '</div>'); ?>
                        <label class="control-label"
                            for="con_password"><?php echo $this->lang->line('user_new_confirm'); ?></label>
                        <div class="controls">
                            <?php 	$data = array(
						  'name'        => 'con_password',
						  'id'          => 'con_password',
						  'class'       => 'form-control',
						  'value'		=> set_value('con_password')
						);
			
						echo form_password($data); ?>
                        </div> <!-- /controls -->
                    </div> <!-- /form-group -->

                    <div class="form-group">
                        <?php echo form_error('name', '<div class="alert alert-danger">', '</div>'); ?>
                        <label class="control-label" for="name"><?php echo $this->lang->line('user_name'); ?></label>
                        <div class="controls">
                            <?php 	$data = array(
						  'name'        => 'name',
						  'id'          => 'name',
						  'class'       => 'form-control',
						  'value'		=> set_value('name', $u['name'], FALSE)
						);			
						echo form_input($data); ?>
                        </div> <!-- /controls -->
                    </div> <!-- /form-group -->

                    <div class="form-group">
                        <?php echo form_error('gender', '<div class="alert alert-danger">', '</div>'); ?>
                        <label class="control-label"
                            for="gender"><?php echo $this->lang->line('user_gender'); ?></label>
                        <div class="controls">
                            <?php 	$data = array(
						  'name'        => 'gender',
						  'id'          => 'gender',
						  'class'       => 'form-control',
						  'value'		=> set_value('gender', $u['gender'], FALSE)
						);			
						echo form_dropdown($data, ['M' => 'Male', 'F' => 'Female']); ?>
                        </div> <!-- /controls -->
                    </div> <!-- /form-group -->

                    <div class="form-group">
                        <?php echo form_error('mobile', '<div class="alert alert-danger">', '</div>'); ?>
                        <label class="control-label"
                            for="mobile"><?php echo $this->lang->line('user_mobile'); ?></label>
                        <div class="controls">
                            <?php 	$data = array(
						  'name'        => 'mobile',
						  'id'          => 'mobile',
						  'class'       => 'form-control',
						  'value'		=> set_value('mobile', $u['mobile'], FALSE)
						);			
						echo form_input($data); ?>
                        </div> <!-- /controls -->
                    </div> <!-- /form-group -->
                </div>

                <div class="panel-footer">
                    <?php 	$data = array(
						  'name'        => 'submit',
						  'id'          => 'submit',
						  'class'       => 'btn btn-primary',
						  'value'		=> $this->lang->line('btn_save'),
						);
					 echo form_submit($data); ?>
                    <a class="btn"
                        href="<?php echo BASE_URL; ?>/admin/users"><?php echo $this->lang->line('btn_cancel'); ?></a>
                </div> <!-- /form-actions -->
                <?php  echo form_close(); 
			 }
			 ?>
            </div>
        </div>
    </div>
</div>
<?php echo $footer; ?>