<?php include("includes/db_config.php"); ?>
<!DOCTYPE html>
<html lang="en" dir="ltr" data-theme="light">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <?php include("includes/css.php");?>
    <style>
        .modal-body .form-label{font-weight:600;}.mt-35{margin-top:35px!important}.viewptdt .form-label{font-weight:600;}.viewptdt label{margin-top:10px;}.portlet-titles{padding: 15px 20px;font-size: 20px;border-radius: 10px;}.portlet-titles-icon{font-size: 40px;text-align: center}.srchdt label{font-weight: 600;font-size: 14px;margin-top: 10px;}
    </style>
</head>

<body class="preload-active aside-active aside-mobile-minimized aside-desktop-maximized">
    <div class="holder">
        <?php include("includes/sidebar.php");?>
        <div class="wrapper">
            <?php include("includes/header.php");?>
            <div class="content">
                <div class="container-fluid g-5">                    
                    <div class="row">
                         <div class="col-12">
                            <div class="portlet">
                                <div class="portlet-header portlet-header-bordered">
                                    <div class="col-md-12">
                                        <h3 class="portlet-title">Day Book</h3>
                                    </div>
                                    
                                 </div>
                                <div class="row srchdt"> 
                                     <div class="col-md-2 col-12 col-xs-12" style="margin-left:15px;">
                                        <label><b>Date</b></label>
                                       <input type="date" class="form-control">
                                    </div> 
                                    <div class="col-md-2 col-12 col-xs-12"> 
                                       <input type="submit" class="btn btn-success btn-lg mt-35" value="Submit">
                                    </div>
                                  </div>
                                  <div class="portlet-body table-responsive">
                                    <table id="datatable-1" class="table table-bordered table-striped table-hover">
                                        <thead>
                                             <tr>
                                                <th>#</th>
                                                <th>Name</th>
                                                <th>Ref. No</th>
                                                <th>Type</th>
                                                <th>Total</th>
                                                <th>Money In</th>
                                                <th>Money Out</th>  
                                                <th> <center>Action</center></th>
                                            </tr>
                                        </thead>
                                        <tbody> 
                                            <tr>
                                                <td>1.</td>
                                                <td>Raj Kumar</td>
                                                <td></td>
                                                <td>Purchase</td>
                                                <td>₹ 10500</td>
                                                <td> </td> 
                                                <td>₹ 0.00</td> 
                                                <td>
                                                    <center>
                                                         <a href="#"><button class="btn btn-primary"> <i class="far fa-edit"></i></button></a>
                                                        <a href="javascript:delete_ptype_by_ID('<?php echo $res['id'] ?>');" class="btn btn-danger shadow btn-xs sharp"><i class="fa fa-trash"></i></a>
                                                        <a href="#"><button class="btn btn-warning"> <i class="fa fa-print"></i></button></a>
                                                    </center>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>2.</td>
                                                <td>Pankaj Kumar</td>
                                                <td></td>
                                                <td>Sale</td>
                                                <td>₹ 1200</td>
                                                <td>₹ 1000</td>
                                                <td> </td> 
                                                 <td>
                                                    <center>
                                                         <a href="#"><button class="btn btn-primary"> <i class="far fa-edit"></i></button></a>
                                                        <a href="javascript:delete_ptype_by_ID('<?php echo $res['id'] ?>');" class="btn btn-danger shadow btn-xs sharp"><i class="fa fa-trash"></i></a>
                                                        <a href="#"><button class="btn btn-warning"> <i class="fa fa-print"></i></button></a>
                                                    </center>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>3.</td>
                                                <td>Petrol</td>
                                                <td></td>
                                                <td>Expense</td>
                                                <td>₹ 200</td>
                                                <td> </td> 
                                                <td>₹ 200</td>   
                                                <td>
                                                    <center>
                                                         <a href="#"><button class="btn btn-primary"> <i class="far fa-edit"></i></button></a>
                                                        <a href="javascript:delete_ptype_by_ID('<?php echo $res['id'] ?>');" class="btn btn-danger shadow btn-xs sharp"><i class="fa fa-trash"></i></a>
                                                        <a href="#"><button class="btn btn-warning"> <i class="fa fa-print"></i></button></a>
                                                    </center>
                                                </td>
                                            </tr>
                                         </tbody>
                                        <tfoot>
                                        <tr>
                                            <th colspan="3"><b>Total Money-In: ₹ 1,000.00</b></th>
                                            <th colspan="3"><b>Total Money-Out: ₹ 200</b></th>
                                            <th colspan="2"><b>Total Money In - Total MoneyOut = ₹ 800.00</b></th>
                                            </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>       
            <?php include("includes/footer.php");?>
        </div>
    </div>
    <?php include("includes/js.php");?>
<script type="text/javascript">
      function delete_ptype_by_ID(id) {
        if (confirm('Do You Want to Deleting This \nContinue anyway?')) {
            window.location.href = 'delete_purchase.php?id=' + id;
        }
    }
    </script>
</body>
</html>