<?php
session_start();
if(!isset($_SESSION['LOGIN_STATUS']))
{
header('location:../index.php');
}
require "../model/configuration.php";
$gtot=0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title><?php echo $_SESSION['title'];?></title>
    <link rel='stylesheet' type='text/css' href='../css/fonts.googleapis.com/css_cd14c140.css' />
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" type="text/css" href="../vendor/bootstrap/css/bootstrap.min.css" />
    <!-- Theme CSS -->
    <link rel="stylesheet" type="text/css" href="../css/vendor.css" />
    <link rel="stylesheet" type="text/css" href="../css/theme.css" />
    <link rel="stylesheet" type="text/css" href="../css/utility.css" />
    <link rel="stylesheet" type="text/css" href="../css/custom.css" />
  </head>
  <body class="dashboard-page">
    <script> var boxtest = localStorage.getItem('boxed'); if (boxtest === 'true') {document.body.className+=' boxed-layout';} </script>
    <!-- Start: Theme Preview Pane -->
    <!-- Start: Header -->
    <header class="navbar navbar-fixed-top">
      
      <?php include_once("../include/top_menu.php");?>
    </header>
    <!-- Start: Main -->
    <div id="main">
      
      <!-- Start: Sidebar -->
      <?php include_once("../include/left_menu.php");?>
      <!-- Start: Content -->
      <section id="content_wrapper">
        <div id="topbar">
          <div class="topbar-left">
            <ol class="breadcrumb">
              <li class="crumb-icon"><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
              <li class="crumb-link"><a href="#">Bank</a></li>
              <li class="crumb-trail">Transaction Report</li>
            </ol>
          </div>
          
        </div>
        
        
        <div id="content">
          <div class="row">
            <div class="col-md-1">
              
            </div>
            
            <div class="col-md-12">
              <div class="panel panel-visible">
                <div class="panel-heading">
                  <div class="panel-title "> <span class="glyphicon glyphicon-tasks"></span> Transaction Report</div>
                </div><br>
                
                <div class="form-group">
                <form action="" method="POST">
                <div class="col-md-3">
                 
                  <select class="selectpicker form-control" data-live-search="true" name="bank" id="bank" tabindex="6">
                      
