

 <link href="<?php echo base_url(); ?>assets/select/chosen.min.css" rel="stylesheet" media="screen">
	
		   
		   		   <script src="<?php echo base_url(); ?>assets/select/chosen.jquery.min.js"></script>

  

 

         <script type="text/javascript">
		 	 $(document).on("click", "#accountabilitybtn", function()
        {
          var accountid = $(this).data('id');
		  $("#accountid").val(accountid); 
		   var accountinvoice = $(this).data('invoice');
		  $("#accountinvoice").val(accountinvoice); 
		  
		  
		    
 

        });
  	
		 $(document).on("click", "#approvebtn", function()
        {
          var aprrovalid = $(this).data('id');
		  $("#aprrovalid").val(aprrovalid); 
		   var aprrovalinvoice = $(this).data('invoice');
		  $("#aprrovalinvoice").val(aprrovalinvoice); 
		  
		  
		   
        });
		
				 $(document).on("click", "#allocationebtn", function()
        {
          var allocationid = $(this).data('id');
		  $("#allocationid").val(allocationid); 
		   var allocationinvoice = $(this).data('invoice');
		  $("#allocationinvoice").val(allocationinvoice); 
		     var allocationamount = $(this).data('amount');
		  $("#allocationamount2").val(allocationamount); 
		   
	     var balance = $(this).data('balance');
		  $("#allocationamount").val(balance); 
		   
        });
		
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
			  $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });

		
		
    </script>  

<script>
	function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

    // document.body.innerHTML = printContents.fontsize(12);
     window.print();

	 if( window.print()) {
         window.location.href = "../user/viewrequest";
		alert(" printing...........");
    }else {

	
		      return      window.location.href = "../user/viewrequest";

		    // document.body.innerHTML = originalContents;

	}
}
	</script>
 
   <style type="text/css">
  
  

    #myprint { display: none; }
#print{  	


    background-repeat: no-repeat;
	font-size;20px;
  
    width:100%; 


}

#sale{  	


    background-repeat: no-repeat;
  
    width:100px; height:50px;


}
    @media print
    {
    	#non-printable { display: none; }
    	#printableArea { display: block; font-size:16; width:100%; }
		    	#myprint { display: block; font-size:16; width:100%; }

    }
    </style>
 <div class="row">
  
   	

   	<div class="col-md-12">
	
  
										<?php
 
   $session_data = $this->session->userdata('logged_in');
  $closedate=date("Y-m-d 23:59:59");
      $mydate=date("Y-m-d");
	  		      $startdate=date("Y-m-d 00:00:00");

 $date = Date('Y-m-d') ;
		 	 $year = Date('Y') ;
		  $month = Date('m') ;
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	         		$config = $this->usermodel->populateallarray('people','id',$userid);


 $allnames = $config[0]['firstname']." ".$config[0]['surname'];
	 
	  $contact = $config[0]['phone'];
	  
	  				
$finalsalesid ="EXP-".$userid.time();

 //$data['finalsalesid']="EXP-".$finalsalesid;

	  

	 
				$data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];

    $deleterequest=$this->usermodel->populatuserpermissionsdataarray('humanresource','delete',$userid);
	    $viewrequest=$this->usermodel->populatuserpermissionsdataarray('humanresource','view',$userid);
			 
    $approverequest=$this->usermodel->populatuserpermissionsdataarray('humanresource','approve',$userid);
	    $allocaterequest=$this->usermodel->populatuserpermissionsdataarray('humanresource','allocate',$userid);
			 
    $updaterequest=$this->usermodel->populatuserpermissionsdataarray('humanresource','update',$userid);
	    $addrequest=$this->usermodel->populatuserpermissionsdataarray('humanresource','add',$userid);
			    $addmembers=$this->usermodel->populatuserpermissionsdataarray('members','add',$userid);

			    $viewallpayroll=$this->usermodel->populatuserpermissionsdataarray('humanresource','viewallpayroll',$userid);

					    $bioattendance=$this->usermodel->populatuserpermissionsdataarray('humanresource','bioattendance',$userid);

 // $mydate=date("Y-m-d H:i:s");

