<?php
$query="SELECT id,sales_type FROM ".$prefix."sales_types ORDER BY id ASC";
$salesType=mysqli_query($linkid,$query);

$query="SELECT terms_indicator,terms FROM ".$prefix."payment_terms where inactive=0 ORDER BY terms_indicator ASC";
$accountType=mysqli_query($linkid,$query);
?>
<script type="text/javascript" language="javascript">

function getDateRange(){

		 if (document.form_validation_reg.daterange.checked)

			{

			   d_protection = $('#daterange').val();

			   //alert(d_protection);

			   if(d_protection==1){

				$("#startdateval").show();

				$("#enddateval").show();

				return false;

				}

			}

			

		else 

			{

				

				$("#startdateval").hide();

				$("#enddateval").hide();

				return false;

			}	

}

</script>

<div id="contentwrapper">
  <div class="main_content">
    <nav>
      <div id="jCrumbs" class="breadCrumb module">
        <ul>
          <li> <a href="#"><i class="icon-home"></i></a> </li>
          <li> <a href="#">Reports</a> </li>
          <li> <a href="index.php?tab=invoice-report">Invoice Summary Report</a> </li>
        </ul>
      </div>
    </nav>
    <div class="row-fluid">
      <div class="span12">
        <h3 class="heading">Invoice Summary Report</h3>
        <form class="form_validation_reg" id="form_validation_reg" name="form_validation_reg" action="invoice-summary.php" method="post" target="_blank">
          <div class="formSep">
            <div class="row-fluid">
              
              <div class="span2" id="startdateval">
                <label>Start Date <span class="f_req">*</span></label>
                <input type="text" name="startdate" id="startdate" class="span12" />
              </div>
              <div class="span2" id="enddateval">
                <label>End Date <span class="f_req">*</span></label>
                <input type="text" name="enddate" id="enddate" class="span12" />
              </div>
              <div class="span3">
              <label>Sales Type</label>
              <select id="mode" name="mode">
              	<OPTION VALUE="All">All</OPTION>
                  <?php
						if($salesType)
						{
						   while($mydata=mysqli_fetch_row($salesType))
							{
							 echo "<option value='$mydata[0]'>$mydata[1]</option>";
							}
						}	
					?>
              </select>
            </div>
			<div class="span2">
                <label>Sales Person</label>
                <SELECT class="input_text" name="head" id="head">
                  <OPTION SELECTED VALUE="">Please Select</OPTION>
				  <OPTION VALUE="All">All</OPTION>
                  <?php

					if($accountType)

					{

					   while($mydata=mysqli_fetch_row($accountType)){

						 echo "<option value='$mydata[0]'>$mydata[1]</option>";

						}

					}	

						?>
                </SELECT>
              </div>

              
            </div>
          </div>
          <div class="form-actions">
            <input class="btn btn-inverse" name="submit" type="submit" value="Submit"/>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
