<link rel="stylesheet" src="<?php echo e(URL::to('assets/calender/theme.css')); ?>">
<link rel="stylesheet" src="<?php echo e(URL::to('assets/calender/style.css')); ?>">


<style>
    .orderLists.newDesg .imgBoxs {
        height: 170px;
        object-fit: cover;
        width: 120px;
    }

    p.msg-sts {
        padding: 6px 10px !important;
    }

    button.submit-popup.create,
    button.submit-popup.createinpack.mt-3 {
        margin-top: 50px !important;
    }

    .main-popup-contents .rs-flex {
        width: 100%;
    }

    .main-popup-contents p {
        margin-bottom: 30px;
        font-weight: 600;
        font-size: 20px;
    }

    input#datepickerinproduction,
    #datepickerinpackage,
    #datepicker {
        border-radius: 30px;
    }

    /*  calender css start*/
    .buttons-container {
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
    }

    .buttons-container .label-container {
        display: inline-block;
        -webkit-box-flex: 1;
        -moz-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
        text-align: center;
        text-transform: uppercase;
        font-weight: bold;
    }

    .year-dropdown {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border: none;
        font-size: inherit;
        font-weight: inherit;
        font-family: inherit;
        padding: 5px 20px;
    }

    .prev-button,
    .next-button {
        background: transparent;
        border: none;
        padding: 10px;
    }

    .week {
        margin: 10px 0;
    }

    .week.highlight {
        border-radius: 5px;
    }

    .weeks-wrapper.header {
        border-bottom: 1px solid #eee;
    }

    .week .day.header {
        font-weight: bold;
        text-transform: uppercase;
        font-size: 120%;
    }

    .day span {
        display: inline-block;
        width: 40px;
        height: 40px;
        line-height: 40px;
        border-radius: 50%;
        vertical-align: middle;
    }

    .day.today span {
        position: relative;
        display: inline-block;
        font-size: 110%;
    }

    /* weekend */
    .week:not(.start-on-monday) .day:first-child,
    .week:not(.start-on-monday) .day:last-child {
        color: orange;
    }

    /* sunday */
    .week:not(.start-on-monday) .day:first-child {
        color: red;
    }

    /* start on monday - weekend */
    .week.start-on-monday .day:nth-child(6),
    .week.start-on-monday .day:last-child {
        color: orange;
    }

    /* start on monday - sunday */
    .week.start-on-monday .day:last-child {
        color: red;
    }

    .day.today span::after {
        content: "";
        position: absolute;
        bottom: 7px;
        left: 50%;
        transform: translateX(-50%);
        border-bottom: 2px solid orange;
        width: 10px;
        height: 1px;
    }

    .day.sunday span {
        color: #ff8a80;
    }

    .week .day.highlight span {
        color: #2196f3;
    }

    .week .day.selected span {
        background: #1565c0;
        color: white;
    }

    .week .day[disabled="disabled"] span {
        color: #aaa;
        cursor: not-allowed;
    }

    .months-wrapper .month span {
        display: inline-block;
        padding: 10px;
        text-transform: capitalize;
        margin-bottom: 10px;
    }

    .special-buttons {
        text-align: center;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }

    .today-button {
        margin: 0 auto;
        background: transparent;
        border: none;
        padding: 5px;
    }

    .calendar-box {}

    .buttons-container {
        cursor: pointer;
    }

    .week {
        overflow: hidden;
    }

    .week.highlight {
        background: #efefef;
    }

    /* weekend */
    .week .day:first-child,
    .week .day:last-child {
        /*color: orange;*/
    }

    /* sunday */
    .week .day:first-child {
        /*color: red;*/
    }

    .day {
        display: inline-block;
        float: left;
        width: 14.28%;
        text-align: center;
        cursor: pointer;
        box-sizing: border-box;
    }

    .day.disabled span {
        color: #AAA;
    }

    /* vertical highlight */
    .week .day.highlight span {
        /*color: blue;*/
    }

    .day.selected span {
        /*background: orange;*/
    }

    .day.today span {
        font-weight: bold;
    }

    .months-container.hidden,
    .weeks-container.hidden {
        display: none;
    }

    .months-wrapper {
        overflow: hidden;
    }

    .months-wrapper .month {
        display: inline-block;
        float: left;
        width: 25%;
        text-align: center;
        cursor: pointer;
    }

    .months-wrapper .month.one-third {
        width: 33.33%;
    }

    /*   calender css end */
</style>


