<?php 
include "includes/header.php"; 
include "includes/Mdme-functions.php";
$mdme = getMdme_Rpt_Product_List($db,'');
include_once "includes/pagepermission.php";
//check permission - START
if(!($res_modm_prm)){
	header("Location:".admin_public_url."error.php");
}
else if(trim($res_modm_prm['ViewPrm'])=="0") {
	header("Location:".admin_public_url."error.php");
}
//check permission - END

include_once "common/dpselect-functions.php";
?> 


<div class="wrapper">
    <div class="container">
        <!-- Page-Title - START -->
        <div class="row">
            <div class="col-sm-12">  
		
				<h4 class="page-title">Manage Product List</h4>
					<div class="btn-group pull-right">
						<a  href="javascript:void(0);" onclick="return downloadcsv('rpt_product_list');" class="btn btn-primary  waves-effect waves-light">Download CSV <span class="icon-wrap"><i class="fa fa-download"></i></span>
						</a>
			</div>
				<input type="hidden" name="disptblname" id="disptblname" value="<?php echo "rpt_product_list"; ?>" />
				<!--<input type="hidden" name="rmv_sort_clm" id="rmv_sort_clm" value="<?php echo "4"; ?>" />-->
            </div>
        </div>
		<!-- Page-Title - END -->	
			
		<form class="form-horizontal" id="search" action="#" method="post" >
		<input type="hidden" name="action" id="action" value="<?php echo "rpt_product_list"; ?>" />	
		<div class="row">
            <div class="col-sm-12">
                <div class="card-box">                         
                    <div class="row">
					
					<div class="col-md-3">
							<?php 
							echo getSelectBoxFinancialYearlist($db, 'srch_FinancialYear', 'jsrequired');
							?>							
						</div>
						
						<div class="col-md-3">
							<?php 
							echo getSelectBox_companylist($db, 'srch_sup_company', 'jsrequired');
							?>							
						</div>
						
						<div class="col-md-3">
							<input type="text" name="startDate" id="startDate" placeholder="Start Date" class=" form-control" />						
						</div>
						
						<div class="col-md-3">
							<input type="text" name="endDate" id="endDate" placeholder="End Date" class=" form-control" />						
						</div>
						<div class="col-md-3">
							<?php 
							echo getSelectStockAvailbilitylist($db, 'srch_stock', 'jsrequired');
							?>							
						</div>
						
						<div class="col-md-2">
							<button onclick="datatblCalAdvanceSearch();" type="button" class="btn btn-warning pull-right">Search</button>
						</div>
						
					</div>
                </div>
            </div>
        </div>
		</form>
		<div class="row">
            <div class="col-sm-12">
                <div class="card-box table-responsive">                         
                    <table id="tblresult" class="table table-striped table-bordered">
                        <thead>
                            <tr>
								<th>Financial Year</th><th>Company Name</th><th>Purchase Date</th><th>Purchase Bill No</th><th>Product SKU</th><th>Image</th><th>Saree Description</th><th>Supplier Name</th><th>Purchase Rate</th><th>Stock Availability</th><th>Sales Bill No</th><th>Sales Bill Date</th><th>Customer Name</th><th>Sale Rate</th><th>Discount</th><th>Sale Rate(After Discount)</th><th>Tax </th><th>Final Sold Rate</th>
                            </tr>
                        </thead>                       
                    </table>
                </div>
            </div>
        </div> <!-- end row -->		

<div id="modal01" class="w3-modal" onclick="this.style.display='none'" style="z-index:111111;">
  <span class="w3-button w3-hover-red w3-xlarge w3-display-topright">&times;</span>
  <div class="w3-modal-content w3-animate-zoom">
    <img id="img01" style="width:100%">
  </div>
</div>

<?php include "includes/footer.php";  ?> 
	</div> <!-- container -->
</div> <!-- End wrapper -->

<?php include "includes/footer_script.php";  ?> 
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">

<script>
$(function () {   		
	datatblCalAdvanceSearch();		
});

function hoverImage(element) {
  document.getElementById("img01").src = element.src;
  document.getElementById("modal01").style.display = "block";
}

$(function () {	
	var date = new Date();
	var today = new Date(date.getFullYear(), date.getMonth(), date.getDate());		
	$('#startDate').datepicker({	
		format: 'dd/mm/yyyy',
		startDate: '-100y',
		endDate: '+0d',
		autoclose: true,	
		assumeNearbyYear:20,	
		todayHighlight: true
		
	});	
	
	$('#endDate').datepicker({	
		format: 'dd/mm/yyyy',
		startDate: '-100y',
		endDate: '+0d',
		autoclose: true,	
		assumeNearbyYear:20,	
		todayHighlight: true
		
	});	
	
	

});

</script>	

</body>
</html>
