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

<!-- Start Content-->
<div class="container-fluid">
    
    <!-- start page title -->
    <!-- Include page breadcrumb -->
    <?php echo $__env->make('admin.inc.breadcrumb', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <!-- end page title --> 


    <div class="row">
        <div class="col-12">
            <a href="<?php echo e(route($route.'.index')); ?>" class="btn btn-info"><?php echo e(__('dashboard.back')); ?></a>
        </div>
    </div>

    <div class="row">
        <div class="col-12 col-lg-8">
            <div class="card">
                <div class="card-header">
                    <h4 class="header-title"><?php echo e($title); ?> #<?php echo e($row->id); ?></h4>
                </div>
                <div class="card-body">

                    <!-- Details View Start -->
                    <div class="table-responsive">
                    <table class="table table-striped table-hover">
                        <tr>
                            <td><?php echo e(__('dashboard.name')); ?></td>
                            <td>: <?php echo e($row->name); ?></td>
                        </tr>
                        <tr>
                            <td><?php echo e(__('dashboard.email')); ?></td>
                            <td>: <?php echo e($row->email); ?></td>
                        </tr>
                        <?php if(isset($row->phone)): ?>
                        <tr>
                            <td><?php echo e(__('dashboard.phone')); ?></td>
                            <td>: <?php echo e($row->phone); ?></td>
                        </tr>
                        <?php endif; ?>
                        <?php if(isset($row->company)): ?>
                        <tr>
                            <td><?php echo e(__('dashboard.company')); ?></td>
                            <td>: <?php echo e($row->company); ?></td>
                        </tr>
                        <?php endif; ?>
                        <tr>
                            <td><?php echo e(__('dashboard.address')); ?></td>
                            <td>: <?php echo e($row->address); ?></td>
                        </tr>
                        <tr>
                            <td><?php echo e(__('dashboard.city')); ?></td>
                            <td>: <?php echo e($row->city); ?></td>
                        </tr>
                        <?php if(is_file('uploads/quote/'.$row->file_path)): ?>
                        <tr>
                            <td><?php echo e(__('dashboard.quote_files')); ?></td>
                            <td>: <a href="<?php echo e(asset('uploads/quote/'.$row->file_path)); ?>" target="_blank" download><span class="btn btn-sm btn-primary"><?php echo e(__('dashboard.download')); ?></span></a></td>
                        </tr>
                        <?php endif; ?>
                    </table>
                    </div>

                    <hr/>
                    <p><span class="text-highlight"><?php echo e(__('dashboard.services')); ?>: </span></p>
                    <?php $__currentLoopData = $row->services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <span class="badge badge-primary badge-pill"><?php echo e($service->title); ?></span>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <hr/>

                    <?php if(isset($row->message)): ?>
                    <p><span class="text-highlight"><?php echo e(__('dashboard.note')); ?>: </span> <?php echo strip_tags($row->message, '<p><a><b><i><u><strong><br><ul><ol><li><del><ins><sup><sub><pre>'); ?></p>
                    <hr/>
                    <?php endif; ?>
                </div>
            </div>
        </div><!-- end col-->
        <div class="col-12 col-lg-4">
            <div class="card">
                <div class="card-header">
                    <h4 class="header-title"><?php echo e(__('dashboard.sidebar')); ?></h4>
                </div>
                <div class="card-body">
                    <p><span class="text-highlight"><?php echo e(__('dashboard.total_amount')); ?>: </span>
                        <?php if(isset($row->amount)): ?>
                        <?php echo e($row->amount); ?> <?php echo e(__('common.currency')); ?>

                        <?php else: ?>
                        <span class="badge badge-warning badge-pill"><?php echo e(__('dashboard.no_value')); ?></span>
                        <?php endif; ?>
                    </p>

                    <hr/>
                    <p><span class="text-highlight"><?php echo e(__('dashboard.status')); ?>:</span> 
                    <?php if( $row->status == 1 ): ?>
                    <span class="badge badge-primary badge-pill"><?php echo e(__('dashboard.pending')); ?></span>
                    <?php elseif( $row->status == 2 ): ?>
                    <span class="badge badge-info badge-pill"><?php echo e(__('dashboard.estimated')); ?></span>
                    <?php elseif( $row->status == 3 ): ?>
                    <span class="badge badge-success badge-pill"><?php echo e(__('dashboard.approved')); ?></span>
                    <?php elseif( $row->status == 0 ): ?>
                    <span class="badge badge-danger badge-pill"><?php echo e(__('dashboard.rejected')); ?></span>
                    <?php endif; ?>
                    </p>

                    <hr/>
                    <p><span class="text-highlight"><?php echo e(__('dashboard.prefer_contact')); ?> </span> 
                    <?php if( $row->prefer_contact == 1 ): ?>
                    <span><?php echo e(__('dashboard.phone')); ?>: <a href="tel:<?php echo e($row->phone); ?>" target="_blank"><?php echo e($row->phone); ?></a></span>
                    <?php elseif( $row->prefer_contact == 2 ): ?>
                    <span><?php echo e(__('dashboard.email')); ?>: <a href="mailto:<?php echo e($row->email); ?>" target="_blank"><?php echo e($row->email); ?></a></span>
                    <?php endif; ?>
                    </p>

                    <hr/>
                    <?php echo e(__('dashboard.send_mail')); ?> : <br/>

                    <?php
                        $template_estimated = \App\Models\EmailTemplate::template('quote-estimated');
                    ?>
                    <?php if(isset($template_estimated)): ?>
                    <a href="<?php echo e(route($route.'.invoice', ['id' => $row->id, 'action' => 'estimated'])); ?>" class="btn btn-info btn-sm mb-1">
                        <?php echo e(__('dashboard.estimate')); ?>

                    </a>
                    <?php endif; ?>

                    <?php
                        $template_approved = \App\Models\EmailTemplate::template('quote-approved');
                    ?>
                    <?php if(isset($template_approved)): ?>
                    <button type="button" class="btn btn-success btn-sm mb-1" data-toggle="modal" data-target="#approveModal-<?php echo e($row->id); ?>">
                        <?php echo e(__('dashboard.approve')); ?>

                    </button>
                    <!-- Include Approve modal -->
                    <?php echo $__env->make($view.'.approve', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <?php endif; ?>

                    <?php
                        $template_rejected = \App\Models\EmailTemplate::template('quote-rejected');
                    ?>
                    <?php if(isset($template_rejected)): ?>
                    <button type="button" class="btn btn-danger btn-sm mb-1" data-toggle="modal" data-target="#rejectModal-<?php echo e($row->id); ?>">
                        <?php echo e(__('dashboard.reject')); ?>

                    </button>
                    <!-- Include Reject modal -->
                    <?php echo $__env->make($view.'.reject', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <?php endif; ?>
                </div>
            </div>
        </div><!-- end col-->
    </div>
    <!-- end row-->

    <?php if($row->status != 0): ?>
    <div class="row">
        <div class="col-12 col-lg-12">
            <?php
                $template_invoice = \App\Models\EmailTemplate::template('invoice-send');
            ?>
            <?php if(isset($template_invoice)): ?>
            <a href="<?php echo e(route($route.'.invoice', ['id' => $row->id, 'action' => 'invoice'])); ?>" class="btn btn-primary btn-sm">
                <?php echo e(__('dashboard.create_invoice')); ?>

            </a>
            <?php endif; ?>
        </div>
    </div>
    <?php endif; ?>
    <div class="row">
        <div class="col-12 col-lg-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="header-title"><?php echo e(__('dashboard.invoice')); ?> <?php echo e(__('dashboard.list')); ?></h4>
                </div>
                <div class="card-body">
                    <!-- Data Table Start -->
                  <div class="table-responsive">
                    <table class="table table-striped table-hover nowrap">
                        <thead>
                            <tr>
                                <th><?php echo e(__('dashboard.sl')); ?></th>
                                <th><?php echo e(__('dashboard.invoice_no')); ?></th>
                                <th><?php echo e(__('dashboard.name')); ?></th>
                                <th><?php echo e(__('dashboard.email')); ?></th>
                                <th><?php echo e(__('dashboard.invoice_date')); ?></th>
                                <th><?php echo e(__('dashboard.invoice_type')); ?></th>
                                <th><?php echo e(__('dashboard.status')); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                          <?php $__currentLoopData = $row->invoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($key + 1); ?></td>
                                <td><a href="<?php echo e(route('admin.invoice.show', [$row->id])); ?>">#<?php echo e($row->id); ?></a></td>
                                <td><?php echo e($row->name); ?></td>
                                <td><?php echo e($row->email); ?></td>
                                <td><?php echo e(date('h:i:s A | d-M-y', strtotime($row->created_at))); ?></td>
                                <td>
                                    <?php if( $row->invoice_type == 0 ): ?>
                                        <?php echo e(__('dashboard.estimate')); ?>

                                    <?php elseif( $row->invoice_type == 1 ): ?>
                                        <?php echo e(__('dashboard.advance')); ?>

                                    <?php elseif( $row->invoice_type == 2 ): ?>
                                        <?php echo e(__('dashboard.interval')); ?>

                                    <?php elseif( $row->invoice_type == 3 ): ?>
                                        <?php echo e(__('dashboard.milestone')); ?>

                                    <?php elseif( $row->invoice_type == 4 ): ?>
                                        <?php echo e(__('dashboard.final')); ?>

                                    <?php elseif( $row->invoice_type == 5 ): ?>
                                        <?php echo e(__('dashboard.full')); ?>

                                    <?php endif; ?>
                                </td>
                                <td>
                                    <?php if( $row->status == 1 ): ?>
                                    <span class="badge badge-primary badge-pill"><?php echo e(__('dashboard.pending')); ?></span>
                                    <?php elseif( $row->status == 2 ): ?>
                                    <span class="badge badge-success badge-pill"><?php echo e(__('dashboard.paid')); ?></span>
                                    <?php elseif( $row->status == 0 ): ?>
                                    <span class="badge badge-danger badge-pill"><?php echo e(__('dashboard.canceled')); ?></span>
                                    <?php endif; ?>
                                </td>
                            </tr>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                  </div>
                  <!-- Data Table End -->
                </div>
            </div>
        </div><!-- end col-->
    </div>
    <!-- end row-->

    
</div> <!-- container -->
<!-- End Content-->

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp8\htdocs\multipurpose_business\resources\views/admin/get-quote/show.blade.php ENDPATH**/ ?>