<!-- Main content -->
                <section class="content">

                    <!-- Small boxes (Stat box) -->
                    <div class="row">
                       <div class="col-md-6">
                            <!-- general form elements -->
                            <div class="box box-primary">
                                <div class="box-header">
                                    <h3 class="box-title">Edit Staff</h3>
                                </div><!-- /.box-header -->
                                <!-- form start -->
                                 <?php 

	 if($this->session->flashdata('success_msg')){?>
		 <div style="color:green"><?php echo $this->session->flashdata('success_msg');?></div>		
		<?php  } ?>
                                <form role="form" action="<?php echo site_url('aqadmin/edit_admin');?>" method="post">
                                <?php foreach($adm ->result() as $raw){?>
                                    <div class="box-body">
									
                                    <div class="form-group">
                                            <label for="exampleInputEmail1">Admin Name</label>
                                            <input type="text" name="adname" class="form-control"  value="<?php echo $raw->username;?>">
                                            <?php if(form_error('adname') != ""){?>     
     <div style="color:red"><?php echo "Enter name.";?></div>
       <?php } ?> 
                                        </div>
                                    
 <div class="form-group">
                                            <label for="exampleInputEmail1">Email</label>
                                            <input type="text" name="email" class="form-control"  value="<?php echo $raw->email;?>" >
                                            <?php if(form_error('email') != ""){?>     
     <div style="color:red"><?php echo "Enter valid unique email.";?></div>
       <?php } ?> 
                                        </div>
                     
                                      
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Role</label>
                                            <select name="rol" class="form-control">
												<option value="">select</option>
                                                <option value="sub"<?php if($raw->role == "sub"){?> selected="selected" <?php } ?>>Sub</option>
											    <option value="main"<?php if($raw->role == "main"){?> selected="selected" <?php } ?>>Main</option>												
                                            </select>
                                            <?php if(form_error('rol') != ""){?>     
                               <div style="color:red"><?php echo "Select admin role.";?></div>
                                  <?php } ?> 
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Links</label><br>
                                            <?php foreach($lin ->result() as $raw1){
												 $a=explode(",",$raw->link);																								 ?>
                                            <input type="checkbox" name="link[]" value="<?php echo $raw1->lk_id;?>"<?php foreach($a as $x){ if($x == $raw1->lk_id){ echo "checked"; } }?>><?php echo $raw1->links;?>&nbsp;&nbsp;&nbsp;&nbsp;
                                           <?php } ?>
                                            <?php if(form_error('link') != ""){
												?>     
                               <div style="color:red"><?php echo "Select links.";?></div>
                                  <?php } ?>
                                        </div>
                                        
                                    </div><!-- /.box-body -->
<input type="hidden" name="adid" value="<?php echo $raw->a_id?>">
                                    <div class="box-footer">
                                        <button type="submit" class="btn btn-primary">Submit</button>
                                    </div>
                                    <?php } ?>
                                </form>
                            </div><!-- /.box -->

                            

                        </div>
                                           <div class="col-md-6">
                            <!-- general form elements -->
                            <div class="box box-primary">
                                <div class="box-header">
                                    <h3 class="box-title">Change password</h3>
                                </div><!-- /.box-header -->
                                <!-- form start -->
                                 <?php 
     if($this->session->flashdata('pwd_success_msg')){?>
         <div style="color:green"><?php echo $this->session->flashdata('pwd_success_msg');?></div>      
        <?php  } ?>
                                <form role="form" action="<?php echo site_url('aqadmin/change_password');?>" method="post">
                                <?php foreach($adm ->result() as $raw){?>
                                    <div class="box-body">
                                    <input type="hidden" name="user" class="form-control"  value="<?php echo $this->session->userdata('user'); ?>">  
                                    <input type="hidden" name="staff_mail" class="form-control"  value="<?php echo $raw->email;?>">  
                                    <input type="hidden" name="adid" value="<?php echo $raw->a_id?>">
 <div class="form-group">
                                            <label for="exampleInputEmail1">Current Password</label>
                                            <input type="password" name="old_password" class="form-control"  value="">
                                   <?php if(form_error('old_password') != ""){?>     
     <div style="color:red"><?php echo "Enter current password.";?></div>
       <?php } ?>  
                                        </div>
                     
                                      <div class="form-group">
                                            <label for="exampleInputEmail1">New Password</label>
                                            <input type="password" name="new_password" class="form-control"  value="">
                     <?php if(form_error('new_password') != ""){?>     
     <div style="color:red"><?php echo "Enter new password.";?></div>
       <?php } ?>  
                                        </div>
                                       <div class="form-group">
                                            <label for="exampleInputEmail1">Confirm Password</label>
                                            <input type="password" name="confirm_password" class="form-control"  value="">
                     <?php if(form_error('confirm_password') != ""){?>     
     <div style="color:red"><?php echo "Enter matching password.";?></div>
       <?php } ?>    
                                        </div>
                                       
                                     
                                        
                                    </div><!-- /.box-body -->

                                    <div class="box-footer">
                                        <button type="submit" class="btn btn-primary">Change password</button>
                                    </div>
                                    <?php } ?>
                                </form>
                            </div><!-- /.box -->

                            

                        </div>
                        </div>
                    </div><!-- /.row -->

                    <!-- top row -->
                    
                    

                    
                    
