<?php
	//Start session
	session_start();
	
	//Check whether the session variable SESS_MEMBER_ID is present or not
	/*if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
		header("location: index.php");
		exit();
	}*/
	/*if($_SESSION['SESS_REPORT']==0) {
		header("location: logout.php");
		exit();
	}*/
	
	$reportAccess = explode(',',$_SESSION['SESS_DEPT']);

?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>Report</title>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1"/>
<script type="text/javascript" src="../javascript/jquery.js"></script>
<script type="text/javascript" src="../javascript/report_page_rel.js"></script>
<script type="text/javascript" src="../javascript/common_rel.js"></script>
<script type="text/javascript" src="../javascript/picnet.table.filter.min.js"></script>
<script type="text/javascript" src="../javascript/jquery.autocomplete.js"></script>
<script type="text/javascript" src="../javascript/jquery.php_excel.js"></script>
<script type="text/javascript" src="../javascript/jquery.balloon.min.js"></script>
<script type="text/javascript" src="../javascript/jquery.sticktableheader.js"></script>
<script type="text/javascript" src="../javascript/jquery.datepick.min.js"></script>
<script type="text/javascript" src="../javascript/numbertowords.js"></script>
<script type="text/javascript" src="../javascript/json-to-table.js"></script>
<script type="text/javascript" src="../javascript/jNotify.jquery.js"></script>
<script type="text/javascript" src="../tablesorter/js/jquery.tablesorter.js"></script>

<!-- tablesorter widgets (optional) -->
<script type="text/javascript" src="../tablesorter/js/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" src="../tablesorter/js/jquery.tablesorter.widgets.js"></script>
<script type="text/javascript" src="../tablesorter/js/widgets/widget-math.js"></script>

<!-- choose a theme file -->
<link rel="stylesheet" href="../tablesorter/css/theme.default.css">
<link rel="stylesheet" href="../css/jNotify.jquery.css" type="text/css" />
<link rel="stylesheet" href="../css/redmond.datepick.css">
<link rel="icon" href="../images/infosollogosmall.gif" type="image/x-icon" />

<link rel="stylesheet" href="../css/jquery.autocomplete.css" type="text/css" />
<link rel="stylesheet" href="../css/stylereport.css"  type="text/css"/>
<link rel='stylesheet' type='text/css' href='../css/print.css' media="print" />



</head>

<body >
<div id="billdetailsrep" class="billdetailsrep" style="display:none" >
<input type='button' class='close button' id='detclose' value='X' style="    float: right;  width: 100% !important; "  />
<div id="billdet" class="billdet"></div>

