<link href="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/ui.theme.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/autocomplete.css" rel="stylesheet">
    <script src="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.min.js"></script>
	


 
            
        <script type="text/javascript">  
		
			   $(this).ready( function() {  
            $("#customerdata").autocomplete({  
 
                minLength: 1,  
                source:   
                function(req, add){  
                    $.ajax({  
                        url: "<?php echo base_url(); ?>Systemusers/customerSaleslookup",  
                        dataType: 'json',  
                        type: 'POST',  
                        data: req,  
                        success:      
                        function(data){  
                            if(data.response =="true"){  
                                add(data.message);  
                                console.log(data);
                            }  
                        },  
                    });  
                },  
                     
            });  
        });
		
 
  
		
		 $(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 maincategory = $(this).data('maincategory');
		   $("#maincategory").val(maincategory);
 
		    var name = $(this).data('name');
		   $("#name").val(name); 
		   
		     var enddate = $(this).data('enddate');
		   $("#enddate").val(enddate); 
		 
		     var startdate = $(this).data('startdate');
		   $("#startdate").val(startdate); 
		 
		    var status = $(this).data('status');
		   $("#status").val(status); 
		  var opening = $(this).data('opening');
		   $("#opening").val(opening); 
		 
		 
		  var closing = $(this).data('closing');
		   $("#closing").val(closing); 
		 
		   
		  var number = $(this).data('number');
		   $("#number").val(number); 
		 
		      
		  var category = $(this).data('category');
		   $("#category").val(category); 
		   
		   
		     var dateposted = $(this).data('dateposted');
		   $("#MYdateposted").val(dateposted); 
		   
        });
		
		


		
    </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> View Customer/supplier Closing and Opening Balances </span>					                     
						 <a data-toggle='modal' data-target='#addModal' class="btn btn-info">Add Customer/supplier Closing and Opening Balances  </a>


						 		 <a href="<?php echo base_url();?>user/viewconfiguration" class="btn btn-info"> Go back to configuration </a>	 
				   <a data-toggle='modal' data-target='#updatemyModal' class="btn btn-info">Close Customer/Balances (Fiscal Year )  </a>

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

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

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

				$data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];
   
 	$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'); 
							  $startdate=date("Y-m-d 00:00:00");
  $enddate=date("Y-m-d 23:59:59");
				echo $this->session->flashdata('msg'); 
								?>	
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
	
									
									
  <table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" id="example" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
         <tr>
     <th>Customer /Supplier Name </th>
	     <th>Category</th>
     <th>Name</th>
	     <th>Start date</th>
		 <th>Close  date</th>
		 		<th>Status</th>		 

		 		 <th>Opening</th>

				 		 <th>Closing</th>

		
	<th>More</th>	

                 </tr>
             </thead>
			 
			 <tbody>
