
<?php $__env->startSection('content'); ?>



<div class="card mb-4">
    <div class="card-header">
        <div class="d-flex">
            <div class="mr-auto p-2 align-self-center"><h4>Reports</h4></div>
        </div>    
        <form method="POST" action="<?php echo e(route('PmSearchResults')); ?>">
        <?php echo csrf_field(); ?>
        <?php echo method_field('post'); ?>
        <div class="border-top pt-3">
            <div class="row">
                <div class="col-lg-4 col-sm-4">
                    <div class="form-group w-30">
                        <select id="selectgrp" class="form-control <?php $__errorArgs = ['status_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>  <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="cbStatus" name="status_id">
                            <?php
                                echo App\Http\Controllers\StatusController::StatusListForCombo(0);
                            ?>
                        </select> 
                    </div>
                </div>

                <div class="col-lg-4 col-sm-4">             
                    <div class="form-group w-30">
                        <select id="selectgrp" class="form-control <?php $__errorArgs = ['datesort'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>  <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="cbDateSort" name="datesort" onchange="dmy_onchange(this.value)" >
                            <option value="" disabled selected>Sort by Day</option>
                            <option value="day">Day</option>
                            <option value="month">Month</option>
                            <option value="year">Year</option>
                            <option value="2">Between Two Dates</option>
                        </select> 
                    </div>
                </div> 

                <div class="col-lg-4 form-group" id="divdmy" style="display:none;">
                    <label for="txtSDate" id="lbltxtDate">Date</label>
                    <input class="form-control" type="date" name="txtSDate" id="txtSDate" oninput="view()" placeholder="dsate" />
                    <label for="txtSDate1" id="lbltxtSDate2" style="display:none;">Date2</label>
                    <input class="form-control" type="date" style="display: none;" name="txtSDate1" id="txtSDate1" oninput="view()" placeholder="dsate" />
                    <label id="lblnmbYear" for="nmbYear" style="display: none;">Year</label>
                    <input type="number" name="nmbYear" oninput="view()" id="nmbYear" value="2020" class="form-control" min="1900" max="3000" style="display: none;"/>
                </div>          
            </div>
        </div>
        <div class="d-flex justify-content-end font-weight-bold">
            <button type="submit" class="btn btn-primary"><i class="fas fa-search"></i> Search</button>
        </div>
        </form>
    </div>
    <div class="card-body">
        <div class="table-responsive" >
            <table class="table table-hover" id="search_tbl">
                <thead>
                    <tr>
                        <th>SLNO.</th>
                        <th>Order No.</th>
                        <th>Customer</th>
                        <th>Status</th>
                        <th>Duration</th>                    
                        <th colspan="">Actions</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php $si=0; ?>
                    <?php $__currentLoopData = $Results; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $Result): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e(++$si); ?></td>
                        <td><?php echo e($Result->id); ?></td>
                        <td><?php echo e($Result->user->name); ?></td>
                        <td><?php echo e($Result->status->title); ?></td>
                        <td><?php echo e($Result->duration->title); ?></td>
                        <td style="width: 150px;"><a href="<?php echo e(route('DmDetailsView',$Result->id)); ?>" class="btn btn-info"><i class="fa fa-edit"></i> View</a></td>   
                                             
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="card-footer">
        <div class="row">
            <div class="col-lg-6">
                <div class="d-flex justify-content-start font-weight-bold">
                <a href=""><button class="btn btn-danger">Save Pdf</button></a>     
                </div>
            </div> 
            <div class="col-lg-6">
                <div class="d-flex justify-content-end font-weight-bold">
                    <a href=""><button class="btn btn-primary">Print</button></a>    
                </div>
            </div>
        </div>            
    </div>
</div>

<?php $__env->stopSection(); ?>

<script>

function clicks() {

var items = document.getElementById("selectgrp").value;    

$.ajax({
  url: '<?php echo e(route('selectReports')); ?>',
  method: "get",
  data: {_token: '<?php echo e(csrf_token()); ?>',searchitems:items },
                          success: function (response){   

                            document.getElementById('search_tbl').innerHTML=response; 
                          
                                  }
                  });  

}




function dmy_onchange(dmy)
{
    //reset
    $('#divdmy').attr('style','display:block;');
    
    $('#lbltxtDate').attr('style','display:none;');
    $('#txtSDate').attr('style','display:none;');
    document.getElementById('lbltxtDate').innerHTML="Date";
    $('#txtSDate').attr('type','date');
    $('#lbltxtSDate2').attr('style','display:none;');    
    $('#txtSDate1').attr('style','display:none;');
    $('#lblnmbYear').attr('style','display:none;');
    $('#nmbYear').attr('style','display:none;');
    switch(dmy)
    {
        case '0':
             $('#divdmy').attr('style','display:none;');
            break;
        case 'day':
            $('#lbltxtDate').attr('style','display:block;');
            $('#txtSDate').attr('style','display:block;');
            break;
        case '2':
            $('#lbltxtDate').attr('style','display:block;');
            $('#txtSDate').attr('style','display:block;');
            $('#lbltxtSDate2').attr('style','display:block;');
            document.getElementById('lbltxtDate').innerHTML="From";
            document.getElementById('lbltxtSDate2').innerHTML="To";
            $('#txtSDate1').attr('style','display:block;');
            break;
        case 'month':
            $('#lbltxtDate').attr('style','display:block;');
            $('#txtSDate').attr('style','display:block;');
            document.getElementById('lbltxtDate').innerHTML="Month";
            $('#txtSDate').attr('type','month');
            break;
        case 'year':
            $('#lblnmbYear').attr('style','display:block;');
            $('#nmbYear').attr('style','display:block;');
            break;
    }
}


</script>


<?php echo $__env->make('layouts.pmapp', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\washclub\resources\views/PmReport/index.blade.php ENDPATH**/ ?>