</div>
    
    
<div id="excel_interstep"  style="display:none">
</div>
<div id="transperent" >
</div>
<div class="main">
  <div class="page">
     <?php include '../header.php'?>
    <div class="gap"></div>
  </div>
  <div class="left-panel">
    <?php include '../side_menu.php';?>
    <div class="gap"></div>
  </div>

  <div class="right-panel" >
  <?php 
	//include '../repemail.php';
	?>
  <table width="100%">
  <tr>
  <td width="80%" rowspan="3">
    <form action="" method="" class="form_report_view">
    <div style="border:1px solid #E4E4E4; padding:5px">
      <table width="100%"  >
        <tr>
          <td align="left" >Date: </td>
         
          <td>From:</td>
          <td align="left"><input name="reportdfrom" type="text" class="reportdfrom" id="reportdfrom"  size="20" value="<?php echo date('d/m/Y')?>" />    </td>
          <td align="left" width="10%"><div id="rel_field" ><select name="report_typewise" id="report_typewise"  autofocus>
         <option value='all'>Product Wise</option>
         <option value='partywise'>Partywise</option>
         <option value='partyproduct'>Product, Party </option>
         <option value='partyconsignee'>Party & Consignee</option>
         <option value='productconsignee'>Product & Consignee</option>
          <option value='productorder'>Product & order</option>
         <option value='consignee'>Consignee</option>
         <option value='citywise'>CityWise</option>
         <option value='agentwise'>Agent Wise</option>
         <option value='distributor'>Distributor</option>
         </select></div></td>
          <td align="left" width="10%"><input type="text" name="billedto"  class="billedto" id="billedto" size="30" style="display:none" placeholder="Type Buyer, Agent, consignee, Distributor"/>
          <input type="text" name="prodcode" class="prodcode" id="prodcode" size="30"  placeholder="Type Product Code" />
          <input type="text" name="citywise" class="citywise" id="citywise" size="30" style="display:none" placeholder="Type City"/>
          <input type="text" name="consignee" class="consignee" id="consignee" size="30" style="display:none" placeholder="Type Consignee"/>
          
          </td>
          <td align="right" width="40%">&nbsp;</td>
          <td align="left" width="20%">&nbsp;</td>
          </tr>
        <tr>
          <td>&nbsp;</td>
          <td>To:</td>
          <td align="left"><input name="reportdto" type="text" class="reportdto" id="reportdto" size="20" value="<?php echo date('d/m/Y')?>"  /></td>
          <td align="left" >Report Type:</td>
          <td align="left" ><select name="report_type" id="report_type"  autofocus style="    width: 100%;">
         <option selected='selected' value='allorders'>All Orders</option>
         <option value='pending'>Pending</option>
       
         <option value='inprocess'>In Production</option>
         </select></td>
          <td width="20%" align="left"><select name="subreport_type" id="subreport_type"  autofocus>
            <option selected='selected' value='clubedord'>None</option>
            <option value='orderwise'>Order Wise</option>
          </select></td>
          <td width="20%" >&nbsp;</td>
          </tr>
        
        <tr>
          <td align="left">Options:</td>
          <td>&nbsp;</td>
          <td align="left"><select name="report_view_type" id="report_view_type" class="report_view_type"  style="width: 100%;">
		  <option value="orderinfo">Order Info</option>
          <option value="Invoiceinfo">Invoice</option>
		  <option value="jobreg">Job Reg.</option>  
          <option value="led_det">Ledger Details</option>
          </select></td>
          <td align="left" ><select name="filter_type_book_info" id="filter_type_book_info" style="display:none" >
            <option value="none" selected>-select filter-</option>
            <option value="billno">Bill No</option>
            <option value="bookedby">Booked By</option>
            <option value="usedby">Guest</option>
            <option value="city">City</option>
            <option value="package">Package</option>
            <option value="dutytype">Duty Type</option>
            <option value="vehicle">Vehicle Type</option>
          </select>
            </td>
          <td align="left" ><input type="text" name="filter_type_value" id="filter_type_value" placeholder='value to filter' style="display:none"  /><div class="cov_lett_show" style="display:none;float:right">All  <input name="select_all" type="checkbox" id="select_all" value=""    /></div></td>
          <td colspan="2"  align="right" > <!--<input name="status_value" type="text" class="alter_status" id="status_value" size="30" style="width:100%; display:none"/>-->Press arrow keys to navigate through table</td>
          </tr> 
          <tr>
          <td align="left">&nbsp;</td>
          <td>&nbsp;</td>
          <td align="left">&nbsp;</td>
          <td align="left" >&nbsp;</td>
          <td colspan="3" align="left" ><div id="pager" class="pager" >
	<table width="100%" border="0" style="float:right">
  
  <tr>
    <td><img src="../tablesorter/css/images/icons/first.png" class="first" />
		<img src="../tablesorter/css/images/icons/prev.png" class="prev"/></td>
    <td><input type="text" class="pagedisplay" style="width:100%"/></td>
  
    <td><img src="../tablesorter/css/images/icons/next.png" class="next"/>
		<img src="../tablesorter/css/images/icons/last.png" class="last"/></td>
   <td><select class="pagesize">
        	<option selected="selected"  value="">All</option>
			<option   value="100">100</option>
			<option value="200">200</option>
			<option value="300">300</option>
			<option  value="400">400</option>
            
		</select></td>
        <td><select name="sort_value" id="sort_value" class="sort_table" >
        <option selected='selected' value=''>-select-</option>
        <option value='srno'>SR No.</option>
        <option value='billdate'>Bill Date</option>
        <option value='billdate,srno'>Bill Date,Sr No.</option>
        <option value='billto,srno'>Billed To,Sr No.</option>
        <option value='expst'>Expst</option>
        <option value='expst,srno'>Expst,Sr No.</option>
      </select></td>
  </tr>
