<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>
    .check{
        border:1px solid red !important;
    }
    .d-flex.f2.justify-content-between a, .compalintBox .justify-content-between .btns.common-btn, .compalintBox .card  .justify-content-between span.view-msg {
        padding: 8px 10px;
        font-size: 13px;
        font-weight: 600;
        height: 34px;
        margin-right: 3px;
        margin-top: 0;
    }
    
    .user-rating {
        direction: rtl;
        font-size: 20px;
        unicode-bidi: bidi-override;
        padding: 10px 30px;
        display: inline-block;
    }
    .user-rating input {
        opacity: 0;
        position: relative;
        left: -15px;
        z-index: 2;
        cursor: pointer;
    }
    .user-rating span.star:before {
        color: #777777;
        content:"ï€†";
        /*padding-right: 5px;*/
    }
    .user-rating span.star {
        display: inline-block;
        font-family: FontAwesome;
        font-style: normal;
        font-weight: normal;
        position: relative;
        z-index: 1;
    }
    .user-rating span {
        margin-left: -15px;
    }
    .user-rating span.star:before {
        color: #777777;
        content:"\f006";
        /*padding-right: 5px;*/
    }
    .user-rating input:hover + span.star:before, .user-rating input:hover + span.star ~ span.star:before, .user-rating input:checked + span.star:before, .user-rating input:checked + span.star ~ span.star:before {
        color: #ffd100;
        content:"\f005";
    }
    
    .selected-rating{
        color: #ffd100;
        font-weight: bold;
        font-size: 3em;
    }
    
    label.error{
        color:red;
    }
    .user i:before {
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        content: "\f2c0";
    }
    </style>
<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 LIST</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->departmentname !=''): ?>
                                                    <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>
                                                        <?php if($complaint_status->quotation_request != 1): ?>
                                                <li style="display: flex;" class="quot"><label>Receipt</label>: <div><a target="_blank" class="Custm 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></div>
                                                </li>
                                                <?php endif; ?>
                                            <?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 if($complaint_status->first_name ==''): ?> waiting for the assignment of service engineer <?php endif; ?>
                                                        <?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->quotation_request != 1): ?>

                                                    <?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 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): ?>
                                                 <?php if($complaint_status->first_name !=''): ?>   
                                                    <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; ?>
                                                <?php endif; ?>
                                                <li class="dex f-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->quotation_request != 1): ?>
                                                    <?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; ?>
                                                    <?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 if($complaint_status->first_name ==''): ?> waiting for the assignment of service engineer <?php endif; ?>
                                        <?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->quotation_request != 1): ?>
                                <?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 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 if($complaint_status->installation_challan!=''): ?>
                                        <li style="display: flex;" class="quot"><label>Installation Certificate</label>: <div><a target="_blank" class="Custm eye"
                                            href="<?php echo e(url('assets/pdf/install-chellan' . $complaint_status->installation_challan)); ?>"><?php echo e($complaint_status->installation_challan); ?><i
                                                class="fa fa-file" aria-hidden="true"></i> View</a></div>
                                          </li>
                                    <?php endif; ?>
                                <?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): ?>
                          
                                <?php if($complaint_status->first_name !=''): ?>
                                    <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; ?>
                                <?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>
                                    <?php endif; ?>

                                        <?php if($complaint_status->complaint_type=='installation_date'): ?>
                                        <span class="view-msg float-left closecomplaint"
                                            onclick="closecomplaint_installation(<?php echo e($complaint_status->id); ?>)">Close</span>
                                        <?php else: ?>

                                        <?php if($complaint_status->complaint_type !='inspection_request'): ?>

                                        <span class="view-msg float-left closecomplaint"
                                            onclick="closecomplaint(<?php echo e($complaint_status->id); ?>)">Close</span>

                                        <?php endif; ?>
                                    <?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>
                                            <span class="view-msg float-left closecomplaint"
                                            onclick="closecomplaint(<?php echo e($complaint_status->id); ?>)">Close</span>
                                            
                                            <span class="view-msg  float-left"
                                            onclick="reopencomplaint(<?php echo e($complaint_status->id); ?>)">Reopen</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->quotation_request != 1): ?>
                                    <?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; ?>
                                    <?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;display: none !important;">
                                   
                                   <?php if($complaint_status->complaint_type!="installation_date"): ?>
                                    <?php if($complaint_status->type == 'approve'): ?>
                                        <a class="float-left" style="display:none;"
                                            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" style="display:none;"
                                            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;" style="display:none  !important;" 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>

                                           
                                        
                                    <?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>






    <div class="modal fade  new-modal" id="approve" tabindex="-1" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <div class="otp">
                    <h4>OTP Verification</h4>
                    <p>Please Enter the OTP send to your Phone Number</p>
                    <input type="hidden" name="phone" id="phone_no" value="<?php echo Auth::user()->phone_no; ?>">
                    <input type="hidden" name="email" id="email" value="<?php echo Auth::user()->email; ?>">
                    <div class="otp-dflex">
                <input  min="0" max="9" pattern="\d*" type="number" onkeyup="onKeyUpEvent(1, event)" placeholder="0" maxlength="1" id="otp1">
                <input min="0" max="9" type="number" onkeyup="onKeyUpEvent(2, event)" placeholder="0" maxlength="1" id="otp2">
                <input min="0" max="9" type="number" onkeyup="onKeyUpEvent(3, event)" placeholder="0" maxlength="1" id="otp3">
                <input min="0" max="9" type="number" onkeyup="onKeyUpEvent(4, event)" placeholder="0" maxlength="1" id="otp4">
                <input min="0" max="9" type="number" onkeyup="onKeyUpEvent(5, event)" placeholder="0" maxlength="1" id="otp5">
                <input min="0" max="9" type="number" onkeyup="onKeyUpEvent(6, event)" placeholder="0" maxlength="1" id="otp6">
            </div>
                </div>
                <div class="medd-pop-buttons">
                    <input type="hidden" name="order_id" id="order_id" value="">
                    <button class="btn medd-blue medd-buttons" id="otpverify">Verify</button>
                    <button class="btn medd-blue medd-buttons" id="resend">Resend OTP</button>
                </div>
            </div>
        </div>
    </div>
