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

$pagename 	= "Purchase Order - History";
$tabid 		= "2";
?>
<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 getrecord(hal){
		$.post('record_his.php',{page:hal,q:$('#q').val(),f1:$('#f1').val(),f2:$('#f2').val()},function(data){
			$('#output').html(data);
			})
		}
		$().ready(function(e) {
            getrecord(1);
        });
	</script>
</head>
<body>
<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-4">

						</div>
                        <div class="col-sm-8 tr">
					    	Cari : <input type="text" class="input w-50" id="q" name="q"  placeholder="Cari" onKeyUp="getrecord('1')">            
<select class="input"  id="f1" name="f1" onchange="getrecord()">
        		            <option value="">Semua Outlet</option>
                	        <?php
                    	       $sql = "select * from mst_outlet ORDER BY outlet_name";
								$dcon = $conn->query($sql) or die($sql);
								while($rst = $dcon->fetch_assoc()){
								?>
                                <option value="<?php echo $rst['outlet_autoid']?>"><?php echo $rst['outlet_name']?></option>
							<?php } ?>
							</select>
							<select class="input" onchange="getrecord()" name="f2" id="f2">
							<option value="">Semua Status</option>
							<option value="2">OK</option>
							<option value="99">Deleted</option>
							</select>
							
						</div>
                	</div>
			    </div>

                <div id="output" class="bg_white pb-2">

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

</html>