<?php
ini_set('display_errors', 0);
//error_reporting(E_ALL);
//ini_set('display_errors', 1);

session_start();
ob_start();

require_once('configuration/server_connect.php');
require_once('configuration/all_function.php');

$active_id=$_REQUEST['active_id'];
$menu_id=$_REQUEST['menu_id'];

//do_calander('#jv_date');
// Common Information

$page_title="Advanced Reports";



// End Common Information







?>




<!DOCTYPE html>
<html lang="en">

<!-- ======= <head> ======= -->
 <?php require_once('inc_files/inc_head.php'); ?>
<!-- ======= </head> ======= -->


  <?php
  do_calander('#fdate');
  do_calander('#tdate');
  ?>
 
 
 <script language="javascript">

function count(){



var total_unit=(document.getElementById('total_unit').value)*1; 

var unit_price=(document.getElementById('unit_price').value)*1;

document.getElementById('total_amt').value=(total_unit*unit_price);



}


function count_total_cal(){
var sub_total_amt=(document.getElementById('sub_total_amt').value)*1; 
var vat_amt=(document.getElementById('vat_amt').value)*1; 
var advance_amt=(document.getElementById('advance_amt').value)*1; 
document.getElementById('invoice_amt').value=(sub_total_amt+vat_amt)-advance_amt;

}




//window.onload = function() {
//  document.getElementById("itemin").focus();
//};






</script>

<body>

  <!-- ======= Header ======= -->
  <?php 
  require_once('inc_files/inc_header.php');
  ?><!-- End Header -->

  <!-- ======= Sidebar ======= -->
   <?php  require_once('inc_files/inc_menu.php'); ?>
   <!-- End Sidebar-->

  <main id="main" class="main">

    <div class="pagetitle">
      <h1><?php echo $page_title?></h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="home.php">Home</a></li>
          <li class="breadcrumb-item">Reports</li>
          <li class="breadcrumb-item active"><?php echo $page_title?></li>
        </ol>
      </nav>
    </div><!-- End Page Title -->

    <section class="section">
      <div class="row">
        

        <div class="col-lg-12">

          <div class="card">
            <div class="card-body">
              
			  <br>


              <!-- General Form Elements -->
                <form class="row g-3" action="01_advanced_master_report.php" method="post" name="form1" id="form1"  target="_blank" style="font-size:14px;">
                <div class="col-md-6">
                 <label for="first_name" class="form-label"><strong>From Date</strong></label>
                 <input type="text" class="form-control" id="fdate" name="fdate" value="<?php echo isset($_REQUEST['fdate'])?$_REQUEST['fdate']:date('Y-m-01');?>" >
			    
                </div>
				
				<div class="col-md-6">
                 <label for="first_name" class="form-label"><strong>To Date</strong></label>
     			<input type="text" name="tdate" id="tdate" class="form-control"  value="<?php echo isset($_REQUEST['tdate'])?$_REQUEST['tdate']:date('Y-m-d');?>" />
			   
                </div>
				
				<div class="col-md-4">
                 <label for="first_name" class="form-label"><strong>Category</strong></label>
            <select id="item_category" name="item_category"  class="form-select"    >
			<option></option>
			
			<?php foreign_relation($conn,'item_category','id','item_category',$_POST['item_category'],'1 order by id');?>
		
        	</select>
			    
                </div>
				
				<div class="col-md-4">
                 <label for="first_name" class="form-label"><strong>Item Name</strong></label>
     		<select id="item_id" name="item_id"  class="form-select"    >
			<option></option>
			<?php foreign_relation($conn,'item_info','item_id','concat(sku_code, " :: ", item_name)',$_POST['item_id'],'1 order by item_category, sku_code');?>
		
        	</select>
			   
                </div>
				
				<div class="col-md-4">
                 <label for="first_name" class="form-label"><strong>Customer</strong></label>
     	<select id="ref_no" name="ref_no"   class="form-select"    >
		  <option></option>
			
			<?php foreign_relation($conn,'accounts_reference','ref_no','display_name',$_POST['ref_no'],'ref_type=2 order by ref_no');?>
        	</select>
			   
                </div>
				
				<div class="col-md-12">
				</div>
				<div class="col-md-12">
				</div>
				
				
				
				
				
				
				
		<div class="col-lg-12">

          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Select Report</h5>

              <!-- List group With Icons -->
     <ul class="list-group list-group-flush" style="font-size:14px;">
        <!--<li class="list-group-item"> <input name="report" type="radio" class="radio" value="2507250001" checked="checked"/> Date By Date Milk Receive Report </li>-->
	<?php /*?><li class="list-group-item"> <input name="report" type="radio" class="radio" value="2507250002"  checked="checked"/> Date By Date Milk Receive Report </li>
    <li class="list-group-item"> <input name="report" type="radio" class="radio" value="2507250003"  /> Daily Milk Comparison Report </li> <?php */?>
	<li class="list-group-item"> <input name="report" type="radio" class="radio" value="2507250004"  checked="checked" /> Daily Sales Report (Date Wise) </li>   
	<li class="list-group-item"> <input name="report" type="radio" class="radio" value="2511050001"   /> Sales Summary Report </li>     
	<?php /*?><li class="list-group-item"> <input name="report" type="radio" class="radio" value="2507250005"  /> Daily Cattle Feeding Expense </li> 
	<li class="list-group-item"> <input name="report" type="radio" class="radio" value="2507250008"  /> Daily Cattle Medicine Expense </li> 
	<li class="list-group-item"> <input name="report" type="radio" class="radio" value="2507250006"  /> Cattle Information Details </li>
	<li class="list-group-item"> <input name="report" type="radio" class="radio" value="2507250007"  /> Calf Information Details </li><?php */?>           
              
              </ul><!-- End List group With Icons -->

            </div>
          </div>

        </div>
                
				
                   

                <div class="text-center">
				<button type="submit" class="btn btn-success rounded-pill btn-sm">&nbsp;<i class="bi bi-filter me-1"></i> Run Report&nbsp;&nbsp;</button>
                </div>

              </form><!-- End General Form Elements -->

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






 
 
          

      </div>
    </section>
	
	

  </main><!-- End #main -->

 <!-- ======= Footer ======= -->
 <?php require_once('inc_files/inc_footer.php'); ?>
<!-- ======= Footer ======= -->
<?php selected_two("#item_category"); ?>
<?php selected_two("#item_id"); ?>
<?php selected_two("#ref_no"); ?>
</body>

</html>