<?php
session_start();
include './connection_sql.php';
if ($_SESSION["CURRENT_USER"] == "") { 
    exit('Please Logging Again..');
} 
if ($_SESSION['company'] == "") { 
    exit('Please Logging Again..');
} 
?>
 
<section class="content">
    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">LEDGER</h3>
            <h4 style="float: right;height: 3px;"><b id="time"></b></h4>
        </div>
        <form role="form" name ="form1" class="form-horizontal" target="_blank" action="ledger_print.php">
            <div class="box-body">
                <div class="form-group col-md-12">
                    <a onclick="location.reload();" class="btn btn-default">
                        <span class="fa fa-user-plus"></span> &nbsp; NEW
                    </a>   
                    <button><a onclick="print_inv();" class="btn btn-primary btn-sm">
                        <span class="fa fa-print"></span> &nbsp; VIEW REPORT
                    </a></button>
                    
                   
                </div>
                <div class="form-group"></div>
                <input type="hidden" id="uniq" class="form-control">

                <div id="msg_box"  class="span12 text-center"  >  </div>

                <!--=======================-->
                <div class="form-group">
                    <label class="col-md-1 control-label  " for="txt_usernm" style="text-align:left">Date From</label>
                    <div class="col-md-3">
                        <input   id="dtfrom" name="dtfrom" value="<?php echo date('Y-m-d'); ?>" class="form-control input-sm" type="date">
                    </div> 
                    <label class="col-md-1 control-label  " for="txt_usernm" style="text-align:left">Date To</label>
                    <div class="col-md-3">
                        <input  id="dtto"  name="dtto"  value="<?php echo date('Y-m-d'); ?>" class="form-control input-sm" type="date">
                    </div> 
                </div>   
                
                <div class="form-group">
                    <label class="col-md-1 control-label  " for="txt_usernm" style="text-align:left"> Company</label>
                    <div class="col-md-3">
                        <select id="company" name="company"  class="form-control input-sm"  > 
                            <option value="ALL">ALL</option>
                            <?php   
                             $sql = "select * from invpara";
                             foreach ($conn->query($sql) as $row) {
                                echo "<option value='" . $row["flag"] . "' class=\"opt\">" . $row["flag"] . "-" . $row["COMPANY"] . "</option>";
                            }
                            ?>  
                       </select>
                    </div> 
               
                </div>   
                <div class="form-group">
                    <label class="col-md-1 control-label  " for="txt_usernm" style="text-align:left">Type</label>
                    <div class="col-md-3">
                        <select id="type" name="type"  class="form-control input-sm"  > 
                            <option value="Sales">Sales</option>
                            <option value="CRN/PAY/GRN/DGRN">CRN/PAY/GRN/DGRN</option>
                            <option value="Purchase">Purchase</option>
                            <option value="Purchase Return">Purchase Return</option> 
                            <option value="Payment">Payment</option> 
                       </select>
                    </div> 
                </div>   
                
                 <!--==================================================================================================================================== -->
                  
            </div> </div> 
        </form>
    </div> 
</section> 

<script>
    

</script>

 
  