<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
if (isset($_POST["submit"])) {
    browse("$_POST[dtype]");
    $cond = "";
    $ccond = "";
    $cocond = "";
    $stcond = "";
    if (!empty($_POST["name"])) {
        $pname = trim($_POST["name"]);
        $cond = "AND `name` LIKE '%$pname%'";
    }
    $get = mysqli_query($conn, "SELECT * FROM `staff` WHERE `name`!='' $cond ORDER by `name`") or die(mysqli_error($conn));
    $getno = mysqli_num_rows($get);
    /* Normal Browser View Part */
    include("includes/files.php");
    ?>                       
    </head> 
    <body>
        <?php
        require("includes/dbconnect.php");
        $comp = mysqli_query($conn, "SELECT * FROM `company`") or die(mysqli_error($conn));
        $zcomp = mysqli_fetch_assoc($comp);
        echo "<font size='4px' ><b>$zcomp[compname]</font></b></font><br />";
        echo "<font size='2px' ><b> $zcomp[add1]. $zcomp[add2].  $zcomp[add3] </b></font><br /><br />";
        echo "<b><font >Bank Receipt List &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size='3px'>Date : " . date("M-d-Y") . "</b><br />";
        echo "<b>" . "Total  - $getno</b><br />";
        echo "<br />";        
        ?>        
        <table class="table table-bordered sortableTable responsive-table" width="100%">
            <thead>
                <tr>
                    <th style="text-align:left;" scope="col" width="6%"><b>Sr.</b></th>
                    <th style="text-align:left;" scope="col" width="10%"><b>Voucher No.</b></th>
                    <th style="text-align:left;" scope="col" width="10%"><b>Voucher Date</th>                                                        
                    <th style="text-align:left;" scope="col" width="15%"><b>Bank Name</th>
                    <th style="text-align:left;" scope="col" width="10%"><b>Receipt No.</th>
                    <th style="text-align:left;" scope="col" width="10%"><b>Cheque No.</b></th>
                    <th style="text-align:left;" scope="col" width="10%"><b>Cheque Date</b></th>
                    <th style="text-align:left;" scope="col" width="15%"><b>Drawee Bank</b></th>
                    <th style="text-align:left;" scope="col" width="15%"><b>Party Name</b></th>                                                        
                    <th style="text-align:left;" scope="col" width="10%"><b>Amount</b></th>                                                        
                    <th style="text-align:left;" scope="col" width="15%"><b>Narration</b></th>                                                                                                
                </tr>                
            </thead>                
            <tbody>                    
                <?php
                $ctr = 0;
                while ($city = mysqli_fetch_assoc($get)) {
                    $ctr++;
                    echo "<tr> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $ctr </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[vouchno] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[vouchdate] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[bankname] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[receiptno] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[chqno] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[chqdate] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[drawbank] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[party] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[amount] </span> \n </td> \n";
                    echo "<td style=\"text-align:left;\" width=\"6\" valign='top'> \n <span> $city[narration] </span> \n </td> \n";                    
                    echo "</tr>";
                }
                ?>
            </tbody>
            
        </table>
        <?php include("includes/files_footer.php"); ?>
        <script>
            $(function() {     metisTable();
                metisSortable();
            });
        </script>
    </body>
    </html>
<?php
}?>