

<?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>My Orders</h4></div>
            <div class="p-2">              
            <!-- <a class="btn btn-primary" href=""><i class="fa fa-plus"></i> ADD New</a> -->
            </div>           
        </div>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="table table-hover">
                <thead>
                    <tr>
                    <?php $Slno=0; ?>
                        <th>Slno</th>
                        <th>Order No.</th>
                        <th>Job Status</th>
                        <th>Rack</th> 
                        <th>Godown</th>                   
                        <th colspan="">Actions</th>
                        <th></th>
                        <th></th>
                    </tr>
                </thead>
              
                <tbody>
                    <?php $__currentLoopData = $Orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $Order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td ><?php echo e(++$Slno); ?></td>
                        <td><?php echo e($Order->id); ?></td>
                        <td><?php echo e($Order->status->title); ?></td>
                        <?php if($Order->rack): ?>
                            <td><?php echo e($Order->rack->title); ?></td>
                        <?php else: ?>
                            <td>Not Selected</td>
                        <?php endif; ?>
                        <?php if($Order->rack): ?>
                            <td><?php echo e($Order->rack->godown->title); ?></td>
                        <?php else: ?>
                            <td>Not Selected</td>
                        <?php endif; ?>
                        <td>
                        <a href="<?php echo e(route('ProcessDetails.view',$Order->id)); ?>"><button type="button" class="btn btn-info">View <i class="far fa-eye"></i></button></a>
                        </td>
                        
                        <td>
                            <button type="submit" class="btn btn-success mx-2" data-toggle="modal" data-target=".bd-example-modal-lg" onclick="document.getElementById('IDOrder').value=<?php echo e($Order->id); ?>" >Billing</button>
                        </td>
                        
                                              
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
                
            </table>
        </div>
    </div>
    <div class="card-footer">
    
        <div class="d-flex justify-content-end font-weight-bold"><h5>Total: </h5></div>        
    </div>
</div>



<!-- Invoice Details Modal-->
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLongTitle">Order Billing</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
            </button>
        </div>
        <div class="modal-body">
            
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label for="txtName">Product/Service</label>
                        <input type="text" class="form-control" id="txtName" name="name">
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="form-group">
                        <label for="numAmount">Rate</label>
                        <input type="number" class="form-control" id="numAmount" name="amount">
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="form-group">
                        <label for="numQuantity">Quantity</label>
                        <input type="number" class="form-control" id="numQuantity" name="quantity">
                    </div>
                </div>
                <div class="col-sm-2">
                    <button type="button" class="btn btn-outline-success mt-4" onclick="bill()">Add <i class="fas fa-plus"></i></button>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th scope="col">Product/Service</th>
                            <th scope="col">Rate</th>
                            <th scope="col">Quantity</th>
                            <th scope="col">Total</th>
                        </tr>
                    </thead>
                    <tbody id="billing">
                        
                    </tbody>
                    <tbody>
                        <tr>
                            <td colspan="3"><b>Grand Total</b></td>
                            <td id="Gtotal"></td>
                        </tr>
                    </tbody>
                </table>
            </div>
            
        </div>
        <div class="modal-footer">
            <form method="post" action="<?php echo e(route('processComplete.complete')); ?>">
            <?php echo csrf_field(); ?>
            <input type="hidden" id="IDOrder" name="id">
                <div id="hiddenValues">

                </div>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary">Completed</button>
            </form>    
        </div>
    </div>
  </div>
<script>
    var GrandTotal=0;
    function bill() {
        var Name = document.getElementById('txtName').value;
        var Amount = document.getElementById('numAmount').value;
        var Quantity = document.getElementById('numQuantity').value;
        var Total = Amount*Quantity;
        GrandTotal+=Total;
        billing.innerHTML +='<tr><td>'+Name+'</td><td>'+Amount+'</td><td>'+Quantity+'</td><td>'+Total+'</td>';
        hiddenValues.innerHTML+='<input type="hidden" name="name[]" value="'+Name+'"> <input type="hidden" name="quantity[]" value="'+Quantity+'"> <input type="hidden" name="amount[]" value="'+Amount+'">';
        Gtotal.innerHTML='<b>'+GrandTotal+'</b>';
    }
</script>

</div>


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


<?php echo $__env->make('layouts.adminapp', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/exouzia1/public_html/tailor/resources/views/ProcessManager/index.blade.php ENDPATH**/ ?>