

<script type="text/javascript">

	 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });






     $(document).on("click", "#managebtn", function()
        {
			
		     var taskid = $(this).data('id');
		  $("#taskid1").val(taskid);  	
          var taskowner = $(this).data('taskowner');
		  $("#taskowner1").val(taskowner); 
		  
		    var subject = $(this).data('subject');
		   $("#subject1").val(subject); 
		   
		     var comments = $(this).data('comments');
		   $("#comments1").val(comments); 
		 
		     var status = $(this).data('status');
		   $("#status1").val(status);


		     var fromdate = $(this).data('fromdate');
		   $("#fromdate1").val(fromdate); 

		     var todate = $(this).data('todate');
		   $("#todate1").val(todate); 		   
		   
        });
		
		
	   $(document).on("click", "#editbtn", function()
        {
     	
		     var description = $(this).data('description');
		   $("#description1").val(description); 
		 
		     var subject = $(this).data('subject');
		   $("#subject1").val(subject);


		  
        });
		
	  $(document).on("click", "#viewbtn", function()
        {
     	     var taskid = $(this).data('id');
		  $("#taskid2").val(taskid);  	
          var taskowner = $(this).data('taskowner');
		  $("#taskowner2").val(taskowner); 
		  
		    var subject = $(this).data('subject');
		   $("#subject2").val(subject); 
		   
		     var comments = $(this).data('comments');
		   $("#comments2").val(comments); 
		 
		     var status = $(this).data('status');
		   $("#status2").val(status);


		     var fromdate = $(this).data('fromdate');
		   $("#fromdate2").val(fromdate); 

		     var todate = $(this).data('todate');
		   $("#todate2").val(todate); 		
	
		   
 var 	category = $(this).data('category');
		   $("#category2").val(category); 		
 var contact = $(this).data('contact');
		   $("#contact2").val(contact); 		
 var controller = $(this).data('controller');
		   $("#controller2").val(controller); 		
 var priority = $(this).data('priority');
		   $("#priority2").val(priority); 	

 var notification = $(this).data('notification');
		   $("#notification2").val(notification);
		   
		    var repeated = $(this).data('repeated');
		   $("#repeated2").val(repeated);
		   
		   
		  
        });
		
    </script>
 
 <div class="row">
  
   		<a class="btn btn-default" href="<?php echo base_url(); ?>user/salaryhistory"> Go back </a>


   	<div class="col-md-12">
	<?PHP
				$session_data = $this->session->userdata('logged_in');

    $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'); 

				
					 
	    $addcomplain=$this->usermodel->populatuserpermissionsdataarray('complain','add',$userid);

	 $updatecomplain=$this->usermodel->populatuserpermissionsdataarray('complain','update',$userid);
  $deletecomplain=$this->usermodel->populatuserpermissionsdataarray('complain','delete',$userid);
	 
			    $viewcomplain=$this->usermodel->populatuserpermissionsdataarray('complain','view',$userid);
			    $readallcomplain=$this->usermodel->populatuserpermissionsdataarray('sales','allcompalin',$userid);
				function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						
						return $number;
					}
				
	   
								?>	
  
		<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"> View paye</span>
				 
				 
				 
			
			<div class="panel-body">

			
	
		
									
				
      
	  <?php
	  $payeeafter=$payee - $relief;
	
	  $ttdeduction=$payeeafter+$nhif+$nssf+$deduction;
	     echo '<b>AMOUNT YOU ENTERED: </b>'.number_format(($realamount),2).'<br />------------------------------------<br />';

   echo '<b>TAXABLE AMOUNT: </b>'.number_format(($OriginalAmount),2).'<br />------------------------------------<br />';
   
    echo '<b>PERSONAL RELIEF </b>'.formatMoney($relief, true).'<br />';
	    echo '<b>NHIF RELIEF </b>'.formatMoney($nhifrelief, true).'<br />';

   //echo '<b>PAYEE AFTER RELIEF </b>'.formatMoney($payee, true).'<br />';
        echo '<b>NSSF </b>'.formatMoney($nssf, true).'<br />';
        echo '<b>HS LEVY </b>'.formatMoney($houselevy, true).'<br />';

	        echo '<b>SHIF </b>'.formatMoney($nhif, true).'<br />';
	        echo '<b>OTHER  DEDUCTIONS  </b>'.formatMoney($mydeduction, true).'<br />';

	
	echo '<b>PAYEE AFTER RELIEF : </b>'.round(($payee),2).'<br />------------------------------------<br />';
   	echo '<b>TOTAL DEDUCTIONS : </b>'.formatMoney($deduction+$mydeduction, true).'<br />------------------------------------<br />';


   echo '<b>NET SALARY: </b>'.formatMoney(round((($realamount-($payee+$nhif+$nssf+$houselevy))),2),true).'<br />------------------------------------<br />';

	
    ?>

	
	
									
				

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

 
</div>










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

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

 
</div>


















