<?php $__env->startSection('pagecss'); ?>
<link href="<?php echo e(URL::asset('')); ?>assets/vendors/custom/datatables/datatables.bundle.css" rel="stylesheet" type="text/css" />
<link href="<?php echo e(URL::asset('')); ?>assets/vendors/general/select2/dist/css/select2.css" rel="stylesheet" type="text/css" />
<link href="<?php echo e(URL::asset('')); ?>assets/css/demo3/style.bundle.css" rel="stylesheet" type="text/css" />
<link href="<?php echo e(URL::asset('')); ?>assets/vendors/general/toastr/build/toastr.css" rel="stylesheet" type="text/css" />
<link href="<?php echo e(URL::asset('')); ?>assets/vendors/general/sweetalert2/dist/sweetalert2.css" rel="stylesheet" type="text/css" />
<?php $__env->stopSection(); ?>

<?php $__env->startSection("content"); ?>
<div class="row">
  <div class="col-md-12">
    <div class="kt-portlet kt-portlet--mobile">
      <div class="kt-portlet__body">
        <form name="my_form" class="kt-form kt-form--label-right" >
          <div class="form-group row">
            <div class="col-lg-2">
              <div class="kt-portlet__head">
                <div class="kt-portlet__head-label">
                  <h3 class="kt-portlet__head-title">Filters</h3>
                </div>
              </div>
            </div>
            <div class=" col-lg-4">
              <label class="">Department</label>
              <select name="department" class="kt-select2 form-control" id="department_select" >
                <option value="0" <?php if(isset($_GET['department'])){  if($_GET['department']==0){ echo 'selected="selected"'; }}?> >All</option>
                <?php foreach($com_category as $cat): ?>
                <option value="<?php echo e($cat->id); ?>" <?php if(isset($_GET['department'])){  if($_GET['department']==$cat->id){ echo 'selected="selected"'; }}?> ><?php echo e($cat->name); ?></option>
                <?php endforeach; ?>  
              </select>
            </div>
            <div class="col-lg-4">
              <label>Period   </label>
              <select name="period" id="period_select" class="form-control">
                <option value="0"<?php if(isset($_GET['period'])){  if($_GET['period']==0){ echo 'selected="selected"'; }}?> >All</option>    
                <?php foreach($periods as $p): ?>
                <option value="<?php echo e($p->p_id); ?>" <?php if(isset($_GET['period'])){  if($_GET['period']==$p->p_id){ echo 'selected="selected"'; }}?> ><?php echo e($p->p_name); ?></option>
                <?php endforeach; ?>    
                </select>
            </div>
            <div class="col-lg-2">
              <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"><br>
              <input style="margin-top:5px;" class="btn btn-primary form-control" type="submit" name="submit" value="Submit"/>
            </div>
          </div>
        </form>
      </div>
       <div class="kt-portlet kt-portlet--mobile">
        <div class="kt-portlet__head kt-portlet__head--lg">
          <div class="kt-portlet__head-label">
            <span class="kt-portlet__head-icon">
              <i class="kt-font-brand flaticon2-line-chart"></i>
            </span>
            <h3 class="kt-portlet__head-title">
              Budget Reports
            </h3>
          </div>
        </div>
        <div class="kt-portlet__body">
          <table class="table table-striped- table-bordered table-hover table-checkable" id="budget-report-table" >
            <thead>
              <tr>
                  <th>Period Name</th>
                  <th>Department</th>
                  <th>Item</th>
                  <th>Quantity</th>
                  <th>Unit</th>
                  <th>Budget</th>
                  <th>Expense</th>
                  <th>Remaining budget</th>
                  
              </tr>
            </thead>
            <tbody>
              <?php if(count($budget_filter)>0): ?>
                  <?php foreach($budget_filter as $budgets): ?> <tr>
                    <td><?php echo e($budgets->p_nam); ?></td>
                    <td><?php echo e($budgets->cat); ?></td>
                    <td><?php echo e($budgets->it); ?></td>
                    <td class="dt-body-right"><?php echo e($budgets->qn); ?></td>
                    <td class="dt-body-right"><?php echo e(\App\Providers\Common::format_currency($budgets->un)); ?></td>
                    <td class="dt-body-right"><?php echo e(\App\Providers\Common::format_currency($budgets->bud)); ?></td>
                    <td class="dt-body-right"><?php echo e(\App\Providers\Common::format_currency($budgets->expense)); ?></td>
                    <td class="dt-body-right"><?php echo e(\App\Providers\Common::format_currency($budgets->remaining)); ?></td>
                </tr>
                  <?php endforeach; ?>
                  <?php endif; ?>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('pagejs'); ?>
<script src="<?php echo e(URL::asset('')); ?>assets/vendors/custom/datatables/datatables.bundle.js" type="text/javascript"></script>
<script src="<?php echo e(URL::asset('')); ?>assets/vendors/general/toastr/build/toastr.min.js" type="text/javascript"></script>
<script src="<?php echo e(URL::asset('')); ?>assets/vendors/general/sweetalert2/dist/sweetalert2.min.js" type="text/javascript"></script>
<script src="<?php echo e(URL::asset('')); ?>assets/vendors/custom/js/vendors/sweetalert2.init.js" type="text/javascript"></script>
<script src="<?php echo e(URL::asset('/')); ?>assets/vendors/general/select2/dist/js/select2.full.js" type="text/javascript"></script>
<script src="<?php echo e(URL::asset('assets/js/custom/budget-report.js')); ?>"></script>
<?php if(Session::has("message")): ?>
	<script>toastr.success("Successfully", "<?php echo e(Session::get("message")); ?>"); </script> 
<?php endif; ?>
<?php if(Session::has("error")): ?>
<script> toastr.error("Successfully", "<?php echo e(Session::get("error")); ?>"); </script>
<?php endif; ?>
<?php $__env->stopSection(); ?>
			




<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>