<tr>
</table>
        
      

</div></td>
          </tr>    
        </table>
    
    </div>
    </form>
    </td>
    <td align="left" ><input  type="button" name="report_view" id="report_view" class="bill_refresh button"   value="View" style="padding-left:9;padding-right: 9" /></td>
    <td align="left" ><div class="reprint_bill_option" style="display:none">
      <input name="PrePrint" type="checkbox" id="PrePrint" value="" <?php if(isset($_SESSION['SESS_PREPRINT'])&&$_SESSION['SESS_PREPRINT']=='on') echo "checked='checked'";?>  />PriPrint
    </div>
    
    </td>
    <td align="left" ><div class="reprint_bill_option" style="display:none">
      <input name="CmpLogo" type="checkbox" id="CmpLogo" value="1" <?php if(isset($_SESSION['SESS_SHOWLOGO'])&&$_SESSION['SESS_SHOWLOGO']=='on') ;?>  />Logo
    </div></td>
    </tr>
  <tr>
    <td align="left" ><input  type="button" name="report_reset" id="report_reset" class="bill_refresh button"   value="Reset" style="padding-left:5;padding-right: 5" /></td>
    <td colspan="2" align="right" ><div class="reprint_bill_option" style="display:none">
      <input name="DSDetails" type="checkbox" id="DSDetails" value="" <?php if(isset($_SESSION['SESS_DSDET'])&&$_SESSION['SESS_DSDET']=='on') echo "checked='checked'";?>  />
      DS Details
    </div>
      <!--<input  type="button" name="excel_dump" id="excel_dump" class="bill_refresh button"   value="Dump" style="padding-left:5;padding-right: 5" />--></td>
    </tr>
  <tr>
    <td align="left" ><input  type="button" name="report_print" id="report_print" class="button"   value="Print" style="padding-left:11;padding-right: 11" /> <input type="button" value="Email/SMS" id="rep_email" class="rep_email button" style="display:none;"/></td>
    <td colspan="2" ><form action="report_export_excel.php" method ="post" > 
<input type="hidden" name="csv_text" id="csv_text">
<input type="submit" value="EXCEL " id="ex_excel" class="ex_excel button" onClick="getCSVData()" />
</form></td>
  </tr>
    </table>
            

    <div id="div_reportview" class="dataTableContainer">
    

    
    </div>
    

</div>
    <div id="message" class="messageBox" style=" text-align:left;color:red"></div>
  </div>
</div>
<script type="text/javascript">

$(document).ready(function(){
	 $("#billedto").autocomplete(
      "../client_fill.php",
      {
		    delay:10,
  			minChars:1,
  			matchSubset:1,
  			matchContains:1,
  			cacheLength:10,
			
			showResult:function(row,data) {
    	return row+"|"+data[2];

 		 },
  			autoFill:false
  		});
	
	$("#prodcode").autocomplete(
      "product_code_fill.php?mode=prodcode",
      {
		    delay:10,
  			minChars:1,
  			matchSubset:1,
  			matchContains:1,
  			cacheLength:10,
			
			showResult:function(row,data) {
    	return row;

 		 },
  			autoFill:false
  		});
		
		$("#consignee").autocomplete(
      "product_code_fill.php?mode=consignee",
      {
		    delay:10,
  			minChars:1,
  			matchSubset:1,
  			matchContains:1,
  			cacheLength:10,
			
			showResult:function(row,data) {
    	return row;

 		 },
  			autoFill:false
  		});
	
	$('#reportdfrom,#reportdto,#report_view_type').blur(function(){
    $(".spl_autofill").remove();
 	
	$("#driver").autocomplete(
      "driver.php?mode=reports&",
      {
		  resultsClass :'spl_autofill',
  			delay:10,
  			minChars:1,
  			matchSubset:1,
  			matchContains:1,
			mustMatch:0,
  			cacheLength:10,
  			autoFill:false
  		}
    );
	
	
	
	

	
});

});
	</script>
    
</body>
</html>