$smsconfig = $this->usermodel->populateallarray('smsconfig','id',$companyid);
	  $starttime=$smsconfig[0]['starttime'];
		 $duetime=$smsconfig[0]['duetime'];

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="non-printable" >
            		<i class="entypo-plus-circled"></i>
											 	<a  id="more" class="btn btn-default" href="<?php echo base_url();?>user/viewrequest">  My Request  </a>

										                    
						 <a data-toggle='modal' data-target='#addModal' class="btn btn-default">Add Request </a>
						 
						 	<a  id="more" class="btn btn-warning" href="<?php echo base_url();?>user/viewrequestpending">  Pending request  </a>
												  	  				 <a href="<?php echo base_url();?>user/viewloan" class="btn btn-default">Apply Loan</a>

						
				<?php  
													 
	
	 if($allocaterequest==TRUE){

	 ?>

						 	<a  id="more" class="btn btn-default" href="<?php echo base_url();?>user/viewrequestallocation">  Allocate Money  </a>
		<?php 
		
	 }

	 ?>
	 
	 		<?php  
													 
	
	 if($viewallpayroll==TRUE){

	 ?>


										 	<a  id="more" class="btn btn-default" href="<?php echo base_url();?>user/viewemployee"> Process salary  </a>
						 	<a  id="more" class="btn btn-default" href="<?php echo base_url();?>user/salaryhistory"> Payroll History  </a>
						 	<a  id="more" class="btn btn-default" href="<?php echo base_url();?>user/payrollsetup"> Payroll Setup  </a>	
						 	<a  id="more" class="btn btn-default" href="<?php echo base_url();?>user/viewlabour"> Record Labour  </a>	


							<?php 
		
	 }

	 ?>
	 
	  	  				 <a href="<?php echo base_url();?>user/viewleaves" class="btn btn-default"> Leave Management</a>
	  	  			

							<?php  
													 
	
	 if($addmembers==TRUE){

	 ?>

                        <a data-toggle='modal' data-target='#addsupplierModal' class="btn btn-default">Add Employee </a>
		<?php 
		
	 }

	 ?>

					<?php  
													 
	
	 if($bioattendance==TRUE){

	 ?>

	  	  				 <a href="<?php echo base_url();?>user/allattendance" class="btn btn-default"> Biometric Attendance</a>
		<?php 
		
	 }

	 ?>
	  <div class="pull-right"  id="non-printable">
<form name="print" method="post" action="">
 <input type="submit" id="print"  accesskey="p" class="btn btn-primary"  name="print"onclick="printDiv('sortable')" value="print expense!" />
</form></div>
            	</div>
						<br>
						 <span class="pull-right"> View Expense Request</span>	

				<div class="row">
						<div class="col-md-12" id="non-printable">
<?php 
			 				echo $this->session->flashdata('deletemsg'); 

		 echo $this->session->flashdata('msg'); 
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchallmyrequest", $attr);?>
	

            
			
                <div class="col-md-2">
                    <input class="form-control" id="searchterm" name="searchterm" placeholder="General search.." type="text" value="<?php echo set_value('searchterm'); ?>" />
                </div>
				<input type="hidden" name="view" value="userdata/viewrequest"id="view" class="form-control" required placeholder="Enter status">

                  <div class="col-md-2">
                    <input id="btn_search" name="btn_search" type="submit" class="btn btn-default" value="Search" />
              
			
        <?php echo form_close(); ?>
					</div>
				</div>
				                 <div class="col-md-12" id="non-printable">

                 <div class="col-md-2">
           
		  <?php 
		 //$mydate=date("Y-m-d");

        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchallrequest", $attr);?>
			
				
				

    				   

	<select class="chzn-select" name="searchterm" style="width:200px; margin:0px;" required>
	
	<option value=""  >-Select Employee</option>
	<option value="all"  selected="selected">-All Employees-</option>

	


	<?php 
	 			$mycustomer  = $this->usermodel->populatealldatanoarrayorderby('people','firstname',"asc",'status', 1,'category', 'user');

			//$mycustomer= $this->usermodel->populatealldatawhere('people','firstname','ASC','companyid', $companyid);
	     // $mycustomer=$this->usermodel->populatealldatawhere('products','bulk',$userid);


if(is_array($mycustomer)) {

   foreach($mycustomer as $mycustomerrow){

   $company= $courserow->company;
   ?>
					<option value="<?=  $mycustomerrow->id;   ?>"><?=$mycustomerrow->firstname ." ".$mycustomerrow->surname." ".$mycustomerrow->phone; ?></option>




	<?php

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

	</div>
				
				
				
				  <div class="col-md-2">



   
	    <div class="col-md-12">
				<div class="col-sm-7">
					<div class="form-group">

                     		  		<input type="date" name="startdate" value="<?php echo set_value('fromdate',date("Y-m-d", strtotime($startdate))); ?>" class="form-control2" required placeholder="Enter start date">

					</div>
				</div>
				<div class="col-sm-5">
					<div class="form-group">
					

							  		<input type="time"  name="frotime" value="<?php echo set_value('frotime',$starttime.":00"); ?>" class="form-control2" required placeholder="Enter start time">

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







					</div>
				
				
				
				  <div class="col-md-2">
				
				
				
			

				<div class="col-sm-6">
					<div class="form-group">

		  		<input type="date" name="closedate" value="<?php echo set_value('closedate',date("Y-m-d", strtotime($closedate))); ?>" class="form-control2" required placeholder="Enter End date">

					</div>
				</div>
				<div class="col-sm-4">
					<div class="form-group">
					

							  		<input type="time"  name="totime" value="<?php echo set_value('totime',$duetime.":00"); ?>" class="form-control2" required placeholder="Enter stop time">

					</div>
				</div>
  
				
				
				
					</div>
					  <div class="col-md-1" >
<select class="form-control" name="branchid"  id="branchid" required>
	
	
	<option value=""  >---Select Branch/Counter to Open--</option>

									
									<option value="all"  >--All Branches/Counters-</option>


	
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

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



	<?php

}} else {
    echo 'No main counter available.';
}
	
