<!DOCTYPE html>
<html lang="en">
<head>
    
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
    <title>Cash Book By Category</title>

    <style>


        
    @page {
       size: A4;
       margin: 0;
        }
        
        @media print {
            
          html, body{
            padding:15px;
            font-size:12px;
            line-height:1.0;
          }
          /* ... the rest of the rules ... */
        }
         
        #date_print{ 
        
            width:150px; !important;
        }
        .btn{ 
        
            width:120px; !important;
        }

    </style>
</head>
<body class="bg-light text-dark">
     
    <form method="get" class="pt-3">
        <input type="hidden" name="projectid" id="projectid" class="form-control "   value=<?php if(isset($_GET['projectid'])): ?><?php echo e($_GET['projectid']); ?><?php endif; ?>>
    <div class="container">
    <div class="row">
    <table>
        <tr>
        <td class="d-print-none"><span>Project Name:</span></td>  
        <td>
             <select class="form-control form-control-sm d-print-none" id="project_name" name="project_name" >
                 <option>Select Your Project</option>
             <?php $__currentLoopData = $projectdata; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
             <option data-id="<?php echo e($data->id); ?>" <?php if(isset($_GET['projectid'])): ?><?php echo e($data->id ==  $_GET['projectid']  ? 'selected' : ''); ?><?php endif; ?>
             value="<?php echo e($data->project_name); ?>"><?php echo e($data->project_name); ?></option>
             <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
             </select>
             
        </td>
        <td><span class="d-print-none">Start Date:</span></td>
        <td><input type="date" class="form-control form-control-sm d-print-none" id="date_print" value="<?php echo e($start_date ?? $newDateTime->format('Y-m-d')); ?>" name="start_date"></td>
        <td><span class="d-print-none">End Date:</span></td>
        <td><input type="date" class="form-control form-control-sm d-print-none" id="date_print" value="<?php echo e($end_date ?? now()->format('Y-m-d')); ?>" name="end_date"></td>
        <td><button type="submit" class="btn btn-info btn-sm d-print-none">Try Now</button></td>
        <td><a href="/home" class="btn btn-danger btn-sm d-print-none">Back Home</a></td>
        <td><button class="btn btn-sm btn-warning d-print-none"  onclick="myFunction()" >Print this page</button></td>
        </tr>
    </table>
    </div>
    </div>
    </form>
<hr class="d-print-none">

<div class="container">
    <div class="row">
        <div class="col-6">
            <table class="table">
    <thead>
        <tr>
            <th>Header Name</th>
            <th class="text-end">Debit Side</th>
        </tr>
    </thead>
    <tbody>
        <?php
            $grandTotal = 0;
        ?>
        <?php $__currentLoopData = $voucherdata; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $voucher): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td><?php echo e($voucher->header_name); ?></td>
                <td class="text-end"><?php echo e(number_format($voucher->total_amount_sum, 2)); ?></td>
                 <?php
                $grandTotal += $voucher->total_amount_sum;
            ?>
            </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
         <tr>
            <th class="text-end">Total</th>
            <th class="text-end"><?php echo e(number_format($grandTotal, 2)); ?></th>
        </tr>
    </tbody>
</table>
        </div>
        <div class="col-6">
            <table class="table">
    <thead>
        <tr>
            <th>Header Name</th>
            <th class="text-end">Credit Side</th>
        </tr>
    </thead>
    <tbody>
        <?php $__currentLoopData = $voucherdata2; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $voucher): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td><?php echo e($voucher->header_name); ?></td>
                <td class="text-end"><?php echo e(number_format($voucher->total_amount_sum, 2)); ?></td>
            </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </tbody>
</table>
        </div>
    </div>
</div>



      <!-- jQuery CDN - Slim version (=without AJAX) -->
      <script src="https://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script>
      <!-- Popper.JS -->
      <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
      <!-- Bootstrap JS -->
      <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
      <script>
         $('#project_name').change(function(){
         
           var selected = $(this).find('option:selected');    
            var projectid = selected.data('id');
            $('#projectid').val( projectid );
            
         });
             
        function myFunction() {
            
         document.getElementById("pname").innerHTML = $("#project_name").val();
         window.print();
         
         }
         
      </script>
</body>

</html><?php /**PATH /home/alameenb/public_html/resources/views/reports/cashbook_by_category.blade.php ENDPATH**/ ?>