<?php $__env->startSection('content'); ?>
    <div class="common-content">
        <div class="page-content">
            <div class="page-heading">
                <div class="headings">
                    <h6>COMPLAINT STATUS</h6>
                    <input name="_token" type="hidden" id="token_buyer" value="<?php echo e(csrf_token()); ?>">
                    <input name="complaint_relation" type="hidden" id="complaint_relation" value="po">
                </div>
            </div>

            <div class="dashboard-cnts">

                <div class="boxings card">
                    <div class="card-header">
                        <h6 class=" card-link" data-toggle="collapse" href="#collapseFour">COMPLAINT STATUS</h6>
                    </div>
                    <div class="bxNew collapse show" id="collapseFour"data-parent="#accordion">
                        <div class="row manufacturerlist">
                            <div class="col-12">
                            </div>

                            <?php $__currentLoopData = $complaint_status; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $complaint_status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-12 compalintBox"
                                    id="complaint_<?php echo e($complaint_status->serviceid); ?>">
                                    <div class="card3 card card-statistic-1 wraper audio-g" style="display: block;">
                                        <div class="card-icon">
                                            <?php if(!empty($complaint_status->pro_pic)): ?>
                                                <img class="img-fluid complaint-image"
                                                    src="<?php echo e(url('user_files')); ?>/<?php echo e($complaint_status->pro_pic); ?>">
                                            <?php else: ?>
                                                <img class="img-fluid complaint-image"
                                                    src="<?php echo e(url('assets/images/1200px-No-Image-Placeholder.svg.png')); ?>">
                                            <?php endif; ?>
                                        </div>
                                        <div class="card-wrap card-itms">
                                            <div class="dealer-details">
                                                <h3 class="company-name company-name-rs">
                                                    <?php echo e(ucfirst($complaint_status->name)); ?></h3>
                                                <ul style="margin-bottom: 10px;min-height: auto;">


                                                    <?php
                                                    $current_date = date('d-m-Y');
                                                    $product_warranty = $complaint_status->warrentysold;
                                                    ?>


                                                    <?php if($complaint_status->type == 'approve'): ?>
                                                        <?php
                                                            $pname = App\Helpers\CustomHelper::product_name($complaint_status->productid);
                                                        ?>
                                                        <?php
                                                            $pdetails = App\Helpers\CustomHelper::vendorproduct_details($complaint_status->productid);
                                                            $modelno = $pdetails->product_code;
                                                        ?>

                                                        <?php
                                                            $prdid = $complaint_status->productid;
                                                        ?>
                                                    <?php else: ?>
                                                        <?php
                                                            $pname = App\Helpers\CustomHelper::product_existing_name($complaint_status->existing_product_id);
                                                        ?>
                                                        <?php
                                                            $modelno = $complaint_status->product_code_existing;
                                                        ?>
                                                        <?php
                                                            $prdid = $complaint_status->existing_product_id;
                                                        ?>
                                                    <?php endif; ?>

                                                    <li>
                                                        <label>Model No</label>:<span><?php echo e($modelno); ?></span>
                                                    </li>
                                                    <li>
                                                        <label>Product Name</label>:<span><?php echo e(ucfirst($pname)); ?></span>
                                                    </li>
                                                    <?php if($complaint_status->product_serial_no!=''): ?>
                                                    <li>
                                                        <label>Serial No</label>:
                                                        <span><?php echo e($complaint_status->product_serial_no); ?></span>
                                                    </li>
                                                    <?php endif; ?>
                                                    <?php if($complaint_status->invoice_number != null): ?>
                                                        <li>
                                                            <label>Invoice No</label>:
                                                            <span><?php echo e($complaint_status->invoice_number); ?></span>
                                                        </li>
                                                    <?php endif; ?>
                                                    <?php if($complaint_status->complaint_type!='inspection_request'): ?>
                                                    <li><label>Department name</label>:
                                                        <span><?php echo e(ucfirst($complaint_status->departmentname)); ?></span></li>
                                                    <?php endif; ?>

                                                    <?php if($complaint_status->barcode != null): ?>
                                                        <li>
                                                            <label>Barcode</label>:
                                                            <span><?php echo e($complaint_status->barcode); ?></span>
                                                        </li>
                                                    <?php endif; ?>
                                                    <li><label>Posted date</label>:
                                                        <span><?php echo e(date('d-m-Y', strtotime($complaint_status->date))); ?></span>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div><!-- card-wrap-end-->


                                        <ul class="complaint_details">
                                            <li><label>Complaint Id</label>:
                                                <span><?php echo e(ucfirst($complaint_status->id)); ?></span></li>
                                            <li><label>Complaint</label>:
                                                <span><?php echo e(ucfirst($complaint_status->complaint)); ?></span>

                                                <?php if($complaint_status->text_type == 'voice'): ?>
                                                    <audio controls>
                                                        <source
                                                            src="https://www.meddbot.com/uploads/voice/<?php echo e($complaint_status->complaint); ?>"
                                                            type="audio/mpeg">
                                                        Audio tag is not supported in this browser.
                                                    </audio>
                                                <?php endif; ?>


                                            </li>
                                            <?php if($complaint_status->charge != ''): ?>
                                                <li><label>Charges</label>:
                                                    <span><?php echo e($complaint_status->charge + $complaint_status->charge * ($complaint_status->tax / 100)); ?>

                                                        INR ( Tax <?php echo e($complaint_status->tax); ?> %)</span>

                                                <li style="display: flex;"> <label>Quotationsss</label>: <span><a target="_blank" class="eye"
                                                            href="<?php echo e(url('uploads/document/' . $complaint_status->charge_doc)); ?>"><?php echo e($complaint_status->charge_doc); ?><i
                                                                class="fa fa-file" aria-hidden="true"></i> View</a></span>
                                                </li>
                                            <?php endif; ?>

                                            <!-- AMC RENEW start-->

                                            <?php if($complaint_status->complaint_type == 'amc_cmc_rene' ||
                                                $complaint_status->complaint_type == 'validation_date' ||
                                                $complaint_status->complaint_type == 'amc_cmc_activation'): ?>
                                                <li><label>Status</label>: <span
                                                        id="complaintstatus_<?php echo e($complaint_status->serviceid); ?>">

                                                        <?php if($complaint_status->complaint_status == 1): ?>
                                                            <?php if(strtotime($product_warranty) > strtotime($current_date)): ?>
                                                                Approved
                                                            <?php else: ?>
                                                                Approved, waiting for the assignment of service engineer
                                                            <?php endif; ?>
                                                        <?php elseif($complaint_status->complaint_status == 4): ?>
                                                            <?php if(strtotime($product_warranty) > strtotime($current_date)): ?>
                                                                Pending
                                                            <?php else: ?>
                                                                Open
                                                            <?php endif; ?>
                                                        <?php elseif($complaint_status->complaint_status == 12): ?>
                                                            Scheduled
                                                        <?php elseif($complaint_status->complaint_status == 15): ?>
                                                            Quotation submitted
                                                        <?php elseif($complaint_status->complaint_status == 16): ?>
                                                            Quotation rejected
                                                        <?php elseif($complaint_status->complaint_status == 5): ?>
                                                            Complaint resolved
                                                        <?php elseif($complaint_status->complaint_status == 6): ?>
                                                            Under observation
                                                        <?php elseif($complaint_status->complaint_status == 7): ?>
                                                            Closed
                                                        <?php elseif($complaint_status->complaint_status == 8): ?>
                                                            Scheduled
                                                        <?php elseif($complaint_status->complaint_status == 9): ?>
                                                            Approved, waiting for the assignment of service engineer
                                                        <?php elseif($complaint_status->complaint_status == 10): ?>
                                                            Reopened
                                                        <?php elseif($complaint_status->complaint_status == 30): ?>
                                                            <?php echo e(ucfirst($complaint_status->activate_val) . ' ' . 'Renewed'); ?>

                                                        <?php elseif($complaint_status->complaint_status == 20): ?>
                                                            <?php if($complaint_status->complaint_type == 'amc_cmc_activation'): ?>
                                                                <?php echo e(ucfirst($complaint_status->activate_val) . ' '); ?>submitted
                                                            <?php elseif($complaint_status->complaint_type == 'amc_cmc_rene'): ?>
                                                                <?php echo e(ucfirst($complaint_status->activate_val) . ' '); ?>submitted
                                                            <?php else: ?>
                                                                Validation date submitted
                                                            <?php endif; ?>
                                                        <?php elseif($complaint_status->complaint_status == 21): ?>
                                                            <?php if($complaint_status->complaint_type == 'amc_cmc_activation'): ?>
                                                                <?php echo e(ucfirst($complaint_status->activate_val) . ' '); ?> rejected
                                                            <?php elseif($complaint_status->complaint_type == 'amc_cmc_rene'): ?>
                                                                <?php echo e(ucfirst($complaint_status->activate_val) . ' '); ?>rejected
                                                            <?php else: ?>
                                                                Validation date rejected
                                                            <?php endif; ?>
                                                        <?php elseif($complaint_status->complaint_status == 22): ?>
                                                            <?php if($complaint_status->complaint_type == 'amc_cmc_activation'): ?>
                                                                <?php echo e(ucfirst($complaint_status->activate_val) . ' '); ?>

                                                                activated
                                                            <?php elseif($complaint_status->complaint_type == 'amc_cmc_rene'): ?>
                                                                <?php echo e(ucfirst($complaint_status->activate_val) . ' '); ?>activated
                                                            <?php else: ?>
                                                                Renewed validation date
                                                            <?php endif; ?>
                                                        <?php elseif($complaint_status->complaint_status == 17): ?>
                                                            Quotation approved
                                                        <?php else: ?>
                                                            Open
                                                        <?php endif; ?>
                                                    </span>
                                                </li>

                                                <?php if($complaint_status->complaint_status == 6): ?>
                                                    <li><label>Observation period</label>:&nbsp;&nbsp;<span
                                                            style="color: #29c5bc;padding:0;">
                                                            <?php echo e(' ' . date('d-m-Y', strtotime($complaint_status->underobservation_from))); ?><?php echo e(' ' . 'to' . ' '); ?><?php echo e(date('d-m-Y', strtotime($complaint_status->underobservation_to))); ?></span>
                                                    </li>
                                                <?php endif; ?>

                                                <?php if($complaint_status->complaint_status == 6 || $complaint_status->complaint_status == 7): ?>
                                                    <li><label>Resolved on </label>:
                                                        <span><?php echo e(date('d-m-Y', strtotime($complaint_status->completed_date))); ?></span>
                                                    </li>
                                                <?php endif; ?>

                                                <?php if($complaint_status->complaint_status == 7): ?>
                                                    <li><label>Closed on </label>:
                                                        <span><?php echo e(date('d-m-Y', strtotime($complaint_status->closed_date))); ?></span>
                                                    </li>
                                                <?php endif; ?>

                                                <?php if($complaint_status->status == 4 ||
                                                    $complaint_status->status == 12 ||
                                                    $complaint_status->status == 8 ||
                                                    $complaint_status->status == 15 ||
                                                    $complaint_status->status == 16 ||
                                                    $complaint_status->status == 17): ?>
                                                    <li><label>Service Engineer Name</label>:
                                                        <span><?php echo e(ucfirst($complaint_status->first_name . ' ' . $complaint_status->last_name)); ?></span>
                                                    </li>
                                                    <li><label>Service Engineer Phone number</label>:
                                                        <span><?php echo e($complaint_status->phone); ?></span></li>
                                                    <li><span class="full-content" style="font-weight: 500;padding:0;">Dear
                                                            customer, your complaint will be resolved by <span
                                                                style="color: #29c5bc;padding:0;"><?php echo e($complaint_status->dateservice . ' ' . $complaint_status->time); ?></span></span>
                                                    </li>
                                                <?php endif; ?>
                                                <li class="dex">
                                                    <?php if($complaint_status->charge != ''): ?>
                                                        <?php if($complaint_status->complaint_status == 3): ?>
                                                            <button class="complaint_approve btns  float-left"
                                                                onclick="approve('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Approve</button>
                                                            <button class="complaint_reject btns float-left"
                                                                onclick="reject('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Reject</button>
                                                        <?php endif; ?>
                                                    <?php endif; ?>

                                                    <?php if($complaint_status->complaint_status == 5): ?>
                                                    <?php endif; ?>
                                                    <?php if($complaint_status->complaint_status == 4): ?>
                                                        <button class="complaint_approve btns  float-left"
                                                            onclick="approveschedule('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>','<?php echo e($complaint_status->engg_id); ?>')">Approve</button>
                                                        <button class="complaint_reject btns float-left"
                                                            onclick="rejectschedule('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Reject</button>
                                                    <?php endif; ?>
                                                    <?php if($complaint_status->complaint_status == 15): ?>
                                                        <button class="complaint_approve btns  float-left"
                                                            onclick="approvequotation('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Approve</button>
                                                        <button class="complaint_reject btns float-left"
                                                            onclick="rejectquotation('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Reject</button>
                                                    <?php endif; ?>
                                                    <?php if($complaint_status->price != ''): ?>
                                                        <button class="complaint_approve btns  float-left"
                                                            onclick="viewquotation('<?php echo e($complaint_status->price); ?>','<?php echo e($complaint_status->parts_replace); ?>','<?php echo e($complaint_status->quotation_doc); ?>')">View
                                                            Quotation</button>
                                                    <?php endif; ?>
                                                </li>
                                        </ul>
                            <?php endif; ?>

                            <!-- AMC RENEW END-->


                            <?php if($complaint_status->complaint_type == 'manual' ||
                                $complaint_status->complaint_type == 'installation_date' ||
                                $complaint_status->complaint_type == 'preventive_contract' ||
                                $complaint_status->complaint_type == 'inspection_request'): ?>
                                <li><label>Status</label>: <span id="complaintstatus_<?php echo e($complaint_status->serviceid); ?>">

                                        <?php if($complaint_status->complaint_status == 1): ?>
                                            <?php if(strtotime($product_warranty) > strtotime($current_date)): ?>
                                                Approved
                                            <?php else: ?>
                                                Approved, waiting for the assignment of service engineer
                                            <?php endif; ?>
                                        <?php elseif($complaint_status->complaint_status == 4): ?>
                                            <?php if(strtotime($product_warranty) > strtotime($current_date)): ?>
                                                Pending
                                            <?php else: ?>
                                                Open
                                            <?php endif; ?>
                                        <?php elseif($complaint_status->complaint_status == 12): ?>
                                            Scheduled
                                        <?php elseif($complaint_status->complaint_status == 15): ?>
                                            Quotation submitted
                                        <?php elseif($complaint_status->complaint_status == 16): ?>
                                            Quotation rejected
                                        <?php elseif($complaint_status->complaint_status == 5): ?>
                                            Complaint resolved
                                        <?php elseif($complaint_status->complaint_status == 6): ?>
                                            Under observation
                                        <?php elseif($complaint_status->complaint_status == 7): ?>
                                            Closed
                                        <?php elseif($complaint_status->complaint_status == 8): ?>
                                            Scheduled
                                        <?php elseif($complaint_status->complaint_status == 9): ?>
                                            Approved, waiting for the assignment of service engineer
                                        <?php elseif($complaint_status->complaint_status == 10): ?>
                                            Reopened
                                        <?php elseif($complaint_status->complaint_status == 20): ?>
                                            Renewed validation date
                                        <?php elseif($complaint_status->complaint_status == 17): ?>
                                            Quotation approved
                                        <?php else: ?>
                                            Open
                                        <?php endif; ?>
                                    </span>
                                </li>

                                <?php if($complaint_status->complaint_status == 6): ?>
                                    <li><label>Observation period</label>:&nbsp;&nbsp;<span
                                            style="color: #29c5bc;padding:0;">
                                            <?php echo e(' ' . date('d-m-Y', strtotime($complaint_status->underobservation_from))); ?><?php echo e(' ' . 'to' . ' '); ?><?php echo e(date('d-m-Y', strtotime($complaint_status->underobservation_to))); ?></span>
                                    </li>
                                <?php endif; ?>

                                <?php if($complaint_status->complaint_status == 6 ||
                                    $complaint_status->complaint_status == 7 ||
                                    $complaint_status->complaint_status == 5): ?>
                                    <li><label>Resolved on </label>: <span>
                                            <?php echo e(date('d-m-Y', strtotime($complaint_status->resolved_date))); ?></span></li>
                                <?php endif; ?>

                                <?php if($complaint_status->complaint_status == 7): ?>
                                    <li><label>Closed on </label>:
                                        <span><?php echo e(date('d-m-Y', strtotime($complaint_status->closed_date))); ?></span></li>
                                <?php endif; ?>

                                <?php if($complaint_status->status == 4 ||
                                    $complaint_status->status == 12 ||
                                    $complaint_status->status == 8 ||
                                    $complaint_status->status == 15 ||
                                    $complaint_status->status == 16 ||
                                    $complaint_status->status == 17): ?>
                                    <li><label>Service Engineer Name</label>:
                                        <span><?php echo e(ucfirst($complaint_status->first_name . ' ' . $complaint_status->last_name)); ?></span>
                                    </li>
                                    <li><label>Service Engineer Phone number</label>:
                                        <span><?php echo e($complaint_status->phone); ?></span></li>
                                    <li><span class="full-content" style="font-weight: 500;padding:0;">Dear customer, your
                                            complaint will be resolved by <span
                                                style="color: #29c5bc;padding:0;"><?php echo e($complaint_status->dateservice . ' ' . $complaint_status->time); ?></span></span>
                                    </li>
                                <?php endif; ?>
                                <li class="dex">
                                    <?php if($complaint_status->charge != ''): ?>
                                        <?php if($complaint_status->complaint_status == 3): ?>
                                            <button class="complaint_approve btns  float-left"
                                                onclick="approve('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Approve</button>
                                            <button class="complaint_reject btns float-left"
                                                onclick="reject('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Reject</button>
                                        <?php endif; ?>
                                    <?php endif; ?>

                                    <?php if($complaint_status->complaint_status == 5): ?>
                                        <span class="view-msg float-left"
                                            onclick="view_updates(<?php echo e($complaint_status->id); ?>)">View</span>
                                            <?php if($complaint_status->complaint_type !='inspection_request'): ?>
                                        <span class="view-msg float-left"
                                            onclick="under_observation(<?php echo e($complaint_status->id); ?>,<?php echo e($prdid); ?>,<?php echo e($complaint_status->user_id); ?>,'<?php echo e($complaint_status->type); ?>')">Under
                                            observation</span>
                                        <span class="view-msg float-left"
                                            onclick="closecomplaint(<?php echo e($complaint_status->id); ?>)">Close</span>

                                        <?php endif; ?>
                                    <?php endif; ?>
                                    <?php if($complaint_status->complaint_status == 6): ?>
                                        <span class="view-msg float-left"
                                            onclick="view_updates(<?php echo e($complaint_status->id); ?>)">View</span>
                                    <?php endif; ?>
                                    <?php if($complaint_status->complaint_status == 4): ?>
                                        <button class="complaint_approve btns  float-left"
                                            onclick="approveschedule('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>','<?php echo e($complaint_status->engg_id); ?>')">Approve</button>
                                        <button class="complaint_reject btns float-left"
                                            onclick="rejectschedule('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Reject</button>
                                    <?php endif; ?>
                                    <?php if($complaint_status->complaint_status == 15): ?>
                                        <button class="complaint_approve btns  float-left"
                                            onclick="approvequotation('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Approve</button>
                                        <button class="complaint_reject btns float-left"
                                            onclick="rejectquotation('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>',<?php echo e($prdid); ?>,'<?php echo e($complaint_status->type); ?>')">Reject</button>
                                    <?php endif; ?>
                                    <?php if($complaint_status->price != ''): ?>
                                        <button class="complaint_approve btns  float-left"
                                            onclick="viewquotation('<?php echo e($complaint_status->price); ?>','<?php echo e($complaint_status->parts_replace); ?>','<?php echo e($complaint_status->quotation_doc); ?>')">View
                                            Quotation</button>
                                    <?php endif; ?>
                                </li>
                                </ul>
                            <?php endif; ?>









                            <div class="btns_area wraper">
                                <!--<div class="col-lg-6">
                                                                        <span class="view-msg" onclick="viewmessage(<?php echo e($complaint_status->id); ?>)">View message</span>
                                                                    </div>-->
                                <!--<span class="complaintmsg view-msg" data-complaintid="<?php echo e($complaint_status->id); ?>" data-productid="<?php echo e($complaint_status->product_id); ?>"  data-receivername="<?php echo e($complaint_status->vendorname); ?>"  data-receiverid="<?php echo e($complaint_status->user_id); ?>" >Send Message</span>-->
                                <div class="d-flex f2 justify-btns" style="margin-top:5px;">
                                
                                    <?php if($complaint_status->complaint_type!='inspection_request'): ?>)
                                    <?php if($complaint_status->type == 'approve'): ?>
                                        <a class="float-left"
                                            href="<?php echo e(url('/message/' . $complaint_status->user_id . '/' . $complaint_status->productid . '/' . $complaint_status->id)); ?>">Send
                                            Message</a>
                                    <?php else: ?>
                                        <a class="float-left"
                                            href="<?php echo e(url('/message/' . $complaint_status->user_id . '/' . $complaint_status->existing_product_id . '/' . $complaint_status->id)); ?>">Send
                                            Message</a>
                                    <?php endif; ?>


                                    <button style="cursor: pointer;" class="btns common-btn yellow-btn float-left"
                                        data-toggle="modal" data-target="#myModalaction"
                                        data-cpostdate="<?php echo e(date('d-m-Y', strtotime($complaint_status->date))); ?>"
                                        data-servicechargeapprove="<?php echo e(date('d-m-Y', strtotime($complaint_status->servicecharge_approved_date))); ?>"
                                        data-servicechargereject="<?php echo e(date('d-m-Y', strtotime($complaint_status->servicecharge_removed_date))); ?>"
                                        data-scheduleddate="<?php echo e(date('d-m-Y', strtotime($complaint_status->scheduled_date))); ?>"
                                        data-closeddate="<?php echo e(date('d-m-Y', strtotime($complaint_status->closed_date))); ?>"
                                        data-productname="<?php echo e($pname); ?>"
                                        data-vendorname="<?php echo e($complaint_status->vendorname); ?>"
                                        data-resolveddate="<?php echo e(date('d-m-Y', strtotime($complaint_status->resolved_date))); ?>">Complaint
                                        History</button>
                                    <?php endif; ?>

                                    <?php if($complaint_status->complaint_status == 7): ?>
                                        <button style="cursor: pointer;"
                                            class="btns common-btn yellow-btn complaintrate  float-left"
                                            onclick="complaintrate('<?php echo e($complaint_status->id); ?>')">Rate our
                                            services</button>
                                        <span class="view-msg  float-left"
                                            onclick="reopencomplaint(<?php echo e($complaint_status->id); ?>)">Reopen</span>
                                    <?php endif; ?>
                                    <?php if($complaint_status->complaint_status == 6): ?>
                                    <?php endif; ?>
                                </div>
                            </div>

                            <!--<div class="specifications wraper">
                                        <p><label>Posted date</label>: <span><?php echo e($complaint_status->date); ?></span></p>
                                        <p><label>Complaint</label>: <span><?php echo e(ucfirst($complaint_status->complaint)); ?></span></p>
                                        <?php if($complaint_status->charge != ''): ?>
    <p><label>Charges</label>: <span><?php echo e($complaint_status->charge + $complaint_status->charge * ($complaint_status->tax / 100)); ?> INR ( Tax <?php echo e($complaint_status->tax); ?> %)</span>
                                        </p>
    <?php endif; ?>
                                        <?php if($complaint_status->tax != ''): ?>
    <?php endif; ?>
                                              <p><label>Status</label>: <span id="complaintstatus_<?php echo e($complaint_status->serviceid); ?>">
    <?php if($complaint_status->complaint_status == 1): ?>
    Approved
