<?php
				$session_data = $this->session->userdata('logged_in');

$id=$itemid;
$image_id=   $member[0]['image_id'];


 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];


				 $mydate=date("Y-m-d");
				
				$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
	 
				$data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];
	 
	 	 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	 		  		  	      $advance=$this->usermodel->populatuserpermissionsdataarray('sales','advance',$userid);
	 		  		  	      $updatepeople=$this->usermodel->populatuserpermissionsdataarray('members','update',$userid);

			 $mylastrecord=0;
		
			$lastrecord = $this->usermodel->last_membernumber($companyid);
			if($lastrecord !=false){
				 $mylastrecord=(float)$lastrecord[0]["address_1"]+1;
			}else{
				
				 $mylastrecord=(float)$mylastrecord+1;
			}
				
				
?>

 
 <div class="row">
  
   	

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

  
		

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

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update  Customer Membership Details </h4>
      </div>
      <div class="modal-body">
      	<a class="btn btn-primary" href="<?php echo base_url(); ?>user/viewmember"> Back?</a>

				<?PHP
//$session_data = $this->session->userdata('logged_in',$member[0]['company']);

				echo $this->session->flashdata('msg',$member[0]['company']); 
		
                 echo form_open('user/updatemembershipno' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data',$member[0]['company']));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
<input type="hidden" name="myid" value="<?php echo $itemid; ?>"  id="myid" class="form-control" required placeholder="Enter status">






		
 
		




 	<div class="form-group">
    <label for="inputcompany" class="col-sm-2 control-label">	Company Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="company" value="<?php echo set_value('company',$member[0]['company']); ?>" class="form-control"  placeholder="Enter company name if any">
		 
				
		<span class="text-danger"> <?php echo form_error('company'); ?>
		
		</span>
	</div>
  </div>
	<div class="form-group">
    <label for="inputfirstname" class="col-sm-2 control-label">Customer First Names <span style="color:red;">*</span></label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="firstname" value="<?php echo set_value('firstname',$member[0]['firstname']); ?>" class="form-control" required placeholder="Enter first and last name">
		 
				
		<span class="text-danger"> <?php echo form_error('firstname',$member[0]['company']); ?>
		
		</span>
	</div>
  </div>
<div class="form-group">
    <label for="inputlastname"  class="col-sm-2 control-label">Customer Last name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="lastname" readonly value="<?php echo set_value('lastname',$member[0]['lastname']); ?>" class="form-control"  placeholder="Enter last name">
		 
				
		
		</span>
	</div>
  </div>
<div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">	ID Number		 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="idno" readonly value="<?php echo set_value('idno',$member[0]['idno']); ?>" class="form-control"  placeholder="Enter  ID.No">
		 
				
		<span class="text-danger"> <?php echo form_error('idno'); ?>
		
		</span>
	</div>
  </div>
  
  
  

  
  
  
  
  	<div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label">	Phone <span style="color:red;">*</span></label>
    <div class="col-sm-10">
	
		  		<input type="text" name="phone" readonly value="<?php echo set_value('phone',$member[0]['phone']); ?>" class="form-control" required placeholder="Enter phone e.g 254712345678">
		 
				
		<span class="text-danger">Enter phone e.g 254712345678 <?php echo form_error('phone',$member[0]['company']); ?>
		
		</span>
	</div>
  </div>

  
   
  
  
  
  
  
   	<div class="form-group">
    <label for="inputphoneaddress_1" class="col-sm-2 control-label">	Card No/Membership No	 </label>
    <div class="col-sm-10">
	
	<?PHP
	if($member[0]['address_1']==""){
			?>
		
				  		<input type="text" name="address_1" value="<?php echo set_value('address_1',$mylastrecord); ?>" class="form-control"  placeholder="Enter Card No/Membership No e.g 254712345678 if any">

	<?PHP	
	}else{
			?>
		
		
						  		<input type="text"  name="address_1" readonly value="<?php echo set_value('address_1',$member[0]['address_1']); ?>" class="form-control"  placeholder="Enter Card No/Membership No e.g 254712345678 if any">

		
	<?PHP	
	}
	
	?>
		 
						  		
								
								

		<span class="text-danger"> <?php echo form_error('address_1'); ?>
		
		</span>
	</div>
  </div>
    
   	<div class="form-group">
    <label for="inputaccount" class="col-sm-2 control-label">	Card Serial No </label>
    <div class="col-sm-10">
	
	
		<?PHP
	if($member[0]['account']==""){
			?>
				  		<input type="text" name="account"  value="<?php echo set_value('account'); ?>" class="form-control"  placeholder="Enter Card Serial No 254712345678 if any">


	<?PHP	
	}else{
			?>
		
		
		  		<input type="text" name="account" readonly value="<?php echo set_value('account',$member[0]['account']); ?>" class="form-control"  placeholder="Enter Card Serial No 254712345678 if any">

		
	<?PHP	
	}
	
	?>
	
	
	
	
	

	
	
		 
				
		<span class="text-danger"> <?php echo form_error('account'); ?>
		
		</span>
	</div>
  </div>
  
    
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	 
	 
	 
	 
	 
	
	         <button type="submit"  value="membership" name="btn_addmembership" class="btn btn-primary"> Generate Membership No  </button>

		 
			  <button type="submit"  value="membershipserial" name="btn_addmembership" class="btn btn-primary"> Upadate Serial Membership No  </button>

	 
	 
	 
	 
	 
	 
	 
	 

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

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

			
			</div>



















