<!DOCTYPE HTML>
<?php 
include('config.php');

$pagename 	= "Jurnal - Biaya";
$tabid 		= "3";

$fdate = "01/".date('m/Y'); 
$tdate = date('d/m/Y');
?>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo $pagename?></title>
    <?php include('../../common/script_css.php');?>
    <script>
    function get_ledger(){
		query = {coa:$('#coa').val(),fdate:$('#fdate').val(),tdate:$('#tdate').val()}
		$.post('get_ledger',query,function(e){
			$('#output').html(e)
			})
		}
		$().ready(function(e) {
			$('#fdate').datepicker({
    			format: 'dd/mm/yyyy',
			   	startDate: '-3d'
			});	
			$('#tdate').datepicker({
    			format: 'dd/mm/yyyy',
			   	startDate: '-3d'
			});	

        });
    </script>
</head>
<body onLoad="full_screen()">
<form id="iform">
    <div class="wrapper">
        <!-- Sidebar  -->
		<?php include('../../sys/sidenav.php');?>

        <!-- Page Content  -->
        <div id="content_wrapper" class="mt-0">
			<?php include('../../sys/top_menu.php')?>
            <div class="px-3">
				<div id="tabheader">
				<?php include('tabheader.php')?>
                </div>
                
			    <div class=" tl div_button py-2">
					<div class="row pt-1">
                    	<div class="col-sm-6">
            			<select id="coa" class="form-control">
						<?php 
							$sqlb = mysqli_query($conn,"select * from mst_coa order by coa_accno");
							  while($rs=mysqli_fetch_array($sqlb)) {;
								  $lvl = $rs["coa_acclvl"];
								  $type = $rs["coa_acctype"];
								  $coa_autoid = $rs['coa_autoid'];
								  $coa_accno = $rs['coa_accno'];
								  $coa_accdesc = $rs['coa_accdesc'];
						?>
							  <option value="<?php echo $coa_autoid?>"><?php echo $coa_accno?> - <?php echo $coa_accdesc?></option>
						<?php } ?>
						</select>
						</div>
                        <div class="col-sm-6 tr">
                        	<input type="text"  id="fdate" class="form-control w-25 float-left" value="<?php echo $fdate?>" maxlength="10"> 
                            <span class="float-left pt-2"> - </span>
                            <input type="text" id="tdate"  class="form-control w-25 float-left" value="<?php echo $tdate?>" maxlength="10">
                            <input type="button" class="btn btn-primary btn-sm" value="View" onclick="get_ledger()">
						</div>
                	</div>
			    </div>

                <div id="output" class="bg_white pb-2" style="height:400px;overflow-y:scroll">

                </div>
            </div>
        </div>
        
    </div><!-- end wrapper -->
</form>
</body>

</html>