<?php elseif($complaint_status->complaint_status == 4): ?>
    Scheduled
<?php elseif($complaint_status->complaint_status == 5): ?>
    Scheduled
<?php elseif($complaint_status->complaint_status == 6): ?>
    Completed
<?php elseif($complaint_status->complaint_status == 7): ?>
    Closed
<?php else: ?>
    Open
    <?php endif; ?>
    </span></p>
                                      <?php if($complaint_status->complaint_status == 6 || $complaint_status->complaint_status == 7): ?>
    <p><label>Resolved on </label>: <span><?php echo e($complaint_status->completed_date); ?></span></p>
    <?php endif; ?>
                                      <?php if($complaint_status->complaint_status == 7): ?>
    <p><label>Closed on </label>: <span><?php echo e($complaint_status->closed_date); ?></span></p>
    <?php endif; ?>
                                      
                                      <?php if($complaint_status->charge != ''): ?>
    <?php if($complaint_status->complaint_status == 3): ?>
    <button class="complaint_approve" onclick="approve('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>')">Approve</button>
                                            <button class="complaint_reject" onclick="reject('<?php echo e($complaint_status->serviceid); ?>','<?php echo e($complaint_status->id); ?>','<?php echo e($complaint_status->user_id); ?>')">Reject</button>
<?php elseif($complaint_status->complaint_status == 4): ?>
    <p><span>Dear customer your registered complaint will be fixed with in <?php echo e($complaint_status->dateservice . ' ' . $complaint_status->time); ?></span></p>