?>
</select>
					</div>
				
				
				
				
				
                <div class="col-md-2">
				<select class="form-control" name="type" required >
	
	<option value=""  >---Select Status---</option>
		<option value="ApprovedActive"selected="selected"  >Approved / Active</option>
		<option value="Approved"  >Approved</option>

		<option value="Rejected"  >Rejected</option>
				<option value="Progress"  >Progress</option>
								<option value="Active"  >Active</option>

								<option value="Returned"  >Returned</option>
<option value="all"  >All status</option>


	</select>		 
				
                </div>
				                <div class="col-md-2">
 <input id="btn_search" name="btn_search" type="submit" class="btn btn-default" value="Search" />
                                    <a href="<?php echo base_url(). "user/viewrequest"; ?>" class="btn btn-default">Refresh</a>

				
				</div>
		
        <?php echo form_close(); ?>
            </div>
			 </div>	
				
				
				
            </div>
			
			<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >				
				<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
	
									
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable">			

             <thead>
			 <?php
			 
			 if(isset($configuration[0]['businessname'])) {
				 ?>
			 	 <tr>
								
								<td colspan="12" ><center  >
								
						
									

										<?php $bussinessname=$configuration[0]['businessname']; if(isset($bussinessname)) {echo   $bussinessname; }
										
									
										
										?>
												<span id="mytitle"></br><b> Expense Report between  <?PHP echo $finalstartdate ?> and <?PHP echo $finalclosetdate ?></b>		
								
								<br>Name----------------------Date--------------------Signature----------------</span>

								</center></td>
								
								
							</tr>
							<?php
			 }
							?>
         <tr>
		      <th id="non-printable">More</th>
			  		      <th>Type</th>

			      	      <th>Rq .No</th>

    	      <th>Requested by</th>
  <th>P.O No</th>
    	 
		   <th>Amount</th>

	      <th>Allocated</th>

		    <th>Date Applied</th>
		      <th>Approved by?</th>
	     <th>Description</th>
			<th>Status</th>	
	<th>Allocated</th>	
	<th>Accounted For?</th>				
	
				
		<th id="non-printable">More</th>

                 </tr>
             </thead>
