   <script>
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
	   </script>
	   	
 <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>
 <div class="row">
  
   	

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

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

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

 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
    $deletebank=$this->usermodel->populatuserpermissionsdataarray('accounting','deletebank',$userid);

  
  ?>
		<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 viewbanks  </span>
	  <a data-toggle='modal' data-target='#addModal' class="btn btn-primary">Add new payment  </a>
	  
	  				 <a href="<?php echo base_url();?>user/accounttype" class="btn btn-info">  View Payments</a>
				 	  				 <a href="<?php echo base_url();?>user/accounting" class="btn btn-info"> Back </a>

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



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

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



		
                 echo form_open('user/addglaccount' , 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="inputcustomer" class="col-sm-3 control-label">Customer ?</label>
    <div class="col-sm-9">
		
	
		<select class="chzn-select" name="customer" id="customer" >
	
	<option value=""  >---Select Customer/supplier---</option>

	


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


if(is_array($mycustomer)) {

   foreach($mycustomer as $mycustomerrow){

   //echo $courserow->coursename;
   ?>
					<option value="<?=  $mycustomerrow->id;   ?>"><?=  $mycustomerrow->idno ."". $mycustomerrow->firstname ." ".$mycustomerrow->lastname.""; ?></option>




	<?php

}} else {
    echo 'No Customer available.';
}
	
?>
</select>		
		  		
				
		<span class="text-danger"> 	<?php echo form_error('customer'); ?>
		
		</span>
	</div>
  </div>	
  	
		    <div class="form-group">
    <label for="inputamount" class="col-sm-3 control-label">  Amount Received:   </label>
    <div class="col-sm-9">
		
				<input type="text" name="amount" value="0" id="amount" class="form-control" required  placeholder="Please enter Account received ">

				
		</span>
	</div>
  </div>
		
	
	      <div class="form-group">
    <label for="inputaccounttype" class="col-sm-3 control-label"> Method of payments</label>
    <div class="col-sm-9">
	<select class="form-control" name="accounttype" required>
	
	<option value=""  selected="selected">---Select  Method of payments---</option>

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


	
if(is_array($Account)) {

   foreach($Account as $Accountrow){

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



	<?php

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

	</div>
  </div>
  
	 
	 
		
		
		
				
			  <div class="form-group">
    <label for="inputopeningdate" class="col-sm-3 control-label">	Payment Date </label>
    <div class="col-sm-9">

	<input type="text" name="openingdate" value="<?php echo set_value('openingdate',$mydate); ?>"id="openingdate" class="form-control" required placeholder="Enter specific date of opening  (dd-mm-YYY) ">
			<span class="text-danger"> <?php echo form_error('openingdate'); ?>
		
		</span>
	</div>
  </div>		
			
		
		
		
		
		
		
		
		<div class="form-group">
    <label for="inputnumber" class="col-sm-3 control-label">Transaction  Number: </label>
    <div class="col-sm-9">
	
		  		<input type="text" name="number" value="<?php echo set_value('number'); ?>" class="form-control" required placeholder="Enter  account number ">
		 
				
		<span class="text-danger"> <?php echo form_error('number'); ?>
		
		</span>
	</div>
  </div>
		
		    <div class="form-group">
    <label for="inputaccountname" class="col-sm-3 control-label"> Reference No:   </label>
    <div class="col-sm-9">
		
				<input type="text" name="accountname" value="<?php echo set_value('accountname') ;?>" id="dob" class="form-control" required  placeholder="Please provide your Account name ">

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

	      <div class="form-group">
    <label for="inputbankname" class="col-sm-3 control-label">Bank Name?</label>
    <div class="col-sm-9">
	<select class="form-control" name="bankname" required>
	
	<option value=""  selected="selected">---Select Sub Account name---</option>
		<option value=""  >---No sub account---</option>

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


	
if(is_array($banking)) {

   foreach($banking as $bankingrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $bankingrow->id;   ?>"><?=  $bankingrow->accountname ."(Acc type:". $bankingrow->accounttype .")"; ?></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="inputdescription" class="col-sm-3 control-label">Description</label>
    <div class="col-sm-9">

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

  
  	
		
  
  
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  name="btn_postgLaccount"  value="account"  class="btn btn-primary"> Add GL Account  </button>

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

    

				</div>

		</div>
	    </div>
    
			
			
		
		
  

 
</div>


