</div>




























    
<!-- Modal Under observation -->
<div class="modal fade" id="exampleModal_observation" 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">Under Observation</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">
           
            <form name="add_observation" id="add_observation" method="POST" action="#">
                 <?php echo csrf_field(); ?>
               <div class="row manufacturerlist manufacturerlist-rs">
                  <div class="col-sm-12 col-xs-12">
                      <div class="form-inputs">
                        <div class="form-group">
                           <label>Number of days</label>
                           <input id="no_day" name="no_day" value="7" type="number" class="form-control">
                           
                           <input id="complaint_id_observation" name="complaint_id_observation" type="hidden" class="form-control">
                           <input id="observation_product_id" name="observation_product_id" type="hidden" class="form-control">
                           <input id="observation_vendor_id" name="observation_vendor_id" type="hidden" class="form-control">
                           
                            <input id="complaint_regsoldtype" name="complaint_regsoldtype" type="hidden" class="form-control">
                           
                        </div>
                        </div>
                      </div>
                  </div>
            </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-secondary closemessage" data-dismiss="modal" id="closebar">Close</button>
                  <button type="submit" class="btn btn-primary sendmessage" id="sendobservation">
                                <?php echo e(__('Send')); ?>

                             </button>
                </div>
            </form>
        
        </div>
  <!--
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal" id="closebar">Close</button>
          
        </div>
  -->
      </div>
    </div>
  <!-- Modal -->

