<?php 

require_once("config/configDB.php"); 
require "userPermission.php";
require "financial_year_calculation.php";

?>

<!DOCTYPE html>
<html>
<head>
    <title>Sale Dashboard</title>
    <?php require 'header.php' ?>
    

</head>
<body>
    <?php require 'menu.php' ?>

<div class="container-fluid text-right col-sm-12 sale-dashboard-add">
<?php if($Employee_Advanc_Add==1) {  ?>     
<a href="advanceAdd.php" class="btn btn-primary">Add</a>
<?php } ?>
</div>

<div class="container col-sm-12">

<table id="saleDashboard" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>Adv No</th>
                <th>Date</th>
                <th>Employee</th>
               
                <th>Amount</th>
                 <th>Remarks</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            
                    
           
        </tbody>
       
    </table>
    
</div>



    <?php require 'footer.php' ?>

    <script>


$(document).ready(function() {
			   var dataTable =  $('#saleDashboard').DataTable( {
			   	    responsive: {
					details: {
					    renderer: function ( api, rowIdx ) {
						var data = api.cells( rowIdx, ':hidden' ).eq(0).map( function ( cell ) {
						    var header = $( api.column( cell.column ).header() );
						    return  '<p style="color:#00A">'+header.text()+' : '+api.cell( cell ).data()+'</p>';
						} ).toArray().join('');
 
						return data ?    $('<table/>').append( data ) :    false;
					    }
					}
				    },
			   	processing: true,
				serverSide: true,
                aaSorting: [[0, 'desc']],
				//ajax: "test.js", // json datasource
				ajax: {
                    url : "employee_advance_griddata.php",
                    type: 'POST',
                    data:  {
                        userpermissionEdit   : "<?php echo $Employee_Advanc_Edit; ?>",
                        userpermissionDelete : "<?php echo $Employee_Advanc_Delete; ?>",
                        userpermissionPrint  : "<?php echo $Employee_Advanc_Print; ?>"
                    }
                }
			    } );
			} );
</script>
</body>
</html>