<?php

 if(!is_array($viewexpenses)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='13'>";
    
       echo '<div class="alert alert-warning text-center">There are no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  $total=0;
    $totalallocated=0;

  	foreach ($viewexpenses as $c): 

		 

             ?>



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

  $total=(double)$total+(double)$c->amount;

?>
<td id="non-printable"><?php 
 $invoice_number=$c->invoice;
	
	  ?>
	  	  	  	 <a  id="more" class="btn btn-default" target="_blank"  href="<?php echo base_url();?>user/editexpenserequest?randomitemidentifier=<?php   {echo  $invoice_number;}  ?>">View   </a>

  </td>
    	  <td><?php echo $c->type ; ?></td>

  	  <td><?php echo $c->id ; ?></td>

<td>

	 <a id="non-printable" href="">

	 <?php  
	 $userids= $c->userid;
	  	 $myuser = $this->usermodel->populateallarray('people','id',$userids);
		 $names="";
   if($myuser!=FALSE){
 echo  $names=$myuser[0]['firstname']. " ".$myuser[0]['surname'] ;	

  }else{
	   //  echo "No Applicant";

	   
   }
// echo$c->user;
  ?>
  </a>
  
  <span id="myprint">
  <?php echo $names; ?>
  </span>


</td>

	  <td><?php echo $c->idno ; ?></td>
	  <td><?php echo formatMoney($c->amount, true);  ?></td>

           <td>
										<table border="1">			
						 
	<?php 
	
	
					// $branch="";
					 $bankid=$c->bankname;

					// $banking= $this->usermodel->populateall('debitcredit','code',$invoice_number);
	$banking = $this->usermodel->populatealldatanoarraythree('debitcredit','code', $invoice_number,'credit >',0,'companyid',$companyid);


$totalcredit=0;



if(is_array($banking)) {

   foreach($banking as $bankingrow){
	   
	   if($bankingrow->account !=="2130"){
	   
	   	 $glaccounts = $this->usermodel->populateallarray('glaccounts','number', $bankingrow->account);
					$accountname=$glaccounts[0]['accountname'];
					$methodes = $this->usermodel->populateallarray('paymentmethodes','id', $bankingrow->mode);
					$methodename=$methodes[0]['name'];

?>


<tr>

<td><b><?php  echo $accountname."-".$methodename; ?></b></td>
<td><b>
<?php 
  // $totaldebit=  $totaldebit+$bankingrow->debit;
	echo formatMoney($bankingrow->credit, true);
$totalcredit=(double)$totalcredit+(double)$bankingrow->credit;
?>
</b></td>

</tr>


 <?php
 
	   }
}
?>
<tr>
<td><b>TT Paid</b></td>
<td><b> <?php echo formatMoney($totalcredit, true);

$totalallocated=(double)$totalallocated+(double)$totalcredit;
 ?> </b></td>

</tr>
<?php
} else {
   echo "0.00";
}

	
?>

	 </table>											 
	 </td>    


	   
  <td><?php echo $c->datespent; ?></td>
	   <td>
	   
	   	 <?php  $controller= $c->controller ;

		  
		  	 $mycontroller = $this->usermodel->populateallarray('people','id',$controller);
		 
   if($mycontroller!=FALSE){
 echo $myname=$mycontroller[0]['firstname'];	   
   }else{
	     echo   $controller;

	   
   }

  ?>
	   
	   
	   
	   
	   
	   
	   </td>
	    <td><?php echo $c->description ; ?></td>
		  <td><?php echo $c->status ; ?></td>
		   <td><?php echo $c->allocation;
 if($c->allocation=="Yes"){
					   
	  	 $allocateduser = $this->usermodel->populateallarray('people','id',$c->updatedby);
		 $user="";
   if($allocateduser!=FALSE){
 echo  " :By ".$user=$myuser[0]['surname'] ;	

  }else{
	   echo "No user";

	   
   }

				   }


		   ?></td>
		   		   <td><?php echo $c->invoicestatus ;

				  
				   ?></td>

		
	   <td id="non-printable"> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									
                                    <ul class="dropdown-menu dropdown-default pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										<?php
										//
										if($approverequest==TRUE){
											
											?>
											
                                     	  <li> 

	 <a class="btn btn-default approvebtn" id="approvebtn" data-invoice='<?php echo  $c->invoice;?>'   data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#approveModal'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Approve / Reject
                                                </a>
                                                        </li>
															<?php
										}
										?>
										      <li class="divider"></li>
                                           
                                     	  <li> 

													 <?php  
													 
	 $allocation= $c->allocation ;
	 if(($allocaterequest==TRUE) && ($c->status=="Approved")){

   //if(($allocation=="no") || ($allocation=="No")){
	 ?>

	 <a class="btn btn-warning allocationebtn" id="allocationebtn" data-invoice='<?php echo  $c->invoice;?>'  data-balance='<?php echo  $c->balance;?>'  data-amount='<?php echo  $c->amount;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#allocateModal'> 	 


                                                <i class="glyphicon glyphicon-pencil"></i>
															Allocate Money
                                                </a>

	 <span style="color:green">  Already allocated</span>
	   
	   
	  <?php 
   
	}
  ?>    </li>
  
  
  
  
  
    	<li class="divider"></li>
		  <li> 

	 <a class="btn btn-default accountabilitybtn" id="accountabilitybtn" data-invoice='<?php echo  $c->invoice;?>'   data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#accountabilityModal'> 	 

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

  
  
  
												<li class="divider"></li>
														</li> 
														<li class="divider"></li>	

														  <li>
														  	 <a  id="more" class="btn btn-default" href="<?php echo base_url();?>user/viewmorerequestdocuments?randomitemidentifier=<?php   {echo  $invoice_number;}  ?>">Accountability Forms </a>

												</li>
														
												    <li class="divider"></li>	
										
											  <li>
											   <a  id="more" target="blank" class="btn btn-default" href="<?php echo base_url();?>user/viewrequestmessages?randomitemidentifier=<?php   {echo  $id;}  ?>">View Comments  </a>
												</li>
													
											<li class="divider"></li>
											<?php
										if($deleterequest==TRUE){
											
											?>
													<!---	
															  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#deleteModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
													-->	
													<?php
													}
											
														?>	
														
                                    </ul>
										
                                </div>
</td>
             </tr>

	<?php endforeach;} ?>
<tr>
<td id="non-printable"></td>
<td colspan="4">
<b>
Total Expense:
</b>
</td>
<td>
<b>
<?php 
if(isset($total)) {echo formatMoney($total, true);  }


