

 
 <div class="row">
  
   	 	<div class="col-md-4">
				<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >
			
	
				
	<?PHP
	



 echo $this->session->flashdata('groupmsg'); 
                  echo form_open('user/addgrouping' , array('class' => 'form-horizontal form-groups-bordered validate',  'id' => 'signup','enctype' => 'multipart/form-data'));

		 if(validation_errors()):?>

<?php endif;?>

 <div class="form-group">

    <label for="inputcompany" class="col-sm-2 control-label">Company</label>
    <div class="col-sm-10">

		  		<input type="text" readonly name="company" value="<?php echo set_value('company',$member[0]['company']); ?>"id="company" class="form-control" required placeholder="Enter  company name">
     <span class="text-danger"><?php echo form_error('company'); ?></span>
   </div>
  </div>

  <div class="form-group">

    <label for="inputlastname" class="col-sm-2 control-label">Last Name</label>
    <div class="col-sm-10">
			  		<input type="hidden" readonly name="itemid" value="<?php echo set_value('itemid',$itemid); ?>"id="itemid" class="form-control" required placeholder="Enter itemid">

		  		<input type="text" readonly name="lastname" value="<?php echo set_value('lastname',$member[0]['lastname']); ?>"id="lastname" class="form-control" required placeholder="Enter your lastname">
     <span class="text-danger"><?php echo form_error('lastname'); ?></span>
   </div>
  </div>
    <div class="form-group">
    <label for="inputfirstname" class="col-sm-2 control-label">First Name</label>
    <div class="col-sm-10">
		<input type="text" readonly name="firstname" value="<?php echo set_value('firstname',$member[0]['firstname']) ;?>" id="firstname" class="form-control" required placeholder="Enter your Other Names">
       <span class="text-danger"><?php echo form_error('firstname'); ?></span>
   </div>
  </div>
    <div class="form-group">
    <label for="inputemail" class="col-sm-2 control-label">Email</label>
    <div class="col-sm-10">
				<input type="email" readonly  name="email" value="<?php echo set_value('email',$member[0]['email']) ;?>" id="email" class="form-control" required placeholder="Enter Your email">
    <span class="text-danger"><?php echo form_error('email'); ?></span>
	</div>
  </div>


  
 
   <div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label"> Phone </label>
    <div class="col-sm-10">
				<input type="text" name="phone" readonly value="<?php echo set_value('phone',$member[0]['phone']); ?>"id="phone" class="form-control" required placeholder="Create your own phone">
    <span class="text-danger"><?php echo form_error('phone'); ?></span>
   </div>
  </div>
  
  
    <div class="form-group">
    <label for="inputcategoryid" class="col-sm-2 control-label">Group</label>
    <div class="col-sm-10">
	<select class="form-control" name="categoryid" required>
	
	<option value=""  >---Select Category---</option>
	
	<?php 
					 
			
	


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $mycategoryrow->id;   ?>"><?=  $mycategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No category/ group available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('categoryid'); ?>

	</div>
  </div>
  

      <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">	Status</label>
    <div class="col-sm-10">
	<select class="form-control" name="status" required>
	
	<option value="active"  selected="selected">  active</option>
		<option value="inactive">  inactive</option>
	
	</select>
						<span class="text-danger"><?php echo form_error('status'); ?></span>

	</div>
  </div>

  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
     
	<button type="submit" name="btn_addgrouppingy" class="btn btn-primary" value="category">Assign to this group</button>

<a class="btn btn-primary" href="<?php echo base_url(); ?>user/viewmember"> Back?</a>
    </div>
   </div>
   

 

			<?PHP
		echo form_close();
		
		?>
		
		</div>
</div>
</div>
   	<div class="col-md-8">
	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
							

				View category/group
            	</div>
            </div>
			<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >				
	<?PHP
				echo $this->session->flashdata('activemsg'); 								?>	
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
	
									
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
         <tr>
    
     <th>Name</th>
	     <th>From Date</th>
<th>Updated Date</th>
<th>Status</th>		 
	<th>Manage</th>			 
	

                 </tr>
             </thead>
<?php
 if(!is_array($mygrouping)) {
				    echo '<div class="alert alert-danger text-center">This member has not been assigned to any group. Feel free to do so</div>';

			 }else{
 if(!is_array($mygrouping)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='1'>";
    
       echo '<div class="alert alert-warning text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($mygrouping as $c): 

		 

             ?>



             <tr>
                
            <?php 
$id=$c->id;


?>

              

  <td><?php $c->categoryid ; 
$ctid="";
$ctid=$c->categoryid;
$mycat = $this->usermodel->getcategory($ctid);

echo $mycat[0]['name'];

?></td>
    <td><?php echo $c->createdate ; ?></td>
<td><?php echo $c->updatedat ; ?></td>
	  <td><?php  

  //$mystatus="";
$mystatus=$c->status;
			  if( $mystatus =="1"){
				 echo $mystatus="active"; 
			  } else if( $mystatus =="0"){
				    echo $mystatus="inactive";
				  
			  }else{
echo $c->status ;
}

?></td>
			            <td>
                     <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/activation?randomitemidentifier=<?php   {echo  $id;}  ?>&needed=<?php   {echo  $c->status;}  ?>&itemid=<?php echo$itemid?>"><?php    
$yourstatus="";
$mystatus=$c->status;
 if( $mystatus =="1"){
				 echo $yourstatus="Deactivate"; 
			  } else if( $mystatus =="0"){
				  echo   $yourstatus="Activate";
				  
			  }


?>  


</a>

		 </td>
     		     
             </tr>

	<?php endforeach;} ?>

              <?php }?>

        </table>

									
									
									
					</div>	





					
									
									
							</div>		
									
							</div>
						</div>
				

			
			</div>
		</div>
  
  </div>
			
			
			
		
		
  

 
</div>


