<?php

 if(!is_array($customerfiscalyear)) 

 {


   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 ($customerfiscalyear as $c): 

		 

             ?>



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


?>

    
  <td><?php 
  
  
  $people = $this->usermodel->populateallarray('people','id',$c->number);
if($people[0]['company']!=""){
				 echo$names=$people[0]['company']. "  ".$people[0]['firstname'];

	
}else{
				 echo$names=$people[0]['firstname'];

}
  
  
  
  ?></td>     
  <td><?php echo $c->category ; ?></td>
      
  <td><?php 
  
  
   $myglaccounts = $this->usermodel->populateallarray('fiscalyear','id',$c->name);
  		 echo$names=$myglaccounts[0]['name'];
  ?></td>  
  <td><?php echo $c->startdate ; ?></td>
    
  
  
  
  	  <td><?php echo $c->enddate ; ?></td>

  
  
	  <td><?php echo $c->status ; ?></td>
	  
  	  <td><?php echo $c->opening ; ?></td>

  
  
	  <td><?php echo $c->closing ; ?></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>
									<?php
										if($usertype=="admin"){
											
											?>
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#myModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
									
									
                                        <li class="divider"></li>
                                        
                                     	  <li> 

	 <a class="btn btn-primary editbtn" id="editbtn"  data-dateposted='<?php echo  $c->dateposted;?>'  data-category='<?php echo  $c->category;?>'  data-number='<?php echo  $c->number;?>' data-closing='<?php echo  $c->closing;?>' data-opening='<?php echo  $c->opening;?>'  data-enddate='<?php echo  $c->enddate;?>'  data-startdate='<?php echo  $c->startdate;?>'   data-name='<?php echo  $c->name;?>'   data-status='<?php echo  $c->status;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editProductModel'> 	 

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

	<?php endforeach;} ?>

             
<tbody>
        </table>

									
									
									
					</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 Gl Fiscal Year</h4>
      </div>
      <div class="modal-body">
      
	  	

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

						  $dateposted = date('Y-m-d H:i:s');


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addcustomerfiscalyear' , 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="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">
			  			<input type="hidden" name="action" value="update"id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">

		  		<input type="hidden" name="dateposted" value="<?php echo set_value('dateposted'); ?>" id="MYdateposted" class="form-control" required placeholder="Enter number">

	
		  		<input type="hidden" name="number" value="<?php echo set_value('number'); ?>" id="number" class="form-control" required placeholder="Enter number">

	
  
  
  <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Select Fiscal Year </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="name" id="name"  required>
	<option value=""  selected="selected" ></option>

		<option value=""  >-Select gl account-</option>

		
	


	<?php 
	
					 
		//$glacounts= $this->usermodel->populateviewcustomers('glaccounts','id','ASC','companyid', $companyid);
	      //$glacounts=$this->usermodel->populateall('glaccounts','companyid',$companyid);

					 		$glacounts = $this->usermodel->populatealldatawhere('fiscalyear','id','desc','companyid',$companyid);

if(is_array($glacounts)) {

   foreach($glacounts as $glacountsrow){

   ?>
					<option value="<?=  $glacountsrow->id;   ?>"><?=  $glacountsrow->name." (From ".$glacountsrow->startdate." to ". $glacountsrow->enddate.")"; ?></option>




	<?php

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

  	<div class="form-group">
    <label for="inputstartdate" class="col-sm-2 control-label">	Start Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="startdate" id="startdate" value="<?php echo set_value('startdate'); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> YYY-M-D <?php echo form_error('startdate'); ?>
		
		</span>
	</div>
  </div>
 	<div class="form-group">
    <label for="inputstenddate" class="col-sm-2 control-label">	End Date </label>
    <div class="col-sm-10">
	 
		  		<input type="text" name="enddate" id="enddate" value="<?php echo set_value('enddate'); ?>" class="form-control" required placeholder="Enter end date">
		 
				
		<span class="text-danger"> YYY-M-D<?php echo form_error('enddate'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputopening" class="col-sm-2 control-label">	Opening Balance </label>
    <div class="col-sm-10">
	 
		  		<input type="text" name="opening" id="opening" value="<?php echo set_value('opening'); ?>" class="form-control" required placeholder="Enter  opening balance">
		 
				
		<span class="text-danger"> <?php echo form_error('opening'); ?>
		
		</span>
	</div>
  </div>
		 <div class="form-group">
    <label for="inputclosing" class="col-sm-2 control-label">	Closing Balance </label>
    <div class="col-sm-10">
	 
		  		<input type="text" name="closing" id="closing" value="<?php echo set_value('closing'); ?>" class="form-control" required placeholder="Enter  closing balance">
		 
				
		<span class="text-danger"> <?php echo form_error('closing'); ?>
		
		</span>
	</div>
  </div>
		
		
	<div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">Category </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="category" id="category"  required>
	<option value=""  selected="selected" ></option>

	<option value="member"  >Customer</option>
		<option value="supplier"  >supplier</option>
			<option value="accommodation"  >tenants</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
	
			
	<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" id="status"  required>
	<option value=""  selected="selected" ></option>

	<option value="active"  >active</option>
		<option value="closed"  >closed</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit" class="btn btn-primary"  value="year" name="addcustomerfiscalyear"> Update Fiscal Year   </button>

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

    

				</div>

		</div>
	    </div>
    </div>
					
					
					
					
					
					
					
						<div id="updatemyModal" 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 balances</h4>
		
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');
		  $new_date=date("Y-m-d H:i:00");		

 $frm=date("Y-m-d H:i:00");	

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/updatecustomersupplierfiscalyear' , 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="type" value="product"id="type" class="form-control" required placeholder="Enter type">
				<input type="hidden" name="view" value="user/viewloyality"id="view" class="form-control" required placeholder="Enter view">
	
	

<div class="form-group">
    <label for="inputsupplier" 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.';
}
	
?>
	
	
	
	
	
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

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



	<?php

}} else {
    echo 'No main counter available.';
}
	
?>
</select>
				
		</div>
  </div>
					
				
				
				
		<div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">Category </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="category" required >
	<option value=""  selected="selected" >Select Category</option>

	<option value="member"  >Customer</option>
		<option value="supplier"  >supplier</option>
			<option value="accommodation"  >accommodation</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('category'); ?>
		
		</span>
	</div>
  </div>
	


  <div class="form-group">
    <label for="inputfiscalyear" class="col-sm-2 control-label">	Close fiscal year?</label>
    <div class="col-sm-10">
	<select class="form-control" name="fiscalyear"  id="fiscalyear" required>
	
	<option selected="selected" value="all"  >--Current fiscal year--</option>

	
	<?php 

					 		$productcategory = $this->usermodel->populatealldatawhere('fiscalyear','id','desc','companyid',$companyid);

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


							


if(is_array($productcategory)) {

   foreach($productcategory as $productcategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $productcategoryrow->id;   ?>"><?=  $productcategoryrow->name." (From ".$productcategoryrow->startdate." to ". $productcategoryrow->enddate.")"; ?></option>



	<?php

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

	</div>
  </div>

	





  <div class="form-group">
    <label for="inputopenfiscalyear" class="col-sm-2 control-label">	Open fiscal year?</label>
    <div class="col-sm-10">
	<select class="form-control" name="openfiscalyear"  id="openfiscalyear" required>
	
	<option selected="selected" value="all"  >--Current fiscal year--</option>

	
	<?php 

					 		$productcategory = $this->usermodel->populatealldatawhere('fiscalyear','id','desc','companyid',$companyid);

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


							


if(is_array($productcategory)) {

   foreach($productcategory as $productcategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $productcategoryrow->id;   ?>"><?=  $productcategoryrow->name." (From ".$productcategoryrow->startdate." to ". $productcategoryrow->enddate.")"; ?></option>



	<?php

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

	</div>
  </div>






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

  

	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="loyatity" name="btn_postcustomersupplierfiscalyear"  class="btn btn-primary"> Post Balance   </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="customerfiscalyear">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/customerfiscalyear">
 <input type="text" 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 class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add new Fiscal Year</h4>
      </div>
      <div class="modal-body">
      
	  	

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

  $dateposted = date('Y-m-d H:i:s');






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


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addcustomerfiscalyear' , 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="insert"id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">
		  			<input type="hidden" name="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">

	
<div class="form-group">
    <label for="inputsupplier" 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.';
}
	
?>
	
	
	
	
	
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

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



	<?php

}} else {
    echo 'No main counter available.';
}
	
?>
</select>
				
		</div>
  </div>
					
				
				
		<div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">Category </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="category" required >
	<option value=""  selected="selected" >Select Category</option>

	<option value="member"  >Customer</option>
		<option value="supplier"  >supplier</option>
			<option value="tenants"  >accommodation</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('category'); ?>
		
		</span>
	</div>
  </div>
	
	
	
	
	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">Customer	Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="customerdata" name="number" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter name e.g 2018 Fiscal Year">
		 
						  		<input type="hidden" name="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter name e.g 2018 Fiscal Year">

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





  <div class="form-group">
    <label for="inputfiscalyear" class="col-sm-2 control-label">	Current fiscal year?</label>
    <div class="col-sm-10">
	<select class="form-control" name="fiscalyear"  id="fiscalyear" required>
	
	<option selected="selected" value="all"  >--Current fiscal year--</option>

	
	<?php 

					 		$productcategory = $this->usermodel->populatealldatawhere('fiscalyear','id','desc','companyid',$companyid);

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


							


if(is_array($productcategory)) {

   foreach($productcategory as $productcategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $productcategoryrow->id;   ?>"><?=  $productcategoryrow->name." (From ".$productcategoryrow->startdate." to ". $productcategoryrow->enddate.")"; ?></option>



	<?php

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

	</div>
  </div>

	











  
  
  	<div class="form-group" style="display:none">
    <label for="inputstartdate" class="col-sm-2 control-label">	Star Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="startdate" value="<?php echo set_value('startdate',$startdate); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger">YYY-M-D <?php echo form_error('startdate'); ?>
		
		</span>
	</div>
  </div>
  	<div class="form-group" style="display:none">
    <label for="inputstenddate" class="col-sm-2 control-label">	End Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="enddate" value="<?php echo set_value('enddate',$enddate); ?>" class="form-control" required placeholder="Enter end date">
		 
				
		<span class="text-danger"> YYY-M-D<?php echo form_error('enddate'); ?>
		
		</span>
	</div>
  </div>
		 <div class="form-group">
    <label for="inputopening" class="col-sm-2 control-label">	Opening Balance </label>
    <div class="col-sm-10">
	 
		  		<input type="text" name="opening" id="opening" value="<?php echo set_value('opening'); ?>" class="form-control" required placeholder="Enter  opening balance">
		 
				
		<span class="text-danger"> <?php echo form_error('opening'); ?>
		
		</span>
	</div>
  </div>
		 <div class="form-group">
    <label for="inputclosing" class="col-sm-2 control-label">	Closing Balance </label>
    <div class="col-sm-10">
	 
		  		<input type="text" name="closing" id="closing" value="<?php echo set_value('closing'); ?>" class="form-control" required placeholder="Enter  closing balance">
		 
				
		<span class="text-danger"> <?php echo form_error('closing'); ?>
		
		</span>
	</div>
  </div>
		
	<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=""   >Select status</option>

	<option value="active" selected="selected" >active</option>
		<option value="closed"  >closed</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
	
         <div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">Date Created	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="dateposted" value="<?php echo set_value('dateposted',$dateposted); ?>" id="dateposted" class="form-control" required placeholder="Enter number">
		 

		<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" class="btn btn-primary"  value="year" name="addcustomerfiscalyear"> Add Fiscal Year   </button>

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

    

				</div>

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





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

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

 
</div>


