?>
</b>
</td>
<td colspan="10">
<b>
<?php 
if(isset($totalallocated)) {echo formatMoney($totalallocated, true);  }


?>
</b>
</td>



</tr>
           

        </table>

			  <div class="col-md-12 text-center">    <?php echo $links; ?>
					   		<span style="color:red; font-size:20px"><?php  echo $total_rows. "  Records in the system. " ;?>    </span>

        
        </div>						
									
									
					</div>	
					
					
					
					
					
					
					
					
					
					
					
					
					
					
	
				<div id="addsupplierModal" 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">Add new  Employee</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addmember' , 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="status" value="1"id="status" class="form-control" required placeholder="Enter status">

<input type="hidden" name="view" value="user/viewrequest"id="view" class="form-control" required placeholder="Enter status">


	
		  		<input type="hidden" name="category" readonly     value="<?php echo set_value('category','supplier'); ?>" class="form-control"  placeholder="Enter ocategory">
		 
				
				
						
						
					<div class="form-group" style="display:none">
    <label for="inputcompany" class="col-sm-2 control-label">	Company Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="company" required value="<?php echo set_value('company','na'); ?>" 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"> Contact	Names<span style="color:red;">*</span></label>
    <div class="col-sm-10">
	
		  		<input type="text" name="firstname" value="<?php echo set_value('firstname'); ?>" class="form-control" required placeholder="Enter first and last name">
		 
				
		<span class="text-danger"> <?php echo form_error('firstname'); ?>
		
		</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" value="<?php echo set_value('phone'); ?>" class="form-control" required placeholder="Enter phone e.g 254712345678">
		 
				
		<span class="text-danger"> e.g 254712345678 <?php echo form_error('phone'); ?>
		
		</span>
	</div>
  </div>
  
   	<div class="form-group">
    <label for="inputphoneaddress_1" class="col-sm-2 control-label">Phone 2	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="address_1" value="<?php echo set_value('address_1'); ?>" class="form-control"  placeholder="Enter other line e.g 254712345678">
		 
				
		<span class="text-danger">Other Number e.g 254712345678 <?php echo form_error('address_1'); ?>
		
		</span>
	</div>
  </div>
  
   	<div class="form-group">
    <label for="inputphonegender" class="col-sm-2 control-label">Contact	Gender	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="gender" >
	
	<option value=""  >---Select Gender---</option>
	<option value="female"  >female</option>
		<option value="male"  >male</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('gender'); ?>
		
		</span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputcountry" class="col-sm-2 control-label">Country?</label>
    <div class="col-sm-10">
	<select class="form-control" name="country" >
	


	
	<?php 
					 
			$mycountry = $this->nationmodel->populatenation();
	


if(is_array($mycountry)) {

   foreach($mycountry as $mycountryrow){

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



	<?php

}} else {
    echo 'No country available.';
}
	
?>
	<option value=""  >---Select country---</option>