<!--Rating start modal-->			  
<div class="modal fade" id="myModalrate" role="dialog"  >
    <div class="modal-dialog modal-dialog-centered">
    <!-- Modal content-->
        <div class="modal-content ratingPops">
            <div class="modal-header text-center">
                <h5 class="modal-title" id="exampleModalLabel">RATE OUR SERVICES</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  text-center">
            <div class="rate-rs">
             <form name="ratingcheck" id="ratingcheck" method="POST" action="<?php echo e(url('buyers/ratingcheck')); ?>">
                <?php echo csrf_field(); ?>
                    <div id="pro" class="col-lg-12">
                            <div  class="col-lg-12">
                                <label>Professionalism</label>
                            </div>
                            <div class="col-lg-12">
                                <span class="user-rating">
                                <input type="radio" name="rating1" value="5"><span class="star"></span>
                                <input type="radio" name="rating1" value="4"><span class="star"></span>
                                <input type="radio" name="rating1" value="3"><span class="star"></span>
                                <input type="radio" name="rating1" value="2"><span class="star"></span>
                                <input type="radio" name="rating1" value="1"><span class="star"></span>
                                </span>
                            </div>
                        </div>
                        <div id="pro" class="col-lg-12">
                            <div style="" class="col-lg-12">
                                <label >Knowledge of product</label>
                            </div>
                           <div class="col-lg-12">
                            <span class="user-rating">
                                <input type="radio" name="rating2" value="5"><span class="star"></span>

                                <input type="radio" name="rating2" value="4"><span class="star"></span>

                                <input type="radio" name="rating2" value="3"><span class="star"></span>

                                <input type="radio" name="rating2" value="2"><span class="star"></span>

                                <input type="radio" name="rating2" value="1"><span class="star"></span>
                            </span>
                            </div>
                        </div>
                        <div id="pro" class="col-lg-12">
                            <div style="" class="col-lg-12">
                                <label >Timely attending complaint</label>
                            </div>
                           <div class="col-lg-12">
                            <span class="user-rating">
                                <input type="radio" name="rating3" value="5"><span class="star"></span>

                                <input type="radio" name="rating3" value="4"><span class="star"></span>

                                <input type="radio" name="rating3" value="3"><span class="star"></span>

                                <input type="radio" name="rating3" value="2"><span class="star"></span>

                                <input type="radio" name="rating3" value="1"><span class="star"></span>
                            </span>
                           </div>
                        </div>
                        <div id="pro" class="col-lg-12">
                            <div style="" class="col-lg-12">
                                <label >Overall satisfaction</label>
                            </div>
                           <div class="col-lg-12">
                            <span class="user-rating">
                                <input type="radio" name="rating4" value="5"><span class="star"></span>

                                <input type="radio" name="rating4" value="4"><span class="star"></span>

                                <input type="radio" name="rating4" value="3"><span class="star"></span>

                                <input type="radio" name="rating4" value="2"><span class="star"></span>

                                <input type="radio" name="rating4" value="1"><span class="star"></span>
                            </span>
                            </div>
                        </div>
                       <div class="col-sm-12 col-xs-12">
                        <div class="form-inputs">
                          <div class="form-group">
                            <label>Enter your feedback</label>
                            <textarea style="width:100%;border: 1px solid #cacaca;border-radius: 5px;padding: 15px;" id="complaint_feedback" name="complaint_feedback" rows="4" cols="50"></textarea>
                          </div>
                        </div>
                        </div>
                        
                        <div id="pro" class="col-lg-12">
                        <input type="hidden" name="complaint_rating_updateid" id="complaint_rating_updateid">
                        <button type="submit" class="btn btn-primary common-btn" id="regnewss">
                                <?php echo e(__('Save')); ?>

                        </button>
                        </div>
                </form>
                </div> 
             
              </div>
                       
        </div>

        </div>

    </div>
<!-- Modal -->








<!-- 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 -->



      <!-- 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>

<?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>
        
        //                <!--     OTP auto tabing script          -->
    
      function getCodeBoxElement(index) {
        return document.getElementById('otp' + index);
      }
      function onKeyUpEvent(index, event) {
        const eventCode = event.which || event.keyCode;
        if (getCodeBoxElement(index).value.length === 1) {
          if (index !== 6) {
            getCodeBoxElement(index+ 1).focus();
          } else {
            getCodeBoxElement(index).blur();
            // Submit code
            console.log('submit code ');
          }
        }
        if (eventCode === 8 && index !== 1) {
          getCodeBoxElement(index - 1).focus();
        }
      }
      function onFocusEvent(index) {
        for (item = 1; item < index; item++) {
          const currentElement = getCodeBoxElement(item);
          if (!currentElement.value) {
              currentElement.focus();
              break;
          }
        }
      }
      
      $(".modal").on('shown.bs.modal', function () {
    $(this).find("#otp1").focus();
});    
    
     document.querySelectorAll('input[type="number"]').forEach(input =>{
         input.oninput = () =>{
             if(input.value.length > input.maxLength) input.value = input.value.slice(0, input.maxLength);
         };
     }) ;  
        
     var otpnew='';
     var cid='';

function reopencomplaint(complaintid){
	
	swal({
		  title: "Are you sure want to reopen?",
		  text: "",
		  type: "warning",
		  showCancelButton: true,
		  confirmButtonColor: "#DD6B55",
		  confirmButtonText: "Yes, Reopen it!",
		  closeOnConfirm: false,
		  html: false
		}, function(){
			
			     var data1 = {
					_token: $('#token_buyer').val(),
					complaintid:complaintid
				}
				$.ajax({
					url: baseurl + 'complaint_reopen',
					type: "POST",
					data: data1,
					success: function(res) {

						if(res==1){
							swal({
								title: "",
								text: "Successfully  Reopened!",
								type: "success",
								showCancelButton: false,
								dangerMode: false,
								confirmButtonText: 'OK'
							},function () {
								window.location = baseurl + 'buyers/complaint_status';
							})

						}

					}
				});
			     
			});
	
	
}

