<?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.html");
		exit();
	}
	/*if($_SESSION['SESS_VOUCHER']==0) {
		header("location: logout.php");
		exit();
	}*/

?>
<!--
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>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
<title>Voucher Home</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/vchreg_rel.js"></script>
<script src="../javascript/common_rel.js"></script>

<script type="text/javascript" src="../javascript/jquery.sticktableheader.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/picnet.table.filter.min.js"></script>
<script type="text/javascript" src="../javascript/jquery.datepick.min.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.widgets.js"></script>
<script src="../tablesorter/js/widgets/widget-scroller.js"></script>


<!-- choose a theme file -->
<link rel="stylesheet" href="../tablesorter/css/theme.default.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>
<link rel="stylesheet" href="../css/style.css"  type="text/css">
</link>

</head>

<body >
<div id="excel_interstep"  style=" display:none">
</div>
<div id="upcomingDuties" class="upcomingDuties">
<div style=" background-color:white; height:0px;overflow-y: auto;" class="dataDiv dataTableContainer" > </div>

<div class="dragDown">Outstanding Bills</div >

</div>



<div id="tally_status" style="right: 0px;position: absolute;width: 40%;background-color: #F8B7B2;height: 90px;overflow-y: auto; 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">
  
      <table cellspacing="5px">
        <tr>
          <td  height="40"><fieldset class="bookingdetail" id="bookingdetail" >
              <legend>Date Range</legend>
              <table>
                <tr>
                  <td><input autocomplete="off" class="from" id="from" type="text" size="10" placeholder="<?php echo date('d/m/Y')?>" title="Date From"  /></td>
                  <td><input autocomplete="off" class="to" id="to" type="text" size="10" placeholder="<?php echo date('d/m/Y')?>" title="Date To" /></td>
                </tr>
              </table>
            </fieldset></td>
        <td><fieldset class="sortby" id="sortby" >
              <legend>Voucher Type</legend>
              <table >
                <tr>
                  <td ><select name="vouchertype" id="vouchertype">
                    <option value="RECEIPT" selected="selected">RECEIPT</option>
                    <option value="PAYMENT">PAYMENT</option>
                    <option value="SALES">SALES</option>
                    <option value="PURCHASE">PURCHASE</option>
                    <option value="JOURNAL">JOURNAL</option>
                    <option value="CONTRA">CONTRA</option>
                    <option value="CREDITNOTE">CREDITNOTE</option>
                     <option value="LEDGER">LEDGER</option>
                  </select></td>
              </table>
            </fieldset></td>
        <td><fieldset class="cmp" id="cmp" >
              <legend>Company</legend>
              <table >
                <tr>
                  <td><select name="cmpsort" id="cmpsort">
                  <option selected="selected" value="<?php echo $_SESSION['SESS_CMPC']; ?>"><?php echo $_SESSION['SESS_CMPC']; ?></option>
                      
                    
                      
                    </select></td>
                </tr>
              </table>
            </fieldset></td>
        <!--<td><fieldset class="branch" id="branch" >
              <legend>Branch</legend>
              <table>
                <tr>
                  <td><select name="brasort" id="brasort">
                      <option>HO</option>
                     
                    </select></td>
                </tr>
              </table>
            </fieldset></td>-->
            <!--<td><fieldset class="" id="" >
              <legend>Company</legend>
              <table>
                <tr>
                  <td> <input class="billedto" name="billedto" id="billedto" type="text" size="10" /></td>
                </tr>
              </table>
            </fieldset></td>-->
            <td>  <fieldset class="sort_by" id="sort_by" >
              <legend>Fillter By</legend>
              <table >
                <tr>
                  <td><select name="filltertype" id="filltertype"  style="width: 95px;">
                     <option selected="selected">COMPANY</option>
                     <option>BILLNO</option>
                      <option value="CITY">CITY</option>
                      <option value="ACCOUNT">ACCOUNT</option>
                       <option value="VCHSEARCH" >VOUCHER SEARCH</option>
                  
                    </select></td>
                    <td><input class="filltertext" id="filltertext" type="text" size="15"  title="Search Booking" />
                    </td>
                </tr>
              </table>
            </fieldset></td>
            <td><fieldset class="" id="" >
              <legend>Status</legend>
              <table>
                <tr>
                  <td><select name="expst" id="expst" class="alter_status">
                    <option value="ALL" selected="selected">ALL</option>
                    <option value="PENDING">PENDING</option>
                    <option value="ERROR">ERROR</option>
                    <option value="SINGLE">SINGLE</option>
                    <option value="TALLY EXPORTED">TALLY EXPORTED</option>
                    </select></td>
                </tr>
              </table>
            </fieldset></td>
          <td >
	    <table>
              <tr>
                <td ><input class="search button" id="search" type="button"  value="Submit" /></td>
              </tr>
              <!--<tr>
			
                <td><input class="clearf" type="button"  value="CLEARFILTER" /></td>
				
              </tr>-->
			  
            </table>
		  </td>
			
			<td ><input name="New" type="button" class="button" id="New"  value="New" />
        </td>
			<td ><!--<form action="book_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"  title="Export as Excel" onClick="getCSVData()" />
