<?php

/* 
 * Author       : Jai K
 * Purpose      : Edit user profile information
 * Created On   : 2016-11-25 10:02
 */
?>
<aside class="right-side">
    <section class="content-header">
        <div class="title_bar">
            <?php if(!IS_KSK) { ?>
                <div class="breadcrumb_container"><?php echo breadcrumb_links();?></div>
            <?php } else {?>
                <div class="breadcrumb_container"><ol class="breadcrumb"><li><a href="<?php echo base_url();?>"><i class="fa fa-home"></i> Home</a></li></ol></div>
            <?php }  ?>
        </div>
    </section>
    <section class="content">
        <div class="row" id="main-content">
            <div class="col-xs-12">
                <form id="profile-form" action="<?php echo $form_action;?>" method="post"  enctype="multipart/form-data" method="post" onsubmit="return validateProfile();">    
                    <input type="hidden" name="token" value="<?php echo $token; ?>" />    
                    <div class="box box-danger">
                        <div class="box-body">
                            <?php if( !empty( $success ) || !empty( $error ) ) : ?>
                                <div class="alert alert-<?php echo !empty( $success ) ? 'success' : 'danger'; ?> alert-dismissable">
                                    <i class="fa fa-thumbs-o-<?php echo !empty( $success ) ? 'up' : 'down'; ?>"></i>
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                    <h4><?php echo !empty( $success ) ? $success : $error; ?></h4>
                                </div>
                            <?php endif; ?>
                            
                            <ul class="error_container"></ul>
                            <div class="col-xs-12">
                                <div class="col-md-6">
                                    <div class="form-group float-clear">
                                        <label>User Name</label>
                                        <input type="text" class="form-control readonly" readonly value="<?php echo $user->user_name; ?>" />
                                    </div>
                                </div>
                                
                                <div class="col-md-6">
                                    <?php if( $user->role != 3 ) : ?>
                                        <div class="form-group float-clear" style="text-align: right;">
                                            <button class="btn btn-primary pass-code-generate-btn" data-id="<?php echo $user->id; ?>">Re-generate pass code</button>                         
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </div>    
                                    
                            <div class="col-xs-12 blck">
                                <div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Details</h4><i class="ctrl opener opened fa fa-chevron-up" style="float: right; margin-top: -25px;"></i></div>
                                <div class="blck-content col-xs-12">
                                    <div class="col-md-6">        
                                        <div class="form-group">
                                            <label>Name<span class="required">*</span></label>
                                            <div class="input-group" style="width: 66%;">
                                                <input type="text" class="form-control req" name="name" value="<?php echo $user->name;?>" />
                                            </div>
                                        </div>
                                        
                                    </div>

                                    <div class="col-md-6">                                    
                                        <div class="form-group float-clear">
                                            <label>Contact No<span class="required">*</span></label>
                                            <div class="input-group">
                                                <input type="text" class="form-control req contact_no" name="contact_no" placeholder="" value="<?php echo $user->contact_no; ?>" />
                                                <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                            </div>
                                        </div>
                                        
                                    </div>
                                    
                                </div> <!-- blck-content -->    
                            </div> <!-- blck -->
                            
                            <?php //if( $user->role != 3 ) : ?>
                                <div class="col-xs-12 blck">
                                    <div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Change Password</h4><i class="ctrl opener fa fa-chevron-down" style="float: right; margin-top: -25px;"></i></div>
                                    <div class="blck-content col-xs-12" style="display: none;">
                                      <div class="col-md-6">        
                                          <div class="form-group">
                                              <label>New Password</label>
                                              <div class="input-group" style="width: 66%;">
                                                  <input type="text" class="form-control" name="pass1" value="" />
                                              </div>
                                          </div>
                                          <div class="form-group">
                                              <label>Confirm Password</label>
                                              <div class="input-group" style="width: 66%;">
                                                  <input type="text" class="form-control" name="pass2" value="" />
                                              </div>
                                          </div>
                                      </div>

                                      <div class="col-md-6">        

                                      </div>  
                                    </div> <!-- blck-content -->    

                                </div> <!-- blck -->    
                            <?php //endif; ?>
                            
                            
                            
                        </div>
                        
                        
                        <div class="box-footer form-actions float-clear" style="text-align: right; padding-right: 30px;">
                            <button class="btn btn-primary" type="reset"><i class="fa fa-trash"></i> Clear</button>
                            <button type="submit" name="submit" value="Update" class="btn btn-danger"><i class="fa fa-undo"></i> Update</button>
                            
                        </div>
                    </div><!-- /.box -->
                    
                    
                </form>
            </div><!-- /.col-xs-12 -->
        </div><!-- /.row -->
        
      
                            
                            
                            
                            
        
                    
                </div>
            </div>
        </div>
    <!-- End Modal -->
    </section><!-- /.content -->
</aside>
<script type="text/javascript" src="<?php echo base_url() . 'assets/js/user.js'?>"></script>

