<?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">CASH FLOW</h3>
                                    </div>
                                    
                                 </div>
                                <div class="row srchdt"> 
                                     <div class="col-md-2 col-12 col-xs-12" style="margin-left:15px;">
                                         <label><b>From</b></label>
                                       <input type="date" class="form-control">
                                    </div>
                                    <div class="col-md-2 col-12 col-xs-12">
                                        <label><b>To</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>Date</th>
                                                <th>Ref.No.</th>
                                                <th>Name</th>
                                                <th>Category</th>
                                                <th>Type</th>
                                                <th>Cash In</th>
                                                <th>Cash Out</th>
                                                <th>Running</th>
                                                 <th> <center>Action</center></th>
                                            </tr>
                                        </thead>
                                        <tbody> 
                                            <tr>
                                                <td>1.</td>
                                                <td>06-03-2025</td>
                                                <td>1</td>
                                                <td>Raj Kumar</td>
                                                <td> </td>
                                                <td>Purchase</td> 
                                                <td>₹ 1200.00</td>
                                                <td> </td>
                                                <td><font style="color:green">₹ 1200.00</font></td>
                                                 <td>
                                                        <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>
                                                </td>
                                            </tr> 
                                            <tr>
                                                <td>2.</td>
                                                <td>06-03-2025</td>
                                                <td></td>
                                                <td></td>
                                                <td>Petrol</td>
                                                <td>Expences</td>
                                                <td></td>
                                                <td>₹ 200.00</td>
                                                <td><font style="color:green">₹ 200.00</font></td>
                                                 <td> 
                                                        <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>
                                                </td>
                                            </tr> 
                                            
                                            <tr>
                                                <td>3.</td>
                                                <td>06-03-2025</td>
                                                <td></td>
                                                <td></td>
                                                <td>Shop Rent</td>
                                                <td>Expences</td>
                                                <td></td>
                                                <td>₹ 5000.00</td>
                                                <td><font style="color:green">₹ 200.00</font></td>
                                                 <td>
                                                        <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>
                                                </td>
                                            </tr>
                                         </tbody>
                                        <tfoot>
                                        <tr>
                                            <th colspan="3"><b>Total Cash-In: ₹ 1,000.00</b></th>
                                            <th colspan="3"><b>Total Cash-Out: ₹ 5200.00</b></th>
                                            <th colspan="2"><b>Closing Cash In  Hand : ₹ 4200.00</b></th>
                                            </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>       
            <div class="modal fade" id="static" data-bs-backdrop="static"> 
                <div class="modal-dialog dialog-lg">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title">Invoice: -Raj Kumar</h5><button type="button" class="btn btn-label-danger btn-icon" data-bs-dismiss="modal"><i class="fa fa-times"></i></button>
                        </div>
                        <form class="g-3" action="" method="post">
                            <div class="row modal-body">
                                <table id="datatable-1" class="table table-bordered table-striped table-hover">
                                        <thead><tr><th colspan="2">Cost Calculations</th></tr> </thead>
                                        <tbody> 
                                           <tr>
                                                <td>Sale Amount</td>
                                                <td>₹ 1200.00</td> 
                                            </tr>
                                            <tr>
                                                <td>Total Cost</td>
                                                <td>₹ 0.00</td> 
                                            </tr> 
                                            <tr>
                                                <td>Tax Payable</td>
                                                <td>₹ 0.00</td> 
                                            </tr> 
                                            <tr>
                                                <td>TDS Receiable</td>
                                                <td>₹ 0.00</td> 
                                            </tr> 
                                            <tr>
                                                <td>Profit (Sale Amount - Total Cost - Tax Payable -  TDS Receiable)</td>
                                                <td>₹ 1200.00</td> 
                                            </tr>
                                            <tr>
                                                <td>Profit (Excluding Additional Charges)</td>
                                                <td>₹ 1200.00</td> 
                                            </tr> 
                                         </tbody>
                                </table>
                            </div> 
                        </form>
                    </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>