</form>--><input type="button" value="Excel" id="ex_excel" class="ex_excel button"/></td>
		  
		  <td ><input type="button" name="ex_tally" class="ex_tally button" id="ex_tally" value="Tally" style="display:none" />	</td>
		  <td ><input name="tallyxml" class="tally ex_tally" type="checkbox" style="display:none"  id="tallyxml"  title="click to expoet xml file" /></td>
			<td  ><input type="button" name="ex_tally_xml" class="button" id="ex_tally_xml" value="Export"  style="display:none" /></td>
            <td><input  type="button" name="alter_status" id="alter_status" class="button alter_status"   value="ALT STATUS" style="width:100%; display:none"   />
            <input name="PrePrint" type="checkbox" id="PrePrint" value="" <?php if(isset($_SESSION['SESS_PREPRINT'])&&$_SESSION['SESS_PREPRINT']=='on') echo "checked='checked'";?>  style="display:none" />
             <input name="DSDetails" type="checkbox" id="DSDetails" value="" <?php if(isset($_SESSION['SESS_DSDET'])&&$_SESSION['SESS_DSDET']=='on') echo "checked='checked'";?>  style="display:none" />
              <input name="CmpLogo" type="checkbox" id="CmpLogo" value="1" <?php if(isset($_SESSION['SESS_SHOWLOGO'])&&$_SESSION['SESS_SHOWLOGO']=='on') ;?> style="display:none"  />
            
            </td>

        </tr>
      </table>
   
    <div id="demo" class="dataTableContainer">
    
    <form id="form_bookdetails" >
      
      </form>
    </div>
  </div>
</div>
<div id="message" class="messageBox" style=" text-align:right"></div>
 
</div>
<script language="javascript" type="text/javascript">

$("#city").autocomplete(
      "../city.php?",
      {
  			delay:10,
  			minChars:1,
  			matchSubset:1,
  			matchContains:1,
  			cacheLength:10,
			mustMatch:1,
  			autoFill:false
  		}
    );

$('#vouchertype').blur(function(){
	if($(this).val()=='PURCHASE'||$(this).val()=='PAYMENT')
	{
		 $(".spl_autofill").remove();
$("#billedto").autocomplete(
      "../billedto.php?mode=vendor",
      {
		  resultsClass :'spl_autofill',
  			delay:10,
  			minChars:1,
			mustMatch:0,
  			matchSubset:1,
  			matchContains:1,
  			cacheLength:10,
			sortResults :false,
	  }
    );
	}
	else if($(this).val()=='JOURNAL')
	{
		 $(".spl_autofill").remove();
$("#billedto").autocomplete(
      "../billedto.php?mode=all",
      {
		  resultsClass :'spl_autofill',
  			delay:10,
  			minChars:1,
			mustMatch:0,
  			matchSubset:1,
  			matchContains:1,
  			cacheLength:10,
			sortResults :false,
	  }
    );
	}
	else 	{
		 $(".spl_autofill").remove();
$("#billedto").autocomplete(
      "../billedto.php?",
      {
		  resultsClass :'spl_autofill',
  			delay:10,
  			minChars:1,
			mustMatch:0,
  			matchSubset:1,
  			matchContains:1,
  			cacheLength:10,
			sortResults :false,
	  }
    );
	}
});
  $(window).load(function() {
	 $.post("../data.php?mode=getcode",{},function(data){
		 var str=data.split('@@@');
	var cmp=str[0].split('#cmp#');
	var branch=str[1].split('#branch#');		 
	for(i=0;i<cmp.length-1;i++)
	$("#cmpsort").append('<option>'+cmp[i]+'</option>');
	for(i=0;i<branch.length-1;i++)
	$("#brasort").append('<option>'+branch[i]+'</option>');
	});
	 $('#vouchertype').trigger('blur');
  });
  
      
</script>
</body>
</html>