</select>
		
						<span class="text-danger"><?php echo form_error('country'); ?>

	</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" name="email" value="<?php echo set_value('email'); ?>" class="form-control"  placeholder="Enter Your email">
		 
				
		<span class="text-danger"> <?php echo form_error('email'); ?>
		
		</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" value="<?php echo set_value('idno'); ?>" class="form-control"  placeholder="Enter idno if any or Campany Pin">
		 
				
		<span class="text-danger"> <?php echo form_error('idno'); ?>
		
		</span>
	</div>
  </div>
  
  
  
     
  
  
  
  
    
  	<div class="form-group">
    <label for="inputcity" class="col-sm-2 control-label">	City 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="city" value="<?php echo set_value('city'); ?>" class="form-control"  placeholder="Enter City or town">
		 
				
		<span class="text-danger"> <?php echo form_error('city'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  	<div class="form-group">
    <label for="inputzip" class="col-sm-2 control-label">	Zip Code 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="zip" value="<?php echo set_value('zip'); ?>" class="form-control"  placeholder="Enter Zip Code">
		 
				
		<span class="text-danger"> <?php echo form_error('zip'); ?>
		
		</span>
	</div>
  </div>
  
  
  
 
  
  	
 
  
    	<div class="form-group">
    <label for="inputwebsite" class="col-sm-2 control-label">		Website/Link 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="website" value="<?php echo set_value('website'); ?>" class="form-control"  placeholder="Enter website if any">
		 
				
		<span class="text-danger"> <?php echo form_error('website'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputentrydate" class="col-sm-2 control-label">	Entry date  	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="entrydate" value="<?php echo set_value('entrydate'); ?>" class="form-control"  placeholder="Enter Entry date">
		 
				
		<span class="text-danger"> <?php echo form_error('entrydate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
	<div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">

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

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="member" name="btn_addmember" class="btn btn-default"> Add Employee   </button>

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

    

				</div>

		</div>
	    </div>
    </div>						
			
					<div id="approveModal" 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">Approval</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to process this application? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('user/approverequest' , 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="expenses">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewrequestpending">

 
 
 
   
   	<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=""  selected="selected">---Select Status---</option>
	<option value="Approved"  >Approved</option>
		<option value="Rejected"  >Rejected</option>
				<option value="Progress"  >Progress</option>
								<option value="Active"  >Active</option>

								<option value="Returned"  >Returned</option>

	</select>		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
  
  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Comments</label>
    <div class="col-sm-10">

				<textarea name="description" value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter any comments"></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		
 
 
 
 <div class="form-group">
    <label for="inputapproval" class="col-sm-2 control-label">Approval	SMS  to?</label>
    <div class="col-sm-10">
	<select class="form-control" name="approval" style ="width: 100%"  >
	
	<option value=""  >---Select task owner---</option>
			
				<option value="No"  >Don't send sms alert</option>

			
	
	
	
	<?php 
				
							$allusers  = $this->usermodel->populatealldatanoarrayorderby('people','firstname',"asc",'status', 1,'category', 'user');

	
	 						//$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->phone.")"; ?></option>



	<?php

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

	</div>
  </div>
  
 
 
 
 
 <input type="hidden" id="aprrovalid"name="aprrovalid" class="aprrovalid" placeholder="aprrovalid" value=""><br>
  <input type="hidden" id="aprrovalinvoice"name="aprrovalinvoice" class="aprrovalinvoice" placeholder="aprrovalinvoice" value=""><br>

 <button type="button" class="btn btn-warning" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_updateapproval" value="approval" class="btn btn-info"> Submit  </button>

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

  </div>

  </div>

  
  
  
  <div id="accountabilityModal" 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 Accountability status</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to update this application status? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('user/updateaccountabilityrequest' , 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="expenses">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewrequest">

 
 
 
   
   	<div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Accountability	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="status" required >
	
	<option value=""  selected="selected">---Has the application been accounted for fully?---</option>
	<option value="Yes"  >Yes</option>
		<option value="No"  >No</option>


	</select>		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
  
  
	
 
 <div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Comments</label>
    <div class="col-sm-10">

				<textarea name="description" value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter any comments"></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
 
 
 
 <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Number</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="idno" value="<?php echo set_value('idno'); ?>" class="form-control"  placeholder="Enter Invoice or Purchase Order Number if any ">
		 
				
		<span class="text-danger">Invoice / P Order / Sales Order No <?php echo form_error('idno'); ?>
		
		</span>
	</div>
  </div>
  
 
 
 
 
 
  <input type="hidden" id="accountid"name="accountid" class="accountid" placeholder="accountid" value=""><br>
  <input type="hidden" id="accountinvoice"name="accountinvoice" class="accountinvoice" placeholder="accountinvoice" value=""><br>

 
 
 <button type="button" class="btn btn-warning" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_updateaccountability" value="accountability" class="btn btn-default"> YES  </button>

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

  </div>

  </div>

  
  
  
  
  
  
  
  
  
  
  
					<div id="allocateModal" 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">Allocate Money</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to allocate money to this application? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		      $mydate=date("Y-m-d H:i:s");

                 echo form_open('user/allocaterequest' , 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="expenses">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewrequest">

 <div class="form-group">
    <label for="inputpaiddate" class="col-sm-2 control-label">Allocation Date</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="paiddate" value="<?php echo set_value('paiddate',$mydate); ?>" class="form-control" required placeholder="Enter Banking Date">
		 
				
		<span class="text-danger"> <?php echo form_error('paiddate'); ?>
		
		</span>
	</div>
  </div>
	      <div class="form-group">
    <label for="inputbankname" class="col-sm-2 control-label">Bank name?</label>
    <div class="col-sm-10">
	<select class="form-control" name="bankname" required>
	
	<option value=""  >---Select bank name---</option>
	
	<?php 
	$session_data = $this->session->userdata('logged_in');

  
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
		 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
					 
										$banking= $this->usermodel->populatealldatanoarray('glaccounts','companyid',$companyid,'accounttype','1');


	
if(is_array($banking)) {

   foreach($banking as $bankingrow){

   //echo $courserow->coursename;
    ?>
			<option value="<?=  $bankingrow->number;   ?>"><?=  $bankingrow->accountname ."(Acc No:". $bankingrow->number ."-Acc Name: ".$bankingrow->accountname."-Bal: ".$bankingrow->amount.")"; ?></option>



	<?php

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

	</div>
  </div>
  
	 
		


 
 
   
   	<div class="form-group">
    <label for="inputallocation" class="col-sm-2 control-label">Allocation	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="allocation" required >
	
	<option value="Yes"  selected="selected" >Yes</option>
		

	</select>		 
				
		<span class="text-danger"> <?php echo form_error('allocation'); ?>
		
		</span>
	</div>
  </div>
  	
					  <div class="form-group">
    <label for="inputamount" class="col-sm-2 control-label">Amount to allocate</label>
    <div class="col-sm-10">

	<input type="text"  name="amount" value="<?php echo set_value('amount'); ?>"id="allocationamount" class="form-control" required placeholder="Enter amount to allocate">
			<span class="text-danger"> <?php echo form_error('amount'); ?>
		
		</span>
	</div>
  </div>		
		
   	<div class="form-group">
    <label for="inputmode" class="col-sm-2 control-label">Method of payment	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="mode" required >
		<option value=""  selected="selected" >Select payment methode</option>

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

  
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
		 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
					 
									$paymentmethodes= $this->usermodel->populateall('paymentmethodes','companyid',$companyid);


	
if(is_array($paymentmethodes)) {

   foreach($paymentmethodes as $paymentmethodesrow){

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



	<?php

}} else {
    echo 'No Payment methode available.';
}
	
?>		

	</select>		 
				
		<span class="text-danger"> <?php echo form_error('mode'); ?>
		
		</span>
	</div>
  </div>
  
  
  <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Number</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="idno" value="<?php echo set_value('idno'); ?>" class="form-control"  placeholder="Enter Invoice or Purchase Order Number if any ">
		 
				
		<span class="text-danger">Invoice / P Order / Sales Order No <?php echo form_error('idno'); ?>
		
		</span>
	</div>
  </div>
  
   
  <div class="form-group">
    <label for="inputtransactioncode" class="col-sm-2 control-label">Transaction No / Chq No.</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="transactioncode" value="<?php echo set_value('transactioncode'); ?>" class="form-control"  placeholder="Enter transaction code or Mpesa Code if any ">
		 
				
		<span class="text-danger">Mpesa/Bank / Cheque Number<?php echo form_error('transactioncode'); ?>
		
		</span>
	</div>
  </div>
  
  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Comments</label>
    <div class="col-sm-10">

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

 
 
 
 <input type="hidden" id="allocationid"name="allocationid" class="allocationid" placeholder="allocationid" value=""><br>
  <input type="hidden" id="allocationinvoice"name="allocationinvoice" class="allocationinvoice" placeholder="allocationinvoice" value=""><br>

 <button type="button" class="btn btn-warning" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_updateallocation" value="allocation" class="btn btn-default"> YES  </button>

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

  </div>

  </div>
  
  
  
  
  
  
  
		<div id="deleteModal" 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="expenses">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewrequest">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-default" 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 class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add new Expense Request</h4>
      </div>
      <div class="modal-body">
      
	  	

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

$img_id = rand(100, 990000).time();

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addexpense' , 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="filename" value="viewrequest" class="form-control" required placeholder="Enter view">

<input type="hidden" name="myview" value="user/viewrequest" class="form-control" required placeholder="Enter view">
<input type="hidden" name="view" value="user/editexpenserequest?randomitemidentifier=" class="form-control" required placeholder="Enter view">

     								<input type="hidden" name="department" value="" class="form-control" required placeholder="Enter invoiceno">

     								<input type="hidden" name="action" value="insert" class="form-control" required placeholder="Enter invoiceno">
     								<input type="hidden" name="supplier" value="1" class="form-control" required placeholder="Enter invoiceno">
     								<input type="hidden" name="bankname" value="" class="form-control" required placeholder="Enter bankname">
				<input type="hidden" readonly name="imgid" value="<?php echo set_value('imgid'); ?>" class="form-control"  placeholder="Enter plot no">

								















					  <div class="form-group">
    <label for="inputbranchid" class="col-sm-2 control-label">Branch</label>
    <div class="col-sm-10">
				
				
				<select class="form-control" name="branchid"  id="branchid" required>
	
	
	<option value=""  >---Select Branch/Counter to Open--</option>

									
								

	
	<?php
	     $mybranch=$this->usermodel->populateall('branch','id',$branchid);


if(is_array($mybranch)) {

   foreach($mybranch as $branchrow){

   ?>
					<option selected="selected" value="<?=  $branchrow->id;   ?>"><?=  $branchrow->name; ?></option>




	<?php

}} else {
    echo 'No Branch available.';
}
	
?>
	
	
	
	
	
	
	
	
	
	
	
	
</select>
				
		</div>
  </div>
					
				



  <div class="form-group"  >
    <label for="inputtype" class="col-sm-2 control-label">Request type </label>
    <div class="col-sm-10">
	
<select class="form-control" name="type" required>
	<option selected="selected" value=""   >--Select Request type--</option>

	<option value="Request"   >General Expense Request</option>
	<option value="Advance"  >Advance Salary Request</option>
	<option value="Claim"  >Refund/Claim  Request</option>

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













								
  	
  	<div class="form-group">
    <label for="inputdatespent" class="col-sm-2 control-label">Request	Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="datespent" value="<?php echo set_value('datespent', $mydate); ?>" class="form-control" required placeholder="Enter date ">
		 
				
		<span class="text-danger"> <?php echo form_error('datespent'); ?>
		
		</span>
	</div>
  </div>


	<div class="form-group">
    <label for="inputtype" class="col-sm-2 control-label">Request	Ref No </label>
    <div class="col-sm-10">
	
			<input type="text" readonly name="invoice" value="<?php echo set_value('invoiceno',$finalsalesid); ?>" class="form-control" required placeholder="Enter invoiceno">

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

  
									<input type="hidden"  name="amount" value="0.00" class="form-control" required placeholder="Enter amount ">

									
		 
				
		
  
   	<div class="form-group">
    <label for="inputuser" class="col-sm-2 control-label">Your Name? </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="user"  value="<?php echo  $allnames;  ?>" class="form-control"  placeholder="Enter the person in charge">
		 
				
		<span class="text-danger"> <?php echo form_error('people'); ?>
		
		</span>
	</div>
  </div>
    
  	<div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Number</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="idno" value="<?php echo set_value('idno'); ?>" class="form-control"  placeholder="Enter Invoice or Purchase Order Number if any ">
		 
				
		<span class="text-danger">Invoice / P Order / Sales Order No <?php echo form_error('idno'); ?>
		
		</span>
	</div>
  </div>
 
	
		 
	
  <div class="form-group">
    <label for="inputcontact" class="col-sm-2 control-label">Your Contact </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="contact" value="<?php echo $contact; ?>" class="form-control"  placeholder="Phone of person incharge ">
		 
				
		<span class="text-danger"> <?php echo form_error('contact'); ?>
		
		</span>
	</div>
  </div>
  	
	
	
  
  <div class="form-group" style="display:none" >
    <label for="inputpaymentmethodes" class="col-sm-2 control-label">Payment mode </label>
    <div class="col-sm-10">
	
<select class="form-control" name="paymentmethodes" >
	<option value="" selected="selected"  >---Select payment methods---</option>

	
	
<?php 


	
	$paymentmethodes= $this->usermodel->populateall('paymentmethodes','companyid',$companyid);


	
if(is_array($paymentmethodes)) {

   foreach($paymentmethodes as $paymentmethodesrow){

    ?>
					<option value="<?=  $paymentmethodesrow->id;   ?>"><?=  $paymentmethodesrow->name; ?></option>



	<?php

}} else {
    echo 'No method.';
}
	
?>
</select>								
				 
				
		<span class="text-danger"> <?php echo form_error('controller'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
  	<div class="form-group" style="display:none">
    <label for="inputphoto" class="col-sm-2 control-label">	Upload Document</label>
    <div class="col-sm-10">
	<input type="hidden" name="img_id"   value="<?php if(isset($img_id)) {echo $img_id; }?>"  class="form-control">


	<input type="file" name="photo" value="<?php echo set_value('photo'); ?>"id="photo" class="form-control"  placeholder="Please upload image if any">
			<span class="text-danger"> <?php echo form_error('photo'); ?>
		
		</span>
	</div>		
</div>

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

				<textarea name="description" required value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter  details on what the expense is for."></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		

	
<div class="form-group">
    <label for="inputcontroller" class="col-sm-2 control-label">Approval?</label>
    <div class="col-sm-10">
	<select class="form-control" name="controller" required>
	
	<option value=""  >---Head of your Department---</option>

	
	
	
	
	<?php 
				
					$allusers = $this->usermodel->populatealldatanoarraythree('supervisor', 'companyid',$companyid,'status',"active",'id >',0);

	

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){
	   
	   $biodata= $this->usermodel->populateallarray('people','id',$userrow->employeeno);
		
$name=$biodata[0]['firstname'] ."  "  .$biodata[0]['surname'];

$email=$biodata[0]['email'] ;

    ?>
						<option value="<?=  $userrow->employeeno;   ?>"><?=  $name ."(". $email.")"; ?></option>




	<?php

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

	</div>
  </div>
  
  
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="expense" name="btn_addexpense" class="btn btn-default"> START THE REQUEST >>   </button>

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

    

				</div>

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





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

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

 
</div>


















