

         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		$(document).on("click", "#editbtn", function()
        {
          var mycategoryid = $(this).data('id');
		  $("#mycategoryid").val(mycategoryid); 
		   
		   		   
   var onlineoffline = $(this).data('onlineoffline');
		   $("#onlineoffline").val(onlineoffline);
 
		 
		     var url = $(this).data('url');
		   $("#url").val(url); 
		 
		  
		  
		   
        });
		
		
			$(document).on("click", "#editbtnetims", function()
        {
          var mycategoryid = $(this).data('id');
		  $("#mycategoryid3").val(mycategoryid); 
		   
		
        });
		
		
		
		
			$(document).on("click", "#editbtnetimsactivate", function()
        {
          var mycategoryid = $(this).data('id');
		  $("#mycategoryid4").val(mycategoryid); 
		   
		   
		    var mrcNo1 = $(this).data('pin');
		  $("#mrcNo4").val(mrcNo1);
			     

	 
		      var invoice = $(this).data('invoice');
		  $("#invoice4").val(invoice); 
        });
		
	
		
    </script>   
 
 <div class="row">
  
   	

   	<div class="col-md-12">
	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
						 <span class="pull-right"><br> Initialize ETIMS </span>					                   


						 
				
            	</div>
            </div>
			<div class="panel-body">

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

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

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

 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	  echo $this->session->flashdata('deletemsg'); 

				echo $this->session->flashdata('msg'); 
								?>	
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
	 <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">POST </h4>
      </div>
      <div class="modal-body">
      
	  	

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

				        		$configuration = $this->usermodel->populateallarray('smsconfig','id',$companyid);

$symbol=$configuration[0]["currencysymbol"];

				echo $this->session->flashdata('deletemsg'); 


				//echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/initializeetims' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
				  		
	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Business KRA PIN </label>
    <div class="col-sm-5">
			  		<input type="text" name="tin" value="<?php echo set_value('tin'); ?>" class="form-control" required placeholder="Enter Business KRA PIN ">

		 
				
		<span class="text-danger"> <?php echo form_error('tin'); ?>
		
		</span>
	</div>
	   <div class="col-sm-5">Branch ID:

		  		<input type="text"  	  name="bhfid" value="<?php echo set_value('bhfid'); ?>" class="form-control" required placeholder="Enter BRANCH ID e.g 00">
		 
				
		<span class="text-danger"> <?php echo form_error('bhfid'); ?>
		
		</span>
	</div>
  </div>

  	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Device Serial No </label>
    <div class="col-sm-5">
			  		<input type="text" name="dvcsrlNo" value="<?php echo set_value('dvcsrlNo'); ?>" class="form-control" required placeholder="Enter  Device Serial No">

		 
				
		<span class="text-danger"> <?php echo form_error('dvcsrlNo'); ?>
		
		</span>
	</div>
	   <div class="col-sm-5"> 
	   
	   	 	<select class="form-control" name="onlineoffline"  required>
		<option  selected="selected" > Select Mode</option>

	<option value="OSCU"  >OSCU</option>
	
	<option value="VSCU"   >VSCU</option>

	

</select>
	   
	 			URL	<textarea name="url" value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter description"></textarea>
  
	   
	   
	   
	   </BR>
	   Company Name:
	   
		  		<input type="text" name="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter business name">

 
		 
	         <button type="submit"  value="Initialize" name="btn_Initialize" class="btn btn-primary">Initialize  </button>

		 
		 
		 
		 
				
	
	</div>
  </div>
  
  


  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">
Sample Urls. Localhost:http://localhost:8088  ,Sandbox:https://etims-api-sbx.kra.go.ke , Live:https://etims-api.kra.go.ke
    

				</div>

		</div>
						



<div class="panel-body">
	
									
  <table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped table-hover" id="example" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
         <tr>
     <th>PIN</th>
<th>MCR NO</th>	
<th>DATE</th>		 
	 
		<th>BRANCH ID</th>
		<th>Counter </th>	
		
		<th>URL</th>		 
		<th>Mode</th>		 

	<th>More</th>	

                 </tr>
             </thead><tbody>