function closecomplaint_installation(complaintid){


    cid=complaintid;

 swal({
       title: "Are you sure want to close?",
       text: "",
       type: "warning",
       showCancelButton: true,
       confirmButtonColor: "#DD6B55",
       confirmButtonText: "Yes, Close it",
       closeOnConfirm: false,
       html: false
     }, function(){
        $(".pageloader").show();


        if (
                            <?php if(Auth::user()->signature == null): ?>
                                true
                            <?php else: ?>
                                false
                            <?php endif; ?> ) {
                                        swal({
                                            title: "No valid signature found",
                                            text: "Please upload your signature in profile settings",
                                            type: "warning",
                                        }, function() {
                                            window.location = baseurl + 'userprofile/';
                                        });
                            } 
                            else{


                                var data = {
                                _token: $('#token_buyer').val()
                                 }
                            $.ajax({
                                    url: baseurl + 'sendOTP',
                                    type: "POST",
                                    data: data,
                                    success: function(res) {
                                        if (res == true) {
                                            $(".pageloader").hide();
                                            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
                                                });
                                            })
                                        } else {
                                            $(".pageloader").hide();
                                            swal("", "Please try again", "warning");
                                        }
                                    }
                                });

                            }

     });

}
function closecomplaint(complaintid){

    cid=complaintid;

 swal({
       title: "Are you sure want to close?",
       text: "",
       type: "warning",
       showCancelButton: true,
       confirmButtonColor: "#DD6B55",
       confirmButtonText: "Yes, Close it",
       closeOnConfirm: false,
       html: false
     }, function(){
        $(".pageloader").show();
             var data = {
                            _token: $('#token_buyer').val()
                        }
                    $.ajax({
                            url: baseurl + 'sendOTP',
                            type: "POST",
                            data: data,
                            success: function(res) {
                                if (res == true) {
                                    $(".pageloader").hide();
                                    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
                                        });
                                    })
                                } else {
                                    $(".pageloader").hide();
                                    swal("", "Please try again", "warning");
                                }
                            }
                        });

     });
}


        function downloadpdf(oid) {
            window.location = baseurl + 'generate-pdf?id=' + oid;
        }
        $(document).ready(function() {
            //Resend Otp

            $('#resend').on('click', function(event) {
                        $(".pageloader").show();
                        var data = {
                            _token: $('#token_buyer').val()
                        }
                        $.ajax({
                            url: baseurl + 'sendOTP',
                            type: "POST",
                            data: data,
                            success: function(res) {
                                if (res == true) {
                                    $(".pageloader").hide();
                                    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
                                        });
                                    })
                                } else {
                                    $(".pageloader").hide();
                                    swal("", "Please try again", "warning");
                                }
                            }
                        });
                    });


            //OTP VERIFICATION
            $('#otpverify').on('click', function(event) {
                  

                $(".pageloader").show();

                  event.preventDefault();
                        var otp = $('#otp1').val() + $('#otp2').val() + $('#otp3').val() + $('#otp4').val() + $(
                            '#otp5').val() + $('#otp6').val();
                        if (($('#otp1').val() == '') && ($('#otp2').val() == '') && ($('#otp3').val() == '') && ($(
                                '#otp4').val() == '') && ($('#otp5').val() == '') && ($('#otp6').val() == '')) {
                            swal("", "Please Enter a valid OTP", "warning");
                            $(".pageloader").hide();
                        } else {



                            var data = {
                                _token: $('#token_buyer').val(),
                                complaintid:cid,
                                otp: otp
                            }
                            $.ajax({
                                url: baseurl + 'complaint_close',
                                type: "POST",
                                data: data,
                                success: function(res) {

                                  
                                    if (res == true) {

                                        $(".pageloader").hide();
                                        swal({
                                            title: "",
                                            text: "OTP is verified successfully",
                                            type: "success",
                                        }, function() {
                                           

                                                window.location = baseurl + 'buyers/complaint_status';
                                        });
                                    } else {
                                        swal("", "Please Enter a valid OTP", "warning");
                                        $('#otp1').val('');
                                        $('#otp2').val('');
                                        $('#otp3').val('');
                                        $('#otp4').val('');
                                        $('#otp5').val('');
                                        $('#otp6').val('');
                                    }
                                }
                            });
                           
                     }
            });
        });

        <?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_biomedical.blade.php ENDPATH**/ ?>