<?php $__env->startSection('content'); ?>
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
    <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";
        }

        .page {
            width: 100%;
            height: 100%;
        }

        .phone {
            width: 100%;
            height: 100%;
            background-position: center center;
            background-repeat: no-repeat;
            background-size: auto 800px;
        }

        .chat-root {
            height: 100%;
        }

        .wa-container {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            position: relative;
        }

        .sent-btttn {
            position: relative;
            display: table;
            margin: 0px auto;
            background: #14a852 !important;
            font-family: roboto, sans-serif;
            color: #fff;
        }

        .sent-btttn i {
            margin-top: 16px;
        }

        .wa-container .status-bar {
            height: 25px;
            background: #054d44;
            color: #fff;
            font-size: 14px;
            padding: 0 8px;
        }

        .wa-container .status-bar:after {
            content: "";
            display: table;
            clear: both;
        }

        .wa-container .status-bar div {
            float: right;
            position: relative;
            top: 50%;
            transform: translateY(-50%);
            margin: 0 0 0 8px;
        }

        .wa-container .user-bar {
            height: 55px;
            background: #14a852;
            color: #fff;
            padding: 0 8px;
            font-size: 24px;
        }

        .wa-container .user-bar:after {
            content: "";
            display: table;
            clear: both;
        }

        .wa-container .user-bar div {
            float: left;
            position: relative;
            top: 50%;
            transform: translateY(-50%);
        }

        .wa-container .user-bar div.actions {
            float: right;
            margin: 0 0 0 20px;
        }

        .wa-container .user-bar div.actions.more {
            margin: 0 12px 0 20px;
        }

        .wa-container .user-bar div.actions.attachment i {
            display: block;
            transform: rotate(-45deg);
        }

        .wa-container .user-bar .user {
            margin: 0 0 0 8px;
            width: 36px;
            height: 36px;
        }

        .wa-container .user-bar .user img {
            border-radius: 50%;
            display: block;
            box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
            width: 100%;
        }

        .wa-container .user-bar .user-name {
            font-size: 16px;
            margin: 0 0 0 8px;
            width: 165px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .wa-container .user-bar .user-name span {
            display: block;
            font-size: 12px;
        }

        .wa-container .bottom-bar {
            height: 47px;
            background: #000;
            color: #fff;
            font-size: 22px;
        }

        .wa-container .bottom-bar div {
            width: 33.333333%;
            float: left;
            text-align: center;
            position: relative;
            top: 50%;
            transform: translateY(-50%);
        }

        .wa-container .bottom-bar div.triangle i {
            display: block;
            transform: rotate(-90deg);
        }

        .wa-container .chat-window {
            height: calc(100% - 152px);
            position: relative;
            background-size: 100%;
            border: 1px solid #14a85275;
            background: #14a8521f;
            box-shadow: inset 0 10px 10px -10px #000000;
        }

        .wa-container .chat-window:after {
            content: "";
            display: table;
            clear: both;
        }

        .wa-container .chat-window .conversation {
            width: 100%;
            overflow: auto;
            height: calc(100% - 68px);
            padding: 0 16px;
        }

        .wa-container .chat-window .conversation:after {
            content: "";
            display: table;
            clear: both;
        }

        .wa-container .chat-window .balloon {
            padding: 8px;
            position: relative;
            color: #000;
            font-size: 14px;
            line-height: 18px;
            box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
            clear: both;
            margin: 8px 0;
            max-width: 85%;
        }

        .wa-container .chat-window .balloon:after {
            position: absolute;
            content: "";
            width: 0;
            height: 0;
            border-style: solid;
        }

        .wa-container .chat-window .balloon .data {
            display: inline-block;
            padding: 0 20px 0 16px;
            font-size: 11px;
            color: #b9b9b9;
            position: relative;
            bottom: -5px;
            float: right;
            background-repeat: no-repeat;
            background-position: right 3px;
            background-color: transparent;
            background-size: 16px auto;
        }

        .sent-btttn {
            padding: 0px 30px;
            cursor: pointer;
        }

        .wa-container .chat-window .balloon .data.blue {
            background-image: url("http://wutsapp.net/images/dist/blue.png");
        }

        .wa-container .chat-window .balloon img {
            width: 100%;
        }

        .wa-container .chat-window .balloon:first-child {
            margin: 16px 0 8px;
        }

        .wa-container .chat-window .balloon.him {
            background: #fff;
            float: left;
            border-radius: 0px 5px 5px 5px;
        }

        .wa-container .chat-window .balloon.him .data {
            padding: 0 0 0 16px;
        }

        .wa-container .chat-window .balloon.him:after {
            top: 0;
            left: -10px;
            border-width: 0px 10px 10px 0;
            border-color: transparent #fff transparent transparent;
        }

        .wa-container .chat-window .balloon.you {
            background: #e1ffc7;
            float: right;
            border-radius: 5px 0px 5px 5px;
        }

        .wa-container .chat-window .balloon.you:after {
            top: 0;
            right: -10px;
            border-width: 0px 0 10px 10px;
            border-color: transparent transparent transparent #e1ffc7;
        }

        .wa-container .chat-window .textarea {
            width: 100%;
            z-index: 2;
            left: 0;
            position: absolute;
            bottom: 8px;
            height: 50px;
            padding: 0 0 0 8px;
        }

        .wa-container .chat-window .textarea:after {
            content: "";
            display: table;
            clear: both;
        }

        .wa-container .chat-window .textarea ::-webkit-input-placeholder {
            color: #b9b9b9;
        }

        .wa-container .chat-window .textarea ::-moz-placeholder {
            /* Firefox 19+ */
            color: #b9b9b9;
        }

        .wa-container .chat-window .textarea :-ms-input-placeholder {
            color: #b9b9b9;
        }

        .wa-container .chat-window .textarea div,
        .wa-container .chat-window .textarea textarea {
            height: 100%;
            float: left;
            background: #fff;
        }

        .wa-container .chat-window .textarea .emoticons {
            width: 10%;
            background: url("http://valeriopierbattista.com/projects/wutsapp/images/dist/smile.png") center center no-repeat #fff;
            background-size: 20px;
            border-radius: 5px 0 0 5px;
        }

        .wa-container .chat-window .textarea textarea {
            width: 80%;
            border: 0;
            outline: none;
            padding-top: 14px;
            resize: none;
        }

        .wa-container .chat-window .textarea .photo {
            width: 10%;
            border-radius: 0 0 5px 0;
            position: relative;
            text-align: center;
        }

        .wa-container .chat-window .textarea .photo:after {
            position: absolute;
            width: 0;
            height: 0;
            border-style: solid;
            content: "";
            top: 0;
            right: -10px;
            border-width: 0px 0 10px 10px;
            border-color: transparent transparent transparent #fff;
        }

        .wa-container .chat-window .textarea .photo i {
            display: block;
            position: relative;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #7d8488;
            font-size: 24px;
        }

        .wa-container .chat-window .textarea .send-mic {
            width: 17%;
            background: transparent;
            position: relative;
            cursor: pointer;
        }

        .wa-container .chat-window .textarea .send-mic .circle-cont {
            color: #fff;
            border-radius: 50%;
            position: relative;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: #14a852;
            width: 48px;
            height: 48px;
            box-shadow: 0 1px 0 #14a852;
        }

        .wa-container .chat-window .textarea .send-mic .circle-cont i {
            display: inline-block;
            position: relative;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 24px;
        }

        .wrapperchat {
            height: calc(100% - 81px);
        }

        .page.nexus6 .phone {
            /*background-image: url("http://valeriopierbattista.com/projects/wutsapp/images/dist/nexus6.png");*/
            background-size: auto 799px;
        }

        .page.nexus6 .wa-container {
            width: 700px;
            height: 681px;
            padding: 6px 0 0;
        }

        .page.nexus6 .wa-container .chat-window {
            height: calc(100% - 55px);
        }

        .page.nexus6 .wrapperchat {
            height: calc(100% - 69px);
        }

        .more {
            position: absolute;
            bottom: 30px;
            left: 10px;
        }

        .more a,
        .more a:visited {
            padding: 10px 20px;
            color: black;
            font-size: 24px;
            background: yellow;
        }

        .certWraper .amc_title {
            margin-left: 0;
        }

        .certWraper .amc_details>div:first-child {
            margin-left: 0;
        }

        a.eye {
            color: #11beb4;
            background: transparent;
            padding: 4px 0px;
            border-radius: 0;
        }

        a.eye i {
            margin-right: 2px;
        }

        .amc_details>div {
            text-transform: inherit;
            font-size: 15px;
        }

        .amc_details {
            justify-content: center;
        }

        button.G-add {
            padding: 6px 30px;
            background: linear-gradient(90deg, rgba(2, 188, 177, 1) 0%, rgb(3, 152, 213, 1) 100%);
            border: none;
            border-radius: 35px;
            margin-top: 30px;
            color: #fff;
        }
    </style>
    <div class="common-content">
        <div class="page-content">
      
            <div class="boxings card" style="display:block;">
                <input name="_token" type="hidden" id="token_buyer" value="<?php echo e(csrf_token()); ?>">
                <div class="bxNew collapse" id="collapseThree" data-parent="#accordion" style="display:block;">
                    <form name="add_complaint" id="add_complaint" method="POST"
                        action="<?php echo e(url('buyers/add_complaint')); ?>">
                        <?php echo csrf_field(); ?>
                        <input type="hidden" name="selecttype" id="selecttype">
                        <input type="hidden" name="reg_soldid" id="reg_soldid">
                        <input type="hidden" name="reg_id" id="reg_id">
                        <input type="hidden" name="product_id" id="product_id">
                        <input type="hidden" name="vendor_id" id="vendor_id">
                        <input type="hidden" name="producttype" id="producttype">
                        <div class="row manufacturerlist">
                            <div class="col-lg-8 col-md-5 col-sm-12 col-xs-12 spaDivision">
                                <div class="form-inputs formSer">
                                    <div class="form-group">
                                        <label>Serial Number</label>
                                        <select class="form-control selectmanufacturer invoiceselect"
                                            id="product_complaint" name="product_complaint">
                                            <option value="">Select</option>
                                            <?php $__currentLoopData = $buyerproducts_complaint; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $buyerproducts): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option
                                                    value="<?php echo e($buyerproducts->register_sold_id . '_' . 'invoice' . '_' . $buyerproducts->type . '_' . $buyerproducts->id); ?>">
                                                    <?php echo e($buyerproducts->product_serial_no); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="orCirc divCents">OR</div>
                                <div class="form-inputs formSer">
                                    <div class="form-group barsection">
                                        <label>Barcode</label>
                                        <select class="form-control selectmanufacturer invoiceselect" id="product_barcode"
                                            name="product_barcode">
                                            <option value="">Select</option>
                                            <?php $__currentLoopData = $buyerproducts_complaint; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $buyerproducts): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option
                                                    value="<?php echo e($buyerproducts->register_sold_id . '_' . 'barcode' . '_' . $buyerproducts->type . '_' . $buyerproducts->id); ?>">
                                                    <?php echo e($buyerproducts->barcode); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="department_div" style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Department</label>
                                        <input id="department_name" name="department_name" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <input id="department_complaint" name="department_complaint" type="hidden"
                                class="form-control">
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="pname_div" style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Name</label>
                                        <input id="pname_complaint" name="pname_complaint" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="model_div" style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Model No</label>
                                        <input id="model_no" name="model_no" type="text" class="form-control"
                                            readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="name_complaint_div"
                                style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Name</label>
                                        <input id="name_complaint" name="name_complaint" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="warrenty_complaint_div"
                                style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Warranty Date</label>
                                        <input id="warrenty_complaint" name="warrenty_complaint" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <!--<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="code_complaint_div" style="display:none">
                                    <div class="form-inputs">
                                      <div class="form-group">
                                        <label>Product Code</label>
                                        <input id="code_complaint" name="code_complaint" type="text" class="form-control" readonly>
                                      </div>
                                    </div>
                                </div>-->
                            <!--<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="serail_complaint_div" style="display:none">
                                    <div class="form-inputs">
                                      <div class="form-group">
                                        <label>Manufacturer serial number</label>
                                        <input id="serail_complaint" name="serail_complaint" type="text" class="form-control" readonly>
                                      </div>
                                    </div>
                                </div>-->
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="prd_serail_no_div"
                                style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Invoice Number</label>
                                        <input id="prd_serail_no" name="prd_serail_no" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="discard_complaint_div"
                                style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Discard Date</label>
                                        <input id="discard_complaint" name="discard_complaint" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="preventive_complaint_div"
                                style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Preventive maintenance frequency</label>
                                        <input id="preventive_complaint" name="preventive_complaint" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="rating_complaint_div"
                                style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Criticality rating of the product</label>
                                        <input id="rating_complaint" name="rating_complaint" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="vendor_div" style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Vendor/Manufacturer Name</label>
                                        <input id="vendor_name" name="vendor_name" type="text" class="form-control"
                                            readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="contact_div" style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Contact Name</label>
                                        <input id="contact_name" name="contact_name" type="text" class="form-control"
                                            readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="phone_div" style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Contact Phone Number</label>
                                        <input id="contact_phone" name="contact_phone" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12" id="email_div" style="display:none">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Contact Email</label>
                                        <input id="contact_email" name="contact_email" type="text"
                                            class="form-control" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Complaints</label>
                                        <textarea height="200px" class="form-control" id="complaint_des" name="complaint_des"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row" id="product_status" style="display:none">
                            <div class="col-md-6 certWraper pr_status">
                                <h1 class="amc_title">Product Status</h1>
                                <div class="amc_cmc product-status-r complaint">
                                    <div class="d-flex"> <span>Product warranty </span>
                                        <p>:</p>
                                        <div id="warranty_status"></div>
                                    </div>
                                    <div class="d-flex"> <span>Validation Date </span>
                                        <p>:</p>
                                        <div id="validation_status"></div>
                                    </div>
                                    <div class="d-flex"> <span id="register_maintenance">Maintenance contract </span>
                                        <p id="register_maintenance_p">:</p>
                                        <div id="activated_status"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-12">
                                <div class="green-button">
                                    <button>Submit</button>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-12">
                                <div class="green-button">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div> <!-- boxings end -->

    </div> <!-- Accordion End -->
    <!-- TAB start-->

    </div>
    <!--tab-content End -->
    </div>
    <!--custom-tabs End -->
    </div>
    <!--boxings End -->










    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
    <script src="<?php echo e(URL::to('assets/js/vendor.js')); ?>"></script>
    <script type="text/javascript">
        function prev(regid) {
            window.location.href = 'https://www.meddbot.com/buyers/preventive_card_buyer/' + regid;
        }
        $('#permission_existing').click(function() {
            if ($(this).prop("checked") == true) {
                console.log("Checkbox is checked.");
                $("#documentdiv").css("display", "block");
                $("#renewaldiv").css("display", "block");
                $("#documenteditdiv").css("display", "block");
                $("#renewaleditdiv").css("display", "block");
                $("#expiry_existing_div").css("display", "block");
            } else if ($(this).prop("checked") == false) {
                console.log("Checkbox is unchecked.");
                $("#documenteditdiv").css("display", "none");
                $("#renewaleditdiv").css("display", "none");
                $("#documentdiv").css("display", "none");
                $("#renewaldiv").css("display", "none");
                $("#expiry_existing_div").css("display", "none");
            }
        });
        $(function() {
            $(".invoiceselect").select2();
            $(".invoiceselect1").select2();
        });
        window.baseurl = 'https://www.meddbot.com/';
        $(document).ready(function() {
            $('#gst_no').focusout(function() {
                var gst_no = $('#gst_no').val();
                if ($('#gst_no').val() != "") {
                    var gst_no = $('#gst_no').val();
                    var APP_URL = <?php echo json_encode(url('/getmanufacturedetails_existing')); ?>;
                    var saveData = $.ajax({
                        type: 'GET',
                        url: APP_URL + '/' + gst_no,
                        data: {
                            gst_no: gst_no,
                            _token: '<?php echo e(csrf_token()); ?>'
                        },
                        dataType: "text",
                        success: function(resultData) {
                            //console.log(resultData);
                            var res = JSON.parse(resultData);
                            console.log(res);
                            if (res.gntinfo == 1) {
                                //alert();
                                $('#name').val('');
                                $('#address').val('');
                                $('#zipcode').val('');
                                var name = res.userinfo.name;
                                var address = res.userinfo.address;
                                var zipcode = res.userinfo.zipcode;
                                var userid = res.userinfo.id;
                                $('#name').val(name);
                                $('#address').val(address);
                                $('#zipcode').val(zipcode);
                                $('#usertype').val('in');
                                $('#vendor_existing').val(userid);
                            } else {
                                //alert(' NULL')
                                $('#email').val('');
                                $('#name').val('');
                                $('#address').val('');
                                $('#zipcode').val('');
                                $('#contact_name').val('');
                                $('#contact_phone_no').val('');
                                var APP_URL = <?php echo json_encode(url('/getgstdetails')); ?>;
                                var saveData = $.ajax({
                                    type: 'GET',
                                    url: APP_URL + '/' + gst_no,
                                    data: {
                                        gst_no: gst_no,
                                        _token: '<?php echo e(csrf_token()); ?>'
                                    },
                                    dataType: "text",
                                    success: function(resultData) {
                                        var res = JSON.parse(resultData);
                                        console.log(res);
                                        var name = res.taxpayerInfo.lgnm;
                                        console.log(name);
                                        var dno = res.taxpayerInfo.pradr.addr.bno;
                                        var bnm = res.taxpayerInfo.pradr.addr.bnm;
                                        var st = res.taxpayerInfo.pradr.addr.st;
                                        var loc = res.taxpayerInfo.pradr.addr.loc;
                                        var dst = res.taxpayerInfo.pradr.addr.dst;
                                        var stcd = res.taxpayerInfo.pradr.addr.stcd;
                                        var pncd = res.taxpayerInfo.pradr.addr.pncd;
                                        var address = dno + ',' + bnm + ',' + st +
                                            ',' + loc + ',' + dst + ',' + stcd +
                                            ',' + pncd;
                                        $('#name').val(name);
                                        $('#address').val(address);
                                        $('#zipcode').val(pncd);
                                        $('#usertype').val('out');
                                        $('#vendor_existing').val('');
                                    }
                                });
                            }
                        }
                    });
                    $(".pageloader").show();
                    $(".pageloader").delay(5000).fadeOut("slow");
                }
            });
        });
        $(document).ready(function() {
            $('#table_id').DataTable();
        });
        $('#myModalaction').on('show.bs.modal', function(event) {
            var button = $(event.relatedTarget) // Button that triggered the modal
            var productname = button.data('productname') // Extract info from data-* attributes
            var vendorname = button.data('vendorname') // Extract info from data-* attributes
            var complaint_postdate = button.data('cpostdate') // Extract info from data-* attributes
            var charge_approve = button.data('servicechargeapprove')
            var charge_reject = button.data('servicechargereject')
            var scheduleddate = button.data('scheduleddate')
            var resolveddate = button.data('resolveddate')
            var closeddate = button.data('closeddate')
            $('.vendorval').html(vendorname);
            $('.productnameval').html(productname);
            $('.cpostdateval').html(complaint_postdate);
            if (charge_approve != "") {
                $('.service_acceptval').html(charge_approve);
            } else {
                $(".service_accept").hide();
            }
            if (charge_reject != "") {
                $('.service_rejectval').html(charge_reject);
            } else {
                $(".service_reject").hide();
            }
            if (scheduleddate != "") {
                $('.scheduledval').html(scheduleddate);
            } else {
                $(".scheduled").hide();
            }
            if (resolveddate != "") {
                $('.resolvedval').html(resolveddate);
            } else {
                $(".resolved").hide();
            }
            if (closeddate != "") {
                $('.closeddateval').html(closeddate);
            } else {
                $(".closeddate").hide();
            }
            // Extract info from data-* attributes
        })

        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/asset_management';
                            })
                        }
                    }
                });
            });
        }

        function closecomplaint(complaintid) {
            swal({
                title: "Are you sure want to close?",
                text: "",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "Yes, Closed it!",
                closeOnConfirm: false,
                html: false
            }, function() {
                var data1 = {
                    _token: $('#token_buyer').val(),
                    complaintid: complaintid
                }
                $.ajax({
                    url: baseurl + 'complaint_close',
                    type: "POST",
                    data: data1,
                    success: function(res) {
                        console.log(res);
                        if (res == 1) {
                            swal({
                                title: "",
                                text: "Successfully  Closed!",
                                type: "success",
                                showCancelButton: false,
                                dangerMode: false,
                                confirmButtonText: 'OK'
                            }, function() {
                                window.location = baseurl + 'buyers/asset_management';
                            })
                        }
                    }
                });
            });
        }

        <?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; ?>
        $('#renewal_date').Zebra_DatePicker({
            format: 'd-m-Y',
            direction: 1
        });
        $('#start_date').Zebra_DatePicker({
            format: 'd-m-Y',
            direction: 1
        });
        $('#end_date').Zebra_DatePicker({
            format: 'd-m-Y',
            direction: 1
        });
        $('#expiry_existing').Zebra_DatePicker({
            format: 'd-m-Y'
        });
        $('#waranty_date_existings').Zebra_DatePicker({
            format: 'd-m-Y'
        });
        $('#productdiscarddate_existing').Zebra_DatePicker({
            format: 'd-m-Y'
        });
        $('#product_existing_years').Zebra_DatePicker({
            format: 'd-m-Y'
        });
        $('#validation_date_existing').Zebra_DatePicker({
            format: 'd-m-Y'
        });
        $('#product_new_years').Zebra_DatePicker({
            format: 'd-m-Y'
        });

        function closebar() {
            $('#exampleModal').modal('hide');
        }

        function generatebarcode() {
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "<?php echo e(url('buyers/generate-barcode')); ?>",
                data: {
                    _token: '<?php echo e(csrf_token()); ?>'
                },
                success: function(response) {
                    // console.log(response);
                    if (response.status == true) {
                        swal({
                            title: "",
                            text: "Barcode generated successfully",
                            type: "success",
                        }, function() {
                            $("#barcode_new").val(response.barcode);                 
                            $('.barcodebutton').hide();
                            viewBarcode();
                        });


                    } else {
                        swal({
                            title: "",
                            text: "try again",
                            type: "warning",
                        });
                    }

                },
                error: function(request, status, error) {
                    console.log("ajax call went wrong:" + request.responseText);
                }
            });
        }

        function generatebarcode_existing() {
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "<?php echo e(url('buyers/generate-barcode')); ?>",
                data: {
                    _token: '<?php echo e(csrf_token()); ?>'
                },
                success: function(response) {
                    // console.log(response);
                    if (response.status == true) {
                        swal({
                            title: "",
                            text: "Barcode generated successfully",
                            type: "success",
                        }, function() {
                            $("#barcode_existing").val(response.barcode);
                            $('#generate_existing_div').hide();               
                            viewNewBarcode();
                        });


                    } else {
                        swal({
                            title: "",
                            text: "try again",
                            type: "warning",
                        });
                    }

                },
                error: function(request, status, error) {
                    console.log("ajax call went wrong:" + request.responseText);
                }
            });
        }

        function viewBarcode() {
            var barcode = $("#barcode_new").val();
            $('#exampleModal').modal('show');
            $('#barcode').JsBarcode(barcode, {
                width: 1,
                height: 40
            });
        }

        function viewNewBarcode() {
            var barcode = $("#barcode_existing").val();
            $('#exampleModal').modal('show');
            $('#barcode').JsBarcode(barcode, {
                width: 1,
                height: 40
            });
        }

        $("#printBtn").click(function() {
            var divToPrint = document.getElementById('demo_print');
            var newWin = window.open('', 'Print-Window');
            newWin.document.open();
            newWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</body></html>');
            newWin.document.close();
            setTimeout(function() {
                newWin.close();
            }, 10);
        });
    </script>
    <link rel="stylesheet"
        href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/10.0.0/css/bootstrap-slider.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/10.0.0/bootstrap-slider.min.js"></script>
    <script>
        (function($) {
            $(document).ready(function() {
                $('.input-range').each(function() {
                    var value = $(this).attr('data-slider-value');
                    var separator = value.indexOf(',');
                    if (separator !== -1) {
                        value = value.split(',');
                        value.forEach(function(item, i, arr) {
                            arr[i] = parseFloat(item);
                        });
                    } else {
                        value = parseFloat(value);
                    }
                    $(this).slider({
                        formatter: function(value) {
                            console.log(value);
                            $("#current_value").val(value);
                            //alert(value);
                            return ' ' + value;
                        },
                        min: parseFloat($(this).attr('data-slider-min')),
                        max: parseFloat($(this).attr('data-slider-max')),
                        range: $(this).attr('data-slider-range'),
                        value: value,
                        tooltip_split: $(this).attr('data-slider-tooltip_split'),
                        tooltip: $(this).attr('data-slider-tooltip')
                    });
                });
                $('.input-range1').each(function() {
                    var value = $(this).attr('data-slider-value');
                    var separator = value.indexOf(',');
                    if (separator !== -1) {
                        value = value.split(',');
                        value.forEach(function(item, i, arr) {
                            arr[i] = parseFloat(item);
                        });
                    } else {
                        value = parseFloat(value);
                    }
                    $(this).slider({
                        formatter: function(value) {
                            console.log(value);
                            $("#current_value_new").val(value);
                            //alert(value);
                            return ' ' + value;
                        },
                        min: parseFloat($(this).attr('data-slider-min')),
                        max: parseFloat($(this).attr('data-slider-max')),
                        range: $(this).attr('data-slider-range'),
                        value: value,
                        tooltip_split: $(this).attr('data-slider-tooltip_split'),
                        tooltip: $(this).attr('data-slider-tooltip')
                    });
                });
            });
        })(jQuery);
    </script>
    <script>
        function searchFilters() {
            var $productFilter = $('#productname_filter');
            var $departmentFilter = $('#department_filter_new');
            if ($productFilter.val() == 'all' && $departmentFilter.val() == 'all') {
                $('.js-category-filterable').show();
                $('.js-productname-filterable').show();
            }
            if ($productFilter.val() == 'all' && $departmentFilter.val() != 'all') {
                $('.js-productname-filterable').show();
                $('.js-category-filterable').each(function() {
                    if ($(this).data('category') == $departmentFilter.val()) {
                        $(this).show();
                    } else {
                        $(this).hide();
                    }
                });
            }
            if ($productFilter.val() != 'all' && $departmentFilter.val() == 'all') {
                $('.js-category-filterable').show();
                $('.js-productname-filterable').each(function() {
                    if ($(this).data('productname') == $productFilter.val()) {
                        $(this).show();
                    } else {
                        $(this).hide();
                    }
                });
            }
            if ($productFilter.val() != 'all' && $departmentFilter.val() != 'all') {
                $('.js-productname-filterable').each(function() {
                    if ($(this).data('productname') == $productFilter.val() && $(this).data('category') ==
                        $departmentFilter.val()) {
                        $(this).show();
                    } else {
                        $(this).hide();
                    }
                });
            }
        }
    </script>
<?php $__env->stopSection(); ?>

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