<?php
   	$viewbranch = $this->usermodel->populateall('etiminitialization','id > ', 0);


 if(!is_array($viewbranch)) 

 {


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

		 

             ?>



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


?>

    
  <td><?php echo $c->tin ; ?></td>          
	  <td><?php echo $c->mrcNo ; ?></td>

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

		      	  	  <td><?php echo $c->url ; ?></td>
		      	  	  <td><?php echo $c->onlineoffline ; ?></td>
 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										
									
									
                                        <li class="divider"></li>
                                        
                                     	  <li> 

	 <a class="btn btn-primary editbtn" id="editbtn" data-url='<?php echo  $c->url;?>' data-onlineoffline='<?php echo  $c->onlineoffline;?>'   data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Update
                                                </a>
                                                        </li>
														<br>
														
														
														  <li> 

	 <a class="btn btn-info editbtnetims" id="editbtnetims" data-url='<?php echo  $c->url;?>' data-onlineoffline='<?php echo  $c->onlineoffline;?>'   data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#activateserialProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Activate Device
                                                </a>
                                                        </li>
                                        <br>
										
																	  <li> 

	 <a class="btn btn-info editbtnetimsactivate" id="editbtnetimsactivate" data-url='<?php echo  $c->url;?>' data-onlineoffline='<?php echo  $c->onlineoffline;?>'   data-invoice='<?php echo $c->bhfSttsCd;?>' data-pin='<?php echo  $c->mrcNo;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#activateetimsrequestModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Confirm Activation Request
                                                </a>
                                                        </li>
                                        
                                        
                                    </ul>
										
                                </div>
</td>
	

 
		 
		 
		 
             </tr>

	<?php endforeach;} ?>

             
<tbody>
        </table>

									
									
									
					</div>	





									
									
									
					</div>	

					
					
					
					
					
<div id="editProductModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- 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 URL</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/updateetimsurl' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>

	<input type="hidden" name="action" value="" id="action" class="form-control" required placeholder="Enter action">
<input type="hidden" name="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">
	

  
  
  
  

	<div class="form-group">
    <label for="inputurl"  class="col-sm-2 control-label">URL</label>
    <div class="col-sm-10">

				<textarea name="url" value="<?php echo set_value('description'); ?>"  id="url" class="form-control"  placeholder="Enter description"></textarea>
			
		<span class="text-danger"> <?php echo form_error('url'); ?>
		
		</span>
	</div>
  </div>
		

		<div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Method 

	
	</label>
    <div class="col-sm-10">
	
		 	<select class="form-control" name="onlineoffline"  id="onlineoffline"required>
		<option  selected="selected" > </option>

<option value="OSCU"  >OSCU</option>
	<option value="VSCU"   >VSCU</option>

	

</select>



	</div>
  </div>

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="updateurl" name="btn_updateurl" class="btn btn-primary"> Update Url   </button>

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

    

				</div>

		</div>
	    </div>
    </div>
					
					
					
					
					
					
						
<div id="activateserialProductModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Activate Serial</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/sendotpetims' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
<input type="hidden" name="action" value="" id="action" class="form-control" required placeholder="Enter action">
<input type="hidden" name="mycategoryid" value=""id="mycategoryid3" class="form-control" required placeholder="Enter mycategoryid">
	


  
  

	<div class="form-group">
    <label for="inputphone"  class="col-sm-2 control-label">Phone No</label>
    <div class="col-sm-10">
  <input type="text" name="phone" value="<?php echo set_value('phone'); ?>" class="form-control" required placeholder="Enter your phone No for OTP SMS">

			
		<span class="text-danger"> <?php echo form_error('phone'); ?>
		
		</span>
	</div>
  </div>
		
<div class="form-group">
    <label for="inputname"  class="col-sm-2 control-label">Your Name </label>
    <div class="col-sm-10">
  <input type="text" name="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter  your full names">

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

	
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="otp" name="btn_sendotp" class="btn btn-primary"> Send OTP  </button>

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

    

				</div>

		</div>
	    </div>
    </div>
					
					
					
						
					
					
				
						
<div id="activateetimsrequestModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Confirm Etims activation Request</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				//echo $this->session->flashdata('msg'); 
		    echo form_open('https://erp.robisearchltd.com/getetimsrequest' , array('class' => 'form-horizontal form-groups-bordered validate', 'target' => '_blank', 'id' => 'signup','enctype' => 'multipart/form-data'));

                 echo form_open('getetimsrequest' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
<input type="hidden" name="action" value="" id="action" class="form-control" required placeholder="Enter action">
<input type="hidden" name="mycategoryid" value=""id="mycategoryid4" class="form-control" required placeholder="Enter mycategoryid">
	<input type="hidden" name="mrcNo" value=""id="mrcNo4" class="form-control" required placeholder="Enter mrcNo">
<input type="hidden" name="invoice" value=""id="invoice4" class="form-control" required placeholder="Enter invoice">


  Are you sure you want to confirm the ETIMS activation request?
		
<div class="form-group">
    <label for="inputname"  class="col-sm-2 control-label">Your Name </label>
    <div class="col-sm-10">
  <input type="text" name="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter  your full names">

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


	
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="Confirm" name="btn_Confirmetimsapproval" class="btn btn-primary"> YES. Confirm No >>> </button>

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

    

				</div>

		</div>
	    </div>
    </div>
					
					
					
						
					
					
						
					
					
						<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('logged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="currency">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewcurrency">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>					
<div id="addModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
   
	    </div>
    </div>





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

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

 
</div>


