<?php else: ?>
    <?php endif; ?>
    <?php endif; ?>
                                      
                                      
                                                                <div class="row row-rs5">
                                                                    <div class="col-lg-6">
                                                                      <span class="complaintmsg view-msg" data-complaintid="<?php echo e($complaint_status->id); ?>" data-productid="<?php echo e($complaint_status->product_id); ?>"  data-receivername="<?php echo e($complaint_status->vendorname); ?>"  data-receiverid="<?php echo e($complaint_status->user_id); ?>" >Send Message</span>
                                                                    </div>
                
                                          <?php if($complaint_status->complaint_status == 6): ?>
    <div class="col-lg-6">
                                                                        <span class="view-msg" onclick="closecomplaint(<?php echo e($complaint_status->id); ?>)">Close</span>
                
                                                                    </div>
    <?php endif; ?>
                                                                </div>
                                  </div>
                -->
                        </div>
                    </div>

                  
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                   
                     
                  
                </div>
            </div>
        </div> <!-- boxings end -->

    </div>

   <!-- Modal view quotation -->
   <div class="modal fade" id="myModalactionview" role="dialog">
    <div class="modal-dialog modal-dialog-centered">
        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">View Quotation</h5>
                <button type="button" class="close close_message" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="col-sm-12 col-xs-12">
                    <div class="right-panel vendor">
                        <Span class="Tittle">Parts need to be replace</Span>
                        <Span class="Collon">:</Span>
                        <Span class="Value qparts"></Span>
                    </div>
                    <div class="right-panel vendor">
                        <Span class="Tittle">Price</Span>
                        <Span class="Collon">:</Span>
                        <Span class="Value qprice"></Span>
                    </div>
                    <div class="right-panel vendor">
                        <Span class="Tittle">Quotation</Span>
                        <Span class="Collon">:</Span>
                        <Span class="Value qdoc"></Span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>




