<?php	
	$ctrl_name = BASE_URL."/admin";
	$page_name = BASE_URL."/admin/profile";		
?>
<h1 class="page-header">My Profile</h1>          
<div class="bs-example table-responsive">
	<table align="center" width="100%" border="0">    	
    	 <?php if(!empty($error_msg)) {?>     
            <tr>
                <td align="center">  
                  <div class="col-lg-6 alert alert-danger" style="clear:right">
                    <?php echo $error_msg;?>
                 </div>             
                </td>
             </tr>   
         <?php } ?> 
        <tr>
        	<td align="center">       
             <div class="col-lg-12">
             <div class="well">
                  <form class="bs-example form-horizontal" id="profileFrm" name="profileFrm" action="<?php echo $page_name; ?>" method="post" enctype="multipart/form-data">
                    <fieldset>                  
                      <div class="form-group">
                          <label class="col-lg-2 control-label" for="fname">First Name</label>
                        <div class="col-lg-10">
                          <input type="text" placeholder="First Name" id="fname" name="fname" class="form-control" autofocus value="<?php echo $UsersDetail->first_name?>">
                        </div>
                      </div>
                      
                      <div class="form-group">
                          <label class="col-lg-2 control-label" for="fname">Last Name</label>
                        <div class="col-lg-10">
                          <input type="text" placeholder="last Name" id="lname" name="lname" class="form-control" value="<?php echo $UsersDetail->last_name?>">
                        </div>
                      </div>
                      
                       <div class="form-group">
                          <label class="col-lg-2 control-label" for="email">Email</label>
                        <div class="col-lg-10">
                          <input type="text" placeholder="Email" id="email" name="email" class="form-control" value="<?php echo $UsersDetail->email?>">
                        </div>
                      </div>
                      <div class="form-group">
                          <label class="col-lg-3 control-label" for="name">Image</label>
                        <div class="col-lg-8" align="left">
                          <input type="file" name="simage" id="simage" /> (Only <?php echo VALID_EXT_MEMBERS?>) 
                        </div>
                      </div>
                      <div class="form-group">
                          <label class="col-lg-3 control-label" for="page_content"></label>
                        <div class="col-lg-6">
                          <?php 
					  if(!empty($UsersDetail->simage)){
								 ?>
							 	<table align="center" border="0" cellpadding="3" cellspacing="3" width="100%">
                               	   <tr>	
                                   		<td width="133"><?php if(!empty($UsersDetail->simage)){?> <img src="<?php echo "../". UPLOADDIR_MEMBERS."/".$UsersDetail->simage?>?<?php echo date("YmdHis")?>" width="100" height="100" alt="<?php echo SEO_IMAGE_ALT; ?>" title="<?php echo SEO_IMAGE_TITLE; ?>"> <?php }?><input type="hidden" name="simage_old" value="<?php echo $UsersDetail->simage?>">
										</td>
                                   	   
                                   </tr>
                               </table>
                             <?php } ?>
                        </div>
                      </div>
                      <?php /*?><div class="form-group">
                          <label class="col-lg-2 control-label" for="email">Password</label>
                        <div class="col-lg-10">
                          <input type="password" placeholder="Password" id="password" name="password" class="form-control" value="">
						  <input type="hidden" id="oldpassword" name="oldpassword" value="<?php echo $UsersDetail->password?>">
                        </div>
                      </div>
                      <?php */?>
                      <div class="form-group">
                        <div class="col-lg-10 col-lg-offset-1">                    
                          <button class="btn btn-primary" name="Submit" type="submit" value="Submit">Update Profile</button>
                        </div>
                      </div>
                    </fieldset>
                  </form>
            </div>
          </div>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
$(document).ready(function() {
    $('#profileFrm').bootstrapValidator({
        message: 'This value is not valid',
        fields: {
            fname: {
                message: 'The First Name is not valid',
                validators: {
                    notEmpty: {
                        message: 'The First Name is required and can\'t be empty'
                    }
                }
            },
			lname: {
                message: 'The Last Name is not valid',
                validators: {
                    notEmpty: {
                        message: 'The Last Name is required and can\'t be empty'
                    }
                }
            },
            email: {
				message: 'The Email Address is not valid',
                validators: {
					notEmpty: {
                        message: 'The Email address is required and can\'t be empty'
                    },
                    emailAddress: {
                        message: 'The input is not a valid email address'
                    }
                }
            },
            password: {
                validators: {
                    notEmpty: {
                        message: 'The password is required and can\'t be empty'
                    }
                }
            }
        }
    });
});
</script>