<option value="">--Select Bank--</option>
 <?php
    
        $bank=$db->execute("select * from bank where delet='0'");
    while($bank_res=$bank->fetch_assoc())
      {
        
    ?>
        <option value="<?php echo $bank_res['bankname'];?>"><?php echo $bank_res['bankname'];?></option>
        <?php
      }
    ?>
   
      </select>
                  </div>
                
                  <div class="col-md-3">
                  <label for="datepicker" class="col-lg-1 control-label" style="width:20%">From Date</label>
                  <input type="text" id="datepicker" name="frmdate" class="form-control datepicker mtn" value="<?php echo date("d-m-Y");?>" placeholder="23/9/2013" required="" style="width:80%" />
                  </div>
                  <div class="col-md-3">
                  <label for="datepicker" class="col-lg-1 control-label" style="width:20%">To Date</label>
                  <input type="text" id="datepicker" name="todate" class="form-control datepicker mtn" value="<?php echo date("d-m-Y");?>" placeholder="23/9/2013" required="" style="width:80%" />
                  </div>
                  <div class="col-md-2">
                    <input type="submit" value="Search" name="dat" class="bttn">
                  </div>
                  </form>
                </div>
                 <br>
                
               
                <div class="panel-body pbn" id="divToPrint">
                  <table class="table table-striped table-bordered table-hover"  >
                    <thead>
                    <tr>
                    <th colspan="7">
                    Bank: <?php echo $_POST['bank'];  ?>
                    </th></tr>
                      <tr>
                        <th>#</th>
                        <th>Date</th>
                        <th>Customer</th>
                        <th>Type</th>
                        <th>Cheque No/Voucher</th>
                        <th class="text-center">Amount</th>
                        <th>Discription</th>
                      </tr>
                    </thead>
                    <tbody>
                      <?php
                      $gtot=0;
                      $c=0;
                      if(isset($_POST['dat'])){
                        $frmdte = date('Y-m-d', strtotime($_POST['frmdate']));
                        $todte = date('Y-m-d', strtotime($_POST['todate']));
                      $query=$db->execute("select * from cheque where date BETWEEN '$frmdte' and '$todte' and delet='0'");
                      while($result=$query->fetch_assoc())
                      {
                      $c++;
                      ?>
                      <tr>
                        <td><?php echo $c;?></td>
                        <td ><?php echo date('d-m-Y', strtotime($result['date']));?></td>
                        <td ><?php echo $result['customer'];?></td>
                        <td ><?php echo $result['type'];?></td>	
                           <td ><?php echo $result['cheque_no'];?></td>
                        <td ><?php echo $result['amount'];?></td>
                        <td ><?php echo $result['discri'];?></td>
                      
                      </tr>
                      <?php
                     // $gtot=$gtot+$result['amount'];

                    }}
                    ?>
                    </tbody>
                    
                  </table>
                  
                   
                </div>
                
                
                <div class="col-md-12 col-sm-12 col-xs-12">
                      
                        <input type="submit" class="btn btn-success" onclick="PrintDiv();" name="sub" value="Print">
                      </div>
              </div>
              
            </div>
          </div>
          
          
          
          
          
          
          
          
          
          
          <?php //include_once("dashboard_content.php");?>
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
        </div>
        
        
      </section>
      
      <!-- Start: Right Sidebar -->
      
    </div>
      <script type="text/javascript">

                                                                function PrintDiv() {

                                                                    var divToPrint = document.getElementById('divToPrint');
                                                                    var popupWin = window.open('', '_blank', 'width=595,height=842');
                                                                    popupWin.document.open();
                                                                    popupWin.document.write('<html><link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
                                                                    popupWin.document.close();
                                                                }
        </script>
    <!-- End #Main -->
    <!-- jQuery -->
    <script type="text/javascript" src="../vendor/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../vendor/jquery/jquery_ui/jquery-ui.min.js"></script> <!-- Bootstrap -->
    <script type="text/javascript" src="../vendor/bootstrap/js/bootstrap.min.js"></script>
    <!-- Page Plugins -->
    <script type="text/javascript" src="../vendor/plugins/validate/jquery.validate.js"></script>
    <script type="text/javascript" src="../vendor/plugins/morris/morris.js"></script>
    <script type="text/javascript" src="../vendor/plugins/datatables/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="../vendor/plugins/datatables/js/datatables.js"></script>
    <script type="text/javascript" src="../vendor/plugins/jvectormap/jquery-jvectormap.min.js"></script>
    <script type="text/javascript" src="../vendor/plugins/datepicker/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="../vendor/plugins/jquerymask/jquery.maskedinput.min.js"></script>
    <script type="text/javascript" src="../vendor/editors/xeditable/js/bootstrap-editable.js"></script>
    <!-- Flot Plugins -->
    <script type="text/javascript" src="../vendor/plugins/jqueryflot/jquery.flot.min.js"></script>
    <!-- Theme Javascript -->
    <script type="text/javascript" src="../js/utility/spin.min.js"></script>
    <script type="text/javascript" src="../js/utility/underscore-min.js"></script>
    <script type="text/javascript" src="../js/main.js"></script>
    <script type="text/javascript" src="../js/ajax.js"></script>
    <script type="text/javascript" src="../js/custom.js"></script>
    <script type="text/javascript">
    jQuery(document).ready(function () {
      
      "use strict";
      // Init Theme Core
    Core.init();
      // Enable Ajax Loading
    Ajax.init();
    
      
        
      // validate the comment form when it is submitted
      $("#altForm").validate();
      //Init jquery Date Picker
      $('.datepicker').datepicker()
      
      
        // Init Datatables with Tabletools Addon
    $('#datatable').dataTable( {
      "aoColumnDefs": [{ 'bSortable': false, 'aTargets': [ -1 ] }],
      "oLanguage": { "oPaginate": {"sPrevious": "", "sNext": ""} },
      "iDisplayLength": 5,
      "aLengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "All"]],
      "sDom": 'T<"panel-menu dt-panelmenu"lfr><"clearfix">tip',
      "oTableTools": {
        "sSwfPath": "./vendor/plugins/datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
      }
      });
    
    // Add Placeholder text to datatables filter bar
    $('.dataTables_filter input').attr("placeholder", "Enter Filter Terms Here....");
    
    // Manually Init Chosen on Datatables Filters
      $("select[name='datatable_length']").chosen();
    
    // Init Xeditable Plugin
    $.fn.editable.defaults.mode = 'popup';
    $('.xedit').editable();
      
      
    });
    </script>
  </body>
</html>