<!-- Modal view updates -->
<div class="modal fade" id="exampleModal_updates" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog"> 
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">View Updates</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
  
        <div class="modal-body imageArea" id="demo">
        <p id="update_content"></p>
         <img id="myImg"  src="" width="300" height="300"> 
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal" id="closebar">Close</button>
          
        </div>
      </div>
    </div>
  </div>
  <!-- Modal Request Product -->














<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(URL::to('assets/js/buyernew.js')); ?>"></script>
    <script src="<?php echo e(URL::to('assets/js/buyer.js')); ?>"></script>
    <script src="<?php echo e(URL::to('assets/calender/calendar.min.js')); ?>"></script>
    <script>
        function downloadpdf(oid) {
            window.location = baseurl + 'generate-pdf?id=' + oid;
        }
        $(document).ready(function() {

            //OTP VERIFICATION

            $('#otpverify').on('click', function(event) {
                var oid = $("#order_id").val();
                event.preventDefault();
                if (($('#otp1').val() == '') && ($('#otp2').val() == '') && ($('#otp3').val() == '') && ($(
                        '#otp4').val() == '') && ($('#otp5').val() == '') && ($('#otp6').val() == '')) {
                    swal("", "Please Enter a valid OTP", "warning");
                } else {

                    var email = $('#email').val();
                    var phoneno = $('#phone_no').val();
                    var otp = $('#otp1').val() + $('#otp2').val() + $('#otp3').val() + $('#otp4').val() + $(
                        '#otp5').val() + $('#otp6').val();
                    var APP_URL = <?php echo json_encode(url('/verifyotpuser')); ?>;
                    var saveData = $.ajax({
                        type: 'GET',
                        url: APP_URL + '/' + email + '/' + phoneno + '/' + otp + '/' + oid,
                        data: {
                            email: email,
                            phoneno: phoneno,
                            _token: '<?php echo e(csrf_token()); ?>',
                            oid: oid
                        },
                        dataType: "text",
                        success: function(resultData) {

                            if (resultData == '1') {

                                swal({
                                    title: "",
                                    text: "OTP is verified successfully",
                                    type: "success",
                                }, function() {

                                    window.location = baseurl + 'buyers/order_summary/';

                                });

                            } else if (resultData == '0') {
                                swal("", "Please Enter a valid OTP", "warning");
                                //alert('Please Enter a valid otp');
                            } else {

                                swal("", "Please Enter a valid OTP", "warning");
                                // alert('Please Enter a valid otp');
                            }

                        }
                    });

                }



            });

            $('#approvepo').on('click', function() {
                $(".pageloader").show();


                var oid = $(this).data("orderid");
                $("#order_id").val(oid);
                var email = $('#email').val();
                var phoneno = $('#phone_no').val();
                var otp = Math.floor(100000 + Math.random() * 900000);


                var APP_URL = <?php echo json_encode(url('/setotpuser')); ?>;
                var saveData = $.ajax({
                    type: 'GET',
                    url: APP_URL + '/' + email + '/' + phoneno + '/' + otp,
                    data: {
                        email: email,
                        phoneno: phoneno,
                        otp: otp,
                        _token: '<?php echo e(csrf_token()); ?>'
                    },
                    dataType: "text",
                    success: function(resultData) {
                        console.log(resultData);
                        /*if(resultData == 'success'){
                            alert('success');
                        }*/
                    }
                });
                var SMS_URL = 'https://www.meddbot.com/twiliosms/';
                var saveData = $.ajax({
                    type: 'POST',
                    url: SMS_URL,
                    data: {
                        phoneno: phoneno,
                        otp: otp,
                        _token: '<?php echo e(csrf_token()); ?>'
                    },
                    dataType: "text",
                    success: function(resultData) {



                        swal({
                            title: "",
                            text: "OTP send to your registered Phone Number",
                            type: "success",
                            showCancelButton: false,
                            dangerMode: false,
                            confirmButtonText: 'OK'
                        }, function() {
                            $('#approve').modal({
                                backdrop: 'static',
                                keyboard: false
                            });
                            $(".pageloader").hide();
                        })
                    }
                });


            });

        });

        <?php if(Session::has('message')): ?>
            swal({
                title: "",
                text: "<?php echo e(Session::get('message')); ?>",
                type: "success",
                showCancelButton: false,
                dangerMode: false,
                confirmButtonText: 'OK',

            });
        <?php endif; ?>
        <?php if(Session::has('errormessage')): ?>
            swal({
                title: "",
                text: "<?php echo e(Session::get('errormessage')); ?>",
                type: "error",
                showCancelButton: false,
                dangerMode: true,
                confirmButtonText: 'OK',

            });
        <?php endif; ?>
    </script>
<?php $__env->stopSection(); ?>

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