<?php $__env->startSection('content'); ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.css" type="text/css">


    <style>
        label.error {
            color: red;
        }

        .newDts .amc_title {
            margin: 7px 0 5px;
        }

        .newDts .amc_details>div {
            margin: 5px 15px 5px 0;
            font-size: 15px;
            text-transform: inherit;
            text-align: center;
        }

        .details-com {
            margin: 20px 0 10px;
        }

        .Register-partner-details .right-panel span.Value {
            width: auto;
        }

        .Register-partner-details span.Tittle {
            width: auto;
            min-width: 260px;
        }

        .newDts .details-rs label {
            font-size: 15px;
        }

        .newDts .form-group {
            margin-bottom: 0;
        }

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

        a.eye i {
            margin-right: 2px;
        }
        .w-100.ml-2 {
    display: flex;
    flex-direction: column;
}
        div#my-video {
    width: 100%;
}
        .row.custom-video {
    margin-right: 0px;
    padding: 10px;
}.row.custom-video .col-lg-6 .Tittle {
    margin-bottom: 10px !important;
    display: flex;
}
      .complaint-img {
    width: 100%;
    display: flex;
    align-items: center;
}  
 .complaint-img.det-images img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 4px solid #fff;
    border-radius: 50%;
} 
   .complaint-img.det-images h6 {
    font-size: 30px !important;
    margin-left: 20px;
    color: #1f2348 !important
}   
      .complaint-img.det-images {
    background: #fdca49;
    border-radius: 10px 10px 0px 0px;
    margin-bottom: 20px;
    padding: 20px;
}  
        
   
    </style>
    <link href="https://vjs.zencdn.net/7.20.3/video-js.css" rel="stylesheet" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.css" type="text/css">
    <div class="common-content">
        <div class="page-content">
            <div class="page-heading">
                <div class="headings">
                    <h6>Product details</h6>
                </div>
            </div>
            <div class="dashboard-cnts">


                <input type="hidden" name="warrantycheck" id="warrantycheck" value="<?php echo e($productdetails->warrenty); ?>">
                <input type="hidden" name="reg_id" id="reg_id" value="<?php echo e($productdetails->registerid); ?>">
                <input name="_token" type="hidden" id="token_buyer" value="<?php echo e(csrf_token()); ?>">
                <input name="soldid" type="hidden" id="soldid" value="<?php echo e($productdetails['id']); ?>">
                <input name="reg_soldtype" type="hidden" id="reg_soldtype" value="<?php echo e($productdetails['type']); ?>">
                <input type="hidden" name="activate_val" id="activate_val" value="<?php echo e($productdetails['activate_val']); ?>">


                <?php if($productdetails['type'] == 'existing'): ?>
                    <input name="product_id" type="hidden" id="product_id"
                        value="<?php echo e($productdetails['existing_product_id']); ?>">
                <?php else: ?>
                    <input name="product_id" type="hidden" id="product_id" value="<?php echo e($productdetails['product_id']); ?>">
                <?php endif; ?>
                <input name="vendor_id" type="hidden" id="vendor_id" value="<?php echo e($productdetails['vendor_id']); ?>">
                <input name="bid_id" type="hidden" id="bid_id" value="<?php echo e($productdetails['bid_id']); ?>">
                <div class="row">
                    <div class="w-100 ml-2">
                        <div class="partner-box partner-box2 Register-partner-box" style="display: block;">
                            <div class="d-flex custom-d">
                                <div class="Register-product-logo" style="margin-right: 0;">
                                    <?php if($productdetails->registertype == 'approve'): ?>
                                        <?php
                                            $pdetails = App\Helpers\CustomHelper::vendorproduct_details($productdetails->product_id);
                                            $photo = $pdetails->photo;
                                        ?>
                                    <?php endif; ?>
                                    <div class="complaint-img det-images">
                                        <?php if(!empty($photo)): ?>
                                            <img src="<?php echo e(url('product_files')); ?>/<?php echo e($photo); ?>">
                                        <?php else: ?>
                                            <img src="<?php echo e(url('assets/images/1200px-No-Image-Placeholder.svg.png')); ?>">
                                        <?php endif; ?>
                                         <?php if($productdetails['type'] == 'existing'): ?>
                                            <h6 style="font-size: 18px; color:#0498d5;">
                                                <?php echo e(ucfirst($productdetails['existingproduct_name'])); ?></h6>
                                        <?php else: ?>
                                            <h6 style="font-size: 18px; color:#0498d5;">
                                                <?php echo e(ucfirst($productdetails['vendor_product_name'])); ?></h6>
                                        <?php endif; ?>
                                    </div>
                                    <?php
                                    $today = date('d-m-Y');
                                    $expiry_validationdate = $productdetails['validation_date'];
                                    ?>
                                </div>
                                <div class="partner-details Register-partner-details d-flex d-flex-custom details-listing"
                                    style="margin-right: 0;">
                                    <div class="prdt-imos">
                                       
                                        <?php if($productdetails['type'] == 'existing'): ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Model No</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Value"><?php echo e($productdetails['product_code_existing']); ?></Span>
                                            </div>
                                        <?php else: ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Model No</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Value"><?php echo e($productdetails['vendor_product_code']); ?></Span>
                                            </div>
                                        <?php endif; ?>
                                        <div class="right-panel">
                                            <Span class="Tittle">Registration No</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['registerid']); ?></Span>
                                        </div>
                                        <?php if($productdetails['type'] == 'existing'): ?>
                                            <?php if($productdetails['vendor_data'] == 'in'): ?>
                                                <div class="right-panel">
                                                    <Span class="Tittle">Vendor/Manufacturer</Span>
                                                    <Span class="Collon">:</Span>
                                                    <Span class="Value"><?php echo e($productdetails['name']); ?></Span>
                                                </div>
                                            <?php endif; ?>
                                        <?php else: ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Vendor/Manufacturer</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Value"><?php echo e($productdetails['name']); ?></Span>
                                            </div>
                                        <?php endif; ?>

                                        <?php if($productdetails['change_vendor_status'] == '1'): ?>
                                        <?php
                                            $udetails = App\Helpers\CustomHelper::userdetails($productdetails['change_vendor']);
                                            $name= $udetails['userdetails']['name'];
                                        ?>
                                       
                                            <div class="right-panel">
                                                <Span class="Tittle">ThirdpartyVendor</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Collon"><?php echo e(ucfirst($name)); ?></Span>
                                                
                                            </div>
                                       
                            
                                    <?php endif; ?>



                                        <div class="right-panel">
                                            <Span class="Tittle">Department Name</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e(ucfirst($productdetails['departmentname'])); ?></Span>
                                        </div>

                                    <?php if($productdetails['product_serial_no']!=''): ?>
                                        <div class="right-panel">
                                            <Span class="Tittle">Serial Number</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['product_serial_no']); ?></Span>
                                        </div>
                                    <?php endif; ?>
                                        <div class="right-panel">
                                            <Span class="Tittle">Additional Information</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['additional_info']); ?></Span>
                                        </div>
                                        <div class="right-panel">
                                            <Span class="Tittle">Product Discard Date</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['product_discard_years']); ?></Span>
                                        </div>
                                        <div class="right-panel">
                                            <Span class="Tittle">Validation Date</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['validation_date']); ?></Span>
                                            <?php if(strtotime($today) > strtotime($expiry_validationdate)): ?>
                                                <span class="amc_activated red">Expired</span>
                                            <?php endif; ?>
                                        </div>
                                        <?php if($productdetails->performancereport): ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Product Performance Report</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Value"><a target="_blank" class="eye"
                                                        href="<?php echo e(url('product_files/' . $productdetails->performancereport)); ?>"><i
                                                            class="fa fa-file" aria-hidden="true"></i> View</a></Span>
                                            </div>
                                        <?php endif; ?>
                                        <?php if($productdetails->certificate): ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Product Certificate</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Value"><a target="_blank" class="eye"
                                                        href="<?php echo e(url('product_files/' . $productdetails->certificate)); ?>"><i
                                                            class="fa fa-file" aria-hidden="true"></i> View</a></Span>
                                            </div>
                                        <?php endif; ?>
                                        <?php if($productdetails->catalogue): ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Product Catalogue</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Value"><a target="_blank" class="eye"
                                                        href="<?php echo e(url('product_files/' . $productdetails->catalogue)); ?>"><i
                                                            class="fa fa-file" aria-hidden="true"></i> View</a></Span>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                    <div class="prdt-imos">
                                        <div class="right-panel">
                                            <Span class="Tittle">Product Warranty Date</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['warrenty']); ?></Span>
                                        </div>
                                        <div class="right-panel">
                                            <Span class="Tittle">Invoice Number</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['invoice_number']); ?></Span>
                                        </div>
                                        <div class="right-panel">
                                            <Span class="Tittle">Preventive Maintenance Frequency</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['preventive_maintenance']); ?></Span>
                                        </div>
                                        <div class="right-panel">
                                            <Span class="Tittle">No. of Days Equipment can be used in a month</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['equipment_month']); ?></Span>
                                        </div>

                                       <div class="right-panel">
                                            <Span class="Tittle">
                                               <?php if($productdetails['equipment_default'] == 'hours'): ?>
                                                    No. of Hours Equipment can be used in a day
                                                <?php else: ?>
                                                    No. of Test Equipment can be used
                                                <?php endif; ?>
                                            </Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['equipment_val']); ?></Span>
                                        </div>
                                        <div class="right-panel">
                                            <Span class="Tittle">Criticality Rating of the Product</Span>
                                            <Span class="Collon">:</Span>
                                            <Span class="Value"><?php echo e($productdetails['current_value']); ?></Span>
                                        </div>
                                        <?php if($productdetails['govmt_permission'] == 1): ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Registration Document</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Value"> <a target="_blank" class="eye"
                                                        href="<?php echo e(url('uploads/document/' . $productdetails['document'])); ?>"><i
                                                            class="fa fa-file" aria-hidden="true"></i> View</a></Span>
                                            </div>
                                            <div class="right-panel">
                                                <Span class="Tittle">Registration Renewal Date</Span>
                                                <Span class="Collon">:</Span>
                                                <Span class="Value"><?php echo e($productdetails['renewal_date']); ?></Span>
                                            </div>
                                        <?php endif; ?>
<!--
                                        <?php if($productdetails->vendor_product_video): ?>
                                            
                                        
                                            <div class="right-panel">
                                                <Span class="Tittle">Product Video</Span>
                                            </div>
                                            <div class="right-panel">
                                                <Span class="Value">
                                                    <video id="my-video" class="video-js" controls preload="auto"
                                                        width="auto" height="300" 
                                                        data-setup="{}">
                                                        <source
                                                            src="<?php echo e(url('product_files/' . $productdetails->vendor_product_video)); ?>"
                                                            type="video/mp4" />
                                                        <p class="vjs-no-js">
                                                            To view this video please enable JavaScript
                                                        </p>
                                                    </video>
                                                </Span>
                                            </div>
                                        <?php endif; ?>
                                        <?php if($productdetails->master_product_video): ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Product Video</Span>
                                            </div>
                                            <div class="right-panel">
                                                <Span class="Value">
                                                    <video id="my-video" class="video-js" controls preload="auto"
                                                        width="auto" height="300" poster="MY_VIDEO_POSTER.jpg"
                                                        data-setup="{}">
                                                        <source
                                                            src="<?php echo e(url('product_files/' . $productdetails->master_product_video)); ?>"
                                                            type="video/mp4" />
                                                        <p class="vjs-no-js">
                                                            To view this video please enable JavaScript
                                                        </p>
                                                    </video>
                                                </Span>
                                            </div>
                                        <?php endif; ?>
-->
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-12">
                                        <div class="green-button d-flex align-items-center ml-3">
                                            <input name="soldid_test" type="hidden" id="soldid_test" value="<?php echo e($productdetails['id']); ?>">
                
                                            <div class="right-panel asd-auto validationclass">
                                    <?php
                                        $daysvalidity = App\Helpers\CustomHelper::dateDiffInDays($today, $expiry_validationdate);
                                    ?>
                                    <?php if (strtotime($today) > strtotime($expiry_validationdate))
										{ ?>
                                    <?php if($productdetails['validation_date_status'] == 0): ?>
                                        <button style="" type="button" class="d-bluebtn newGreenbtn barcodeBtn"
                                            id="validationdate_flow" style="display:block">Sent request for
                                            validation</button>
                                    <?php endif; ?>
                                    <?php
										} ?>
                                    <?php if($daysvalidity == '+0' ||
                                        $daysvalidity == '+1' ||
                                        $daysvalidity == '+2' ||
                                        $daysvalidity == '+3' ||
                                        $daysvalidity == '+4' ||
                                        $daysvalidity == '+5' ||
                                        $daysvalidity == '+6' ||
                                        $daysvalidity == '+7'): ?>
                                        <?php if($productdetails['validation_date_status'] == 0): ?>
                                            <button style="" type="button" class="newGreenbtn barcodeBtn"
                                                id="validationdate_flow" style="display:block">Sent request for
                                                validation</button>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                    <?php if($productdetails['validation_date_status'] == 1): ?>
                                        <span class="amc_activated cmc">Sent Validation Request</span>
                                    <?php elseif($productdetails['validation_date_status'] == 3): ?>
                                        <span class="amc_activated cmc">Validation Date Approved</span>
                                    <?php elseif($productdetails['validation_date_status'] == 4): ?>
                                        <span class="amc_activated rej">Validation Date Rejected</span>
                                    <?php elseif($productdetails['validation_date_status'] == 2): ?>
                                        <div class="row">
                                            <div class="col-md-12 certWraper">
                                                <h1 class="amc_title">Details</h1>
                                                <div class="amc_cmc">
                                                    <span>Validation date
                                                        :<?php echo e($productdetails['validationdate_renew']); ?></span><br>
                                                    <span>Certificate : <a target="_blank" class="eye"
                                                            href="<?php echo e(url('uploads/document/' . $productdetails['validation_certificate_renew'])); ?>"><i
                                                                class="fa fa-eye" aria-hidden="true"></i> View
                                                            Certificate</a></span><br>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="d-flex justify-content-center my-3">
                                            <button type="button" class="newGreenbtn barcodeBtn mr-2" id="generate_new"
                                                onclick="approve_reject_validationdate('Approve')">
                                                Approve
                                            </button>
                                            <button type="button" class="newGreenbtn barcodeBtn" id="generate_new"
                                                onclick="approve_reject_validationdate('Rejected')">
                                                Reject
                                            </button>
                                        </div>
                                    <?php else: ?>
                                    <?php endif; ?>
                                </div>
                                        </div>
                                    </div>
                                </div>
                                <form class="test-itms m-3 row align-items-end p-4" name="register_existing" id="managetest" method="POST" enctype="multipart/form-data"   action="https://www.meddbot.com/buyers/managetest" novalidate="novalidate">
                                    <input name="_token" type="hidden" id="token_po" value="<?php echo e(csrf_token()); ?>">
                                    <input name="registerid"  id="registerid" value="<?php echo e($productdetails['registerid']); ?>" type="hidden" class="form-control">
                                    <input name="soldid_test" type="hidden" id="soldid_test" value="<?php echo e($productdetails['id']); ?>">
                                    <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                        <div class="form-inputs">
                                             <div class="form-group choice-custom">
                                                <label class="mb-3" >Settings<sup>*</sup></label>
                                                <select class="form-control"  name="settings">
                                                  <option value="0" <?php if($productdetails['test_settings']==0): ?> selected="selected" <?php endif; ?> >Sequential</option>
                                                  <option value="1" <?php if($productdetails['test_settings']==1): ?> selected="selected" <?php endif; ?> >Duplicate</option>
                                                </select>
                                            </div>
                                        </div>
                                      </div>
                                    <div class="col-lg-5 col-md-6 col-sm-12 col-xs-12">
                                    <div class="form-inputs">
                                         <div class="form-group choice-custom">
                                            <label class="mb-3" >Test Name<sup>*</sup></label>
                                            <select class="form-control test_used chosen-select" multiple id="test_used_edit" name="test_used_edit[]" required>
                                              <option value="">Select</option>
                                              <?php $__currentLoopData = $testlist; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                              <option value="<?php echo e($list->id); ?>" <?php if(in_array($list->id,$testlist_sold)): ?> selected <?php endif; ?>><?php echo e($list->name); ?><option>
                                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                        </div>
                                    </div>
                                  </div>
                                    <div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">
                                        <div class="green-button d-flex align-items-center mb-2 m-0">
                                            <button class="mr-3" fdprocessedid="bb1lx">Save</button>

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

                            </div>
                            <div class="row custom-video">
                            <div class="col-lg-6">
                                  <?php if($productdetails->vendor_product_video): ?>
                                            
                                        
                                            <div class="right-panel">
                                                <Span class="Tittle">Product Video</Span>
                                            </div>
                                            <div class="right-panel">
                                                <Span class="Value">
                                                    <video id="my-video" class="video-js" controls preload="auto"
                                                        width="auto" height="300" 
                                                        data-setup="{}">
                                                        <source
                                                            src="<?php echo e(url('product_files/' . $productdetails->vendor_product_video)); ?>"
                                                            type="video/mp4" />
                                                        <p class="vjs-no-js">
                                                            To view this video please enable JavaScript
                                                        </p>
                                                    </video>
                                                </Span>
                                            </div>
                                        <?php endif; ?>
                            </div>
                            <div class="col-lg-6">
                                  <?php if($productdetails->master_product_video): ?>
                                            <div class="right-panel">
                                                <Span class="Tittle">Product Video</Span>
                                            </div>
                                            <div class="right-panel">
                                                <Span class="Value">
                                                    <video id="my-video" class="video-js" controls preload="auto"
                                                        width="auto" height="300" poster="MY_VIDEO_POSTER.jpg"
                                                        data-setup="{}">
                                                        <source
                                                            src="<?php echo e(url('product_files/' . $productdetails->master_product_video)); ?>"
                                                            type="video/mp4" />
                                                        <p class="vjs-no-js">
                                                            To view this video please enable JavaScript
                                                        </p>
                                                    </video>
                                                </Span>
                                            </div>
                                        <?php endif; ?>
                            </div>
                        </div>   
                        </div>
                        
                        <!--BOTH CASE START--->
                        <?php if($productdetails['activate_status'] == 0 || $productdetails['activate_status'] == 1): ?>
                            <div class="row">
                                <div class="col-md-6 certWraper">
                                    <h1 class="amc_title">AMC Details</h1>
                                    <div class="amc_cmc">
                                        <span>Validity :<?php echo e($productdetails['amc_validity']); ?></span></br>
                                        <span>Price : <?php echo e($productdetails['amc_price']); ?></span></br>
                                    </div>
                                </div>
                                <div class="col-md-6 certWraper">
                                    <h1 class="amc_title">CMC Details</h1>
                                    <div class="amc_cmc">
                                        <span>Validity :<?php echo e($productdetails['cmc_validity']); ?></span></br>
                                        <span>Price : <?php echo e($productdetails['cmc_price']); ?></span></br>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>
                        <!--BOTH CASE END--->


                        <!--EXISTING CASE START--->
                        <?php if($productdetails['type'] == 'existing'): ?>
                            <div class="row">
                                <div class="col-md-6 certWraper">
                                    <?php
                                    $enddate = $productdetails['activated_enddate'];
                                    $today = date('d-m-Y');
                                    ?>
                                    <?php if(strtotime($today) > strtotime($enddate)): ?>
                                        <h1 class="amc_title"><?php echo strtoupper($productdetails->activate_val); ?> Expired</h1>
                                    <?php else: ?>
                                        <h1 class="amc_title"><?php echo strtoupper($productdetails->activate_val); ?> Activated</h1>
                                    <?php endif; ?>
                                    <div class="amc_cmc">
                                        <div class="amc_details">
                                            <span class="d-flex axcD"><span class="amCd">Start Date</span> :<?php echo e($productdetails['activated_startdate']); ?></span>
                                        </div>
                                        <div class="amc_details">
                                            <span class="d-flex axcD"><span class="amCd">End Date </span> : <?php echo e($productdetails['activated_enddate']); ?></span>
                                        </div>
                                        <div class="amc_details">
                                            <span class="d-flex axcD"><span class="amCd">Price </span> : <?php echo e($productdetails['activated_price']); ?></span>
                                        </div>
                                        <div class="amc_details">
                                            <span class="d-flex axcD"><span class="amCd">Certificate </span>: <a target="_blank" class="eye"
                                                    href="<?php echo e(url('uploads/document/' . $productdetails['activated_certificate'])); ?>"><i
                                                        class="fa fa-eye" aria-hidden="true"></i> View Certificate</a>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <?php if(count($contactinfo) != 0): ?>
                                    <div class="col-md-6 certWraper">
                                        <h1 class="amc_title">Contact Details</h1>
                                        <?php $__currentLoopData = $contactinfo; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <div class="amc_details" style="justify-content: center;">
                                                
                                                <div class="d-flex axcD" ><span class="amCd">Name </span>: <?php echo e($info->name); ?></div>
                                                <div  class="d-flex axcD"  ><span class="amCd">Phone Number </span>: <?php echo e($info->phone); ?></div>
                                                <div  class="d-flex axcD"  ><span class="amCd">Email </span>: <?php echo e($info->email); ?></div>
                                            </div>
                                        
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                <?php endif; ?>
                            </div>
                        <?php endif; ?>
                        <!--EXISTING CASE END--->
                        <!--EXISTING CASE START--->
                        <?php if($productdetails['type'] == 'existing'): ?>
                            <?php
                            $activated_enddate = $productdetails['activated_enddate'];
                            $today = date('d-m-Y');
                            ?>
                            <?php if($productdetails['activate_status'] == 6): ?>
                                <div class="row">
                                    <div class="col-md-6 certWraper">
                                        <h1 class="amc_title">Updated <?php echo strtoupper($productdetails->activate_val); ?> Details</h1>
                                        <div class="amc_cmc">
                                            <div class="amc_details">
                                                <span class="d-flex axcD" ><span class="amCd">Start Date</span><?php echo e($productdetails['renew_startdate']); ?></span>
                                            </div>
                                            <div class="amc_details">
                                                <span class="d-flex axcD"><span class="amCd">End Date </span> :<?php echo e($productdetails['renew_enddate']); ?></span>
                                            </div>
                                            <div class="amc_details">
                                                <span class="d-flex axcD"><span class="amCd">Price </span>: <?php echo e($productdetails['renew_price']); ?></span>
                                            </div>
                                            <div class="amc_details">
                                                <span class="d-flex axcD"><span class="amCd">Certificate </span>: <a target="_blank" class="eye"
                                                        href="<?php echo e(url('uploads/document/' . $productdetails['renew_certificate'])); ?>"><i
                                                            class="fa fa-eye" aria-hidden="true"></i> View Certificate</a>
                                                </span>
                                            </div>
                                            <div class="d-flex justify-content-center my-3">
                                                <button type="button" class="newGreenbtn barcodeBtn mr-2"
                                                    id="generate_new" onclick="approve_reject_renew('Approve')">
                                                    Approve
                                                </button>
                                                <button type="button" class="newGreenbtn barcodeBtn" id="generate_new"
                                                    onclick="approve_reject_renew('Rejected')">
                                                    Reject
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                            <?php endif; ?>
                        <?php endif; ?>
                        <!--EXISTING CASE END--->
                        <!--EXISTING CASE START--->
                        <?php if($productdetails['type'] == 'existing'): ?>
                            <?php if($productdetails['activate_status'] == 2 || $productdetails['activate_status'] == 8): ?>
                                <?php
                                $activated_enddate = $productdetails['activated_enddate'];
                                $today = date('d-m-Y');
                                ?>
                                <?php if(strtotime($today) > strtotime($activated_enddate)): ?>
                                    <button style="margin: 0 auto;" type="button" class="newGreenbtn barcodeBtn"
                                        id="generate_new" style="display:block" onclick="amc_cmc_renew()">
                                        <?php echo 'Renew' . ' ' . strtoupper($productdetails['activate_val']); ?>
                                    </button>
                                <?php endif; ?>
                                <?php
                                    $amcexpired = App\Helpers\CustomHelper::dateDiffInDays($today, $activated_enddate);
                                ?>
                                <?php if($amcexpired == '+0' ||
                                    $amcexpired == '+1' ||
                                    $amcexpired == '+2' ||
                                    $amcexpired == '+3' ||
                                    $amcexpired == '+4' ||
                                    $amcexpired == '+5' ||
                                    $amcexpired == '+6' ||
                                    $amcexpired == '+7'): ?>
                                    <button style="margin: 0 auto;" type="button" class="newGreenbtn barcodeBtn"
                                        id="generate_new" style="display:block" onclick="amc_cmc_renew()">
                                        <?php echo 'Renew' . ' ' . strtoupper($productdetails['activate_val']); ?>
                                    </button>
                                <?php endif; ?>
                            <?php elseif($productdetails['activate_status'] == 5): ?>
                                <span class="amc_activated cmc">Sent <?php echo strtoupper($productdetails['activate_val']) . ' ' . 'renew request'; ?></span>
                            <?php endif; ?>
                        <?php endif; ?>
                        <!--EXISTING CASE END--->
                        <?php if($productdetails['type'] != 'existing'): ?>
                            <?php if($productdetails['activate_status'] == 1 ||
                                $productdetails['activate_status'] == 2 ||
                                $productdetails['activate_status'] == 3 ||
                                $productdetails['activate_status'] == 4 ||
                                $productdetails['activate_status'] == 5 ||
                                $productdetails['activate_status'] == 6 ||
                                $productdetails['activate_status'] == 7 ||
                                $productdetails['activate_status'] == 8): ?>
                                <?php if($productdetails->activated_startdate != ''): ?>
                                    <div class="row">
                                        <div class="col-md-6 certWraper">
                                            <?php if($productdetails['activate_status'] == 2 ||
                                                $productdetails['activate_status'] == 5 ||
                                                $productdetails['activate_status'] == 6 ||
                                                $productdetails['activate_status'] == 7 ||
                                                $productdetails['activate_status'] == 8): ?>
                                                <?php
                                                $enddate = $productdetails['activated_enddate'];
                                                $today = date('d-m-Y');
                                                ?>
                                                <?php if(strtotime($today) > strtotime($enddate)): ?>
                                                    <h1 class="amc_title"><?php echo strtoupper($productdetails->activate_val); ?> Expired</h1>
                                                <?php else: ?>
                                                    <h1 class="amc_title"><?php echo strtoupper($productdetails->activate_val); ?> Activated</h1>
                                                <?php endif; ?>
                                            <?php else: ?>
                                                <h1 class="amc_title"><?php echo strtoupper($productdetails->activate_val); ?> Details</h1>
                                            <?php endif; ?>
                                            <div class="amc_cmc">


                                                <?php if($productdetails['change_vendor_status'] == '1'): ?>
                                                <span class="d-flex axcD"><span class="amCd" >Vendor Name</span> :  <?php echo e(ucfirst($name)); ?></span>
                                                <?php else: ?>
                                               
                                                <?php endif; ?>


                                                <span class="d-flex axcD" ><span class="amCd" >Start Date</span> : <?php echo e($productdetails['activated_startdate']); ?></span>
                                                <span class="d-flex axcD" ><span class="amCd" >End Date</span> : <?php echo e($productdetails['activated_enddate']); ?></span>
                                                <span class="d-flex axcD " ><span class="amCd" >Price</span> :  <?php echo e($productdetails['activated_price']+($productdetails['activated_price']*(12/100))); ?> INR ( Tax <?php echo e(12); ?> %)</span>
                                                <span class="d-flex axcD " ><span class="amCd" >Proposal for <?php echo strtoupper($productdetails->activate_val); ?> </span>:
                                                    <a target="_blank" class="eye"
                                                            href="<?php echo e(url('uploads/document/' . $productdetails['activated_certificate'])); ?>"><i
                                                                class="fa fa-eye" aria-hidden="true"></i> View
                                                            Certificate</a>
                                            </span>
                                            
                                            
                                            
                                                
                                            </div>
                                        </div>
                                    </div>
                                <?php endif; ?>
                            <?php endif; ?>
                            <?php
							$today 			= date("d-m-Y");
							$expiry_date 	= $productdetails['warrenty']; 
							if (($productdetails['activate_status'] == 1) || ($productdetails['activate_status'] == 4)||($productdetails['activate_status'] == 5))
							{ ?>
                            <?php if($productdetails['activate_status'] == 1): ?>
                                <?php if($productdetails['activated_startdate'] == '' && $productdetails['amc_cmc_renew'] == 0): ?>
                                    <span class="amc_activated cmc">Sent <?php echo strtoupper($productdetails['activate_val']) . ' ' . 'activation request'; ?></span>
                                <?php endif; ?>
                            <?php endif; ?>
                            <?php if($productdetails['activate_status'] == 5): ?>
                                <span class="amc_activated cmc">Sent <?php echo strtoupper($productdetails['activate_val']) . ' ' . 'renew request'; ?></span>
                            <?php endif; ?>
                            <?php if($productdetails['activate_status'] == 4): ?>
                                <div class="d-flex justify-content-start my-3">
                                    <button type="button" class="newGreenbtn barcodeBtn mr-2" id="generate_new"
                                        onclick="approve_reject('Approve')">
                                        Approve
                                    </button>
                                    <button type="button" class="newGreenbtn barcodeBtn" id="generate_new"
                                        onclick="approve_reject('Rejected')">
                                        Reject
                                    </button>
                                </div>
                            <?php endif; ?>
                            <?php
				}
			elseif (($productdetails['activate_status'] == 2)||($productdetails['activate_status'] == 8))
			{
						$activated_enddate 	= $productdetails['activated_enddate']; 
						$today 				= date("d-m-Y");
						?>
                            <?php
                                $amcexpired = App\Helpers\CustomHelper::dateDiffInDays($today, $activated_enddate);
                            ?>
                            <?php if($amcexpired == '+0' ||
                                $amcexpired == '+1' ||
                                $amcexpired == '+2' ||
                                $amcexpired == '+3' ||
                                $amcexpired == '+4' ||
                                $amcexpired == '+5' ||
                                $amcexpired == '+6' ||
                                $amcexpired == '+7'): ?>
                                <button style="margin: 0 auto;" type="button" class="newGreenbtn barcodeBtn"
                                    id="generate_new" style="display:block" onclick="amc_cmc_renew()">
                                    <?php echo 'Renew' . ' ' . strtoupper($productdetails['activate_val']); ?>
                                </button>
                            <?php endif; ?>
                            <?php if(strtotime($today) > strtotime($activated_enddate)): ?>
                                <button style="margin: 0 auto;" type="button" class="newGreenbtn barcodeBtn"
                                    id="generate_new" style="display:block" onclick="amc_cmc_renew()">
                                    <?php echo 'Renew' . ' ' . strtoupper($productdetails['activate_val']); ?>
                                </button>
                            <?php endif; ?>
                            <?php
			}
			elseif ($productdetails['activate_status'] == 3)
			{ ?>
                            <span class="amc_activated rej"> <?php echo strtoupper($productdetails['activate_val']) . ' ' . 'Rejected'; ?></span>
                            <?php
			}
			elseif ($productdetails['activate_status'] == 7)
			{ ?>
                            <span class="amc_activated cmc"> <?php echo strtoupper($productdetails['activate_val']) . ' ' . 'Rejected'; ?></span>
                            <?php }
			elseif ($productdetails['activate_status'] == 8)
			{ 
			}
			elseif ($productdetails['activate_status'] == 6)
			{ ?>
                            <div class="row">
                                <div class="col-md-6 certWraper">
                                    <h1 class="amc_title">Updated <?php echo strtoupper($productdetails->activate_val); ?> Details</h1>
                                    <div class="amc_cmc">
                                        <div class="amc_details">
                                            <span class="d-flex axcD "><span class="amCd">Start Date</span> :<?php echo e($productdetails['renew_startdate']); ?></span>
                                        </div>
                                        <div class="amc_details">
                                            <span class="d-flex axcD "><span class="amCd">End Date</span> : <?php echo e($productdetails['renew_enddate']); ?></span>
                                        </div>
                                        <div class="amc_details">
                                            <span class="d-flex axcD "><span class="amCd">Price</span> : <?php echo e($productdetails['renew_price']+($productdetails['renew_price']*(12/100))); ?>

                                             INR ( Tax <?php echo e(12); ?> %)</span>
                                        </div>
                                        <div class="amc_details">
                                            <span class="d-flex axcD "><span class="amCd">Certificate</span> : <a target="_blank" class="eye"
                                                    href="<?php echo e(url('uploads/document/' . $productdetails['renew_certificate'])); ?>"><i
                                                        class="fa fa-eye" aria-hidden="true"></i> View Certificate</a>
                                            </span>
                                        </div>
                                        <div class="d-flex justify-content-start my-3">
                                            <button type="button" class="newGreenbtn barcodeBtn mr-2" id="generate_new"
                                                onclick="approve_reject_renew('Approve')">
                                                Approve
                                            </button>
                                            <button type="button" class="newGreenbtn barcodeBtn" id="generate_new"
                                                onclick="approve_reject_renew('Rejected')">
                                                Reject
                                            </button>
                                        </div>
                                    </div>
                                </div>
                                <?php
			}
			else
			{ 
                $product_warranty = $productdetails['warrenty'];
                $current_date = date('d-m-Y');
           
            ?>
             <?php
             $dayswarrenty = App\Helpers\CustomHelper::dateDiffInDays($current_date, $product_warranty);
             ?>

                <?php if(strtotime($product_warranty) >= strtotime($current_date)): ?> 
                <?php if($dayswarrenty == '+1' || $dayswarrenty == '+2' || $dayswarrenty == '+3' || $dayswarrenty == '+4' || $dayswarrenty == '+5' || $dayswarrenty == '+6' || $dayswarrenty == '+7'): ?> 

                 <div class="d-flex align-items-center mt-3">
                                    <div class="radio-buttons mr-5">
                                        <input class="mr-2" type="radio" id="amc_cmc" name="amc_cmc" value="amc">
                                        <label for="html">Activate AMC</label><br>
                                    </div>
                                    <div class="radio-buttons">
                                        <input class="mr-2" type="radio" id="amc_cmc1" name="amc_cmc" value="cmc">
                                        <label for="css">Activate CMC</label><br>
                                    </div>
                 </div>

                 <?php endif; ?>

                 <?php else: ?>

                 <div class="d-flex align-items-center mt-3">
                    <div class="radio-buttons mr-5">
                        <input class="mr-2" type="radio" id="amc_cmc" name="amc_cmc" value="amc">
                        <label for="html">Activate AMC</label><br>
                    </div>
                    <div class="radio-buttons">
                        <input class="mr-2" type="radio" id="amc_cmc1" name="amc_cmc" value="cmc">
                        <label for="css">Activate CMC</label><br>
                    </div>
                    </div>

                 <?php endif; ?>
                                
                                
        <?php
			}
        ?>
                            </div>
                        <?php endif; ?>
                        <?php
                        $product_warranty = $productdetails['warrenty'];
                        $current_date = date('d-m-Y');
                        $validation_date = $productdetails['validation_date'];
                        $activated_enddate = $productdetails['activated_enddate'];
                        $activate_val = $productdetails['activate_val'];
                        $activate_status = $productdetails['activate_status'];
                        $status_amc = '';
                        $status_amc_val = '';
                        ?>
                        <?php
                            $dayswarrenty = App\Helpers\CustomHelper::dateDiffInDays($current_date, $product_warranty);
                        ?>
                        <?php
                            $daysvalidity = App\Helpers\CustomHelper::dateDiffInDays($current_date, $validation_date);
                        ?>
                        <?php
                            $amcexpired = App\Helpers\CustomHelper::dateDiffInDays($current_date, $activated_enddate);
                        ?>
                        <?php
                        if (strtotime($product_warranty) >= strtotime($current_date)) {
                            if ($dayswarrenty == '+1' || $dayswarrenty == '+2' || $dayswarrenty == '+3' || $dayswarrenty == '+4' || $dayswarrenty == '+5' || $dayswarrenty == '+6' || $dayswarrenty == '+7') {
                                $status_warrenty = '<span class="status red">Warranty About to Expire</span>';
                            } else {
                                $status_warrenty = '<span class="status green">In Warranty</span>';
                            }
                        } else {
                            $status_warrenty = '<span class="status red">Out of Warranty</span>';
                        }
                        if (strtotime($validation_date) >= strtotime($current_date)) {
                            if ($daysvalidity == '+1' || $daysvalidity == '+2' || $daysvalidity == '+3' || $daysvalidity == '+4' || $daysvalidity == '+5' || $daysvalidity == '+6' || $daysvalidity == '+7') {
                                $status_validity = '<span class="status red">Validation date about to expire</span>';
                            } else {
                                $status_validity = '<span class="status green">In Validity</span>';
                            }
                        } else {
                            $status_validity = '<span class="status red">Out of Validity</span>';
                            $validation_date;
                        }
                        if ($activate_status == 0) {
                            if (strtotime($product_warranty) >= strtotime($current_date)) {
                                $status_amc = '';
                                $status_amc_val = '';
                            } else {
                                $status_amc = '<span class="status orange">' . strtoupper($activate_val) . ' ' . 'Contract not activated</span>';
                                $status_amc_val = '';
                            }
                        } elseif ($activate_status == 1) {
                            $status_amc = '<span class="status orange">' . strtoupper($activate_val) . ' ' . 'Contract not activated' . '</span>';
                            $status_amc_val = '';
                        } elseif ($activate_status == 3 || $activate_status == 4) {
                            $status_amc = '<span class="status orange">' . strtoupper($activate_val) . ' ' . 'Pending' . '</span>';
                            $status_amc_val = '';
                        } elseif (strtotime($activated_enddate) >= strtotime($current_date)) {
                            if ($amcexpired == '+0' || $amcexpired == '+1' || $amcexpired == '+2' || $amcexpired == '+3' || $amcexpired == '+4' || $amcexpired == '+5' || $amcexpired == '+6' || $amcexpired == '+7') {
                                $status_amc = '<span class="status red">' . strtoupper($activate_val) . ' ' . 'About to Expire</span>';
                                $status_amc_val = 1;
                            } else {
                                $status_amc = '<span class="status green">' . 'In' . ' ' . strtoupper($activate_val);
                                $status_amc_val = 2;
                            }
                        } else {
                            $status_amc = '<span class="status red">' . strtoupper($activate_val) . ' ' . 'Expired';
                            $status_amc_val = '';
                        }
                        ?>
                        <div class="w-100" id="product_status" style="display:block">
                            <div class=" certWraper product-status-area" style="min-height: inherit !important;">
                                <h1 class="tittles">Product Status</h1>
                                <div class="amc_cmc product-status-r status-new">
                                    <div class="d-flex"> <span>Product warranty </span>
<p>:</p>
                                        <?php if($status_amc_val==2): ?>

                                        <span class="status green"><?php echo e('In' . ' ' . strtoupper($activate_val)); ?>



                                        <?php else: ?>




                                        <?php echo $status_warrenty; ?>
                                        <?php if($status_amc_val == 2): ?>
                                            <span class="status green"><?php echo e('In' . ' ' . strtoupper($activate_val)); ?>

                                            <?php else: ?>
                                        <?php endif; ?>

                                    <?php endif; ?>
                                    </div>
                                    <div class="d-flex"> <span>Validation Date </span>
                                        <p>:</p><?php echo $status_validity; ?>
                                    </div>
                                    <?php if($status_amc != ''): ?>
                                        <div class="d-flex"> <span>Maintenance contract </span>
                                            <p>:</p><?php echo $status_amc; ?>
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                        <!--<div class="col-lg-6"></div>-->
                        <?php $ptype = $productdetails['type']; ?>
                        <div class="details-com newDts row w-100">
                            <?php if($ptype == 'existing'): ?>
                            <?php endif; ?>
                            <div class="d-flex">
                                <?php
                                if ($ptype == 'existing') {
                                    $pid = $productdetails['existing_product_id'];
                                    $type = 'E';
                                } else {
                                    $pid = $productdetails['product_id'];
                                    $type = 'A';
                                }
                                ?>
                                <div class="d-flex ml-2">
                                   
                                
                                </div>

                            </div>
                        </div>


                        <button style="" type="button" class="barcode-n newGreenbtn barcodeBtn mr-3"
                        id="generate_new"
                        onclick="viewBarcode(<?php echo e($productdetails['product_barcode']); ?>)"
                        style="display:block">
                        View Barcode
                    </button>

                        <?php if(strtotime($current_date) > strtotime($product_warranty)): ?> 

                        <?php if(($productdetails['change_vendor_status']==0)||($productdetails['change_vendor_status']==3)): ?>
                      <div class="d-flex justify-content-center w-100">
                           
                            <button type="button" class="newGreenbtn"
                                onclick="$('#changeVendorModal').modal('show')" style="display:block">
                                Change Vendor
                            </button>
                                </div>
                        <?php endif; ?>
               
                 <?php endif; ?>
              
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    <div class="modal fade" id="myModalcontact" role="dialog">
        <div class="modal-dialog ">
            <form name="contactinfo" id="contactinfo" method="POST" action="">
                <?php echo csrf_field(); ?>
                <!-- Modal content-->
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel">Contact Details</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="row manufacturerlist manufacturerlist-rs">
                            <div class="col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Name</label>
                                        <input id="contact_name" name="contact_name" type="text"
                                            class="form-control">
                                        <input id="contact_type" name="type" type="hidden" class="form-control">
                                        <input id="val" name="val" type="hidden" class="form-control">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row manufacturerlist manufacturerlist-rs">
                            <div class="col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Email Id</label>
                                        <input id="contact_email" name="contact_email" type="text"
                                            class="form-control">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row manufacturerlist manufacturerlist-rs">
                            <div class="col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Phone Number</label>
                                        <input id="contact_phone" maxlength="15" name="contact_phone" type="number"
                                            class="form-control">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="submit" class="btn btn-primary sendmessage" id="sendobservation">
                                <?php echo e(__('Send')); ?>

                            </button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- Modal -->
    <!-- Modal -->
    <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog barcodePopup" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">BARCODE</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">
                    <img style="text-align: center;     padding: 48px 2px;   margin: 0 auto;display: block;"
                        width="900" height="500" id="barcode" />
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal" id="closebar">Close</button>
                    <button type="button" id="printBtn" class="btn btn-primary">Print</button>
                </div>
            </div>
        </div>
    </div>

      <!-- Modal -->
      <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="pay_id" id="pay_id_approve" value="">
                      <input type="hidden" name="pay_id" id="order_id_approve" value="">
                      <button class="btn medd-blue medd-buttons" id="otpverify">Verify</button>

                  </div>
              </div>
          </div>
      </div>
  </div>



    <!-- Chnage Vendor Modal -->
    <div class="modal fade" id="changeVendorModal"  role="dialog" aria-labelledby="changeVendorModal"
        aria-hidden="true">
        <div class="modal-dialog barcodePopup" style="    width: 400px;" role="document">
           
                <!-- Modal content-->
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel"> Change Vendor</h5>
                        <button type="button" class="close close_message" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <form name="change_vendor" id="change_vendor" method="POST"
                        action="<?php echo e(url('buyers/change_vendor')); ?>" enctype="multipart/form-data">
                        <?php echo csrf_field(); ?>
                    <div class="modal-body pb-0">
                        <div class="row">
                            <div class="col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
										<h6 class="vendor-name" >Current Vendor: <?php echo e(ucfirst($productdetails['name'])); ?></h6>
                                    </div>
									<div class="form-group">
                                        <label>Select a vendor from list</label>
										
                                        <select class="form-control invoiceselect mb-3" id="vendorid" name="vendorid" required>	
											<?php $__currentLoopData = $vendorlist; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
												<option value="<?php echo e($item->id); ?>" <?php if( $item->id== $productdetails['vendor_id']): ?> selected <?php endif; ?>><?php echo e(ucfirst($item->name)); ?></option>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										</select>
                                        <?php if($productdetails['type'] == 'existing'): ?>
                                            <input name="productid" id="productid" type="hidden"
                                                value="<?php echo e($productdetails['existing_product_id']); ?>">
                                        <?php else: ?>
                                            <input name="productid" id="productid" type="hidden"  value="<?php echo e($productdetails['product_id']); ?>">
                                        <?php endif; ?>
                                        <input name="registerid"  id="registerid" value="<?php echo e($productdetails['registerid']); ?>" type="hidden" class="form-control">
                                        <div class="r-buttons">
                                            <label class="mt-3" >Select Contract Type</label>

                                        <input type="hidden" name="soldid_proposal" id="soldid_proposal" value="">
                                        <div class="d-flex align-items-center mb-3">
                                            <div class="radio-buttons mr-5">
                                                <input class="mr-2" type="radio" id="amc_changevendor1" name="amc_changevendor" value="amc">
                                                <label for="html"> AMC</label><br>
                                            </div>
                                            <div class="radio-buttons">
                                                <input class="mr-2" type="radio" id="amc_changevendor2" name="amc_changevendor" value="cmc">
                                                <label for="css"> CMC</label><br>
                                            </div>
                                            </div>
                                        </div>
                                           
                                                <h5 class=" contact-details-pop" id="exampleModalLabel">Contact Details</h5>
                                                
                                            
                                            
                                                <div class="row manufacturerlist manufacturerlist-rs">
                                                    <div class="col-sm-12 col-xs-12 p-0">
                                                        <div class="form-inputs">
                                                            <div class="form-group">
                                                                <label>Name</label>
                                                                <input id="contact_name_changevendor" name="contact_name_changevendor" type="text"
                                                                    class="form-control">
                                                                <input id="contact_type" name="type" type="hidden" class="form-control">
                                                                <input id="val" name="val" type="hidden" class="form-control">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row manufacturerlist manufacturerlist-rs">
                                                    <div class="col-sm-12 col-xs-12 p-0">
                                                        <div class="">
                                                            <div class="form-group">
                                                                <label>Email Id</label>
                                                                <input id="contact_email_changevendor" name="contact_email_changevendor" type="text"
                                                                    class="form-control">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row manufacturerlist manufacturerlist-rs">
                                                    <div class="col-sm-12 col-xs-12 p-0">
                                                        <div class="">
                                                            <div class="form-group">
                                                                <label>Phone Number</label>
                                                                <input id="contact_phone_changevendor" name="contact_phone_changevendor" type="number"
                                                                    class="form-control" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/^0[^.]/, '0');"  required/>
                                                                
                                                                
                                                                
                                                                
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                         
                                    
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer w-100">
                            <button type="submit" class="btn btn-primary sendmessage">Submit</button>
							
                        </div>
                    </div>

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


    <div class="modal fade  new-modal" id="reject" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog">
          <div class="modal-content">
      
            <form name="reject_request_thirdparty" id="reject_request_thirdparty" method="POST" action="<?php echo e(url('buyers/reject_request_thirdparty')); ?>" > <?php echo csrf_field(); ?>
            <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>Reject Reason</h4>
                  <input type="hidden" name="requestid" value="" id="requestid">
                  <textarea class="w-100 mb-3 form-control" cols="5" rows="5"  placeholder="Reason" name="reject_reason" id="reject_reason"></textarea>
              </div>
                <div class="medd-pop-buttons">
                    <button class="btn medd-blue medd-buttons" >Submit</button>
      <!--              <button class="btn medd-black medd-buttons" >Resend OTP</button>-->
                </div>
            </div>
          </form>
          </div>
        </div>
      </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="https://vjs.zencdn.net/7.20.3/video.min.js"></script> 

<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.jquery.min.js"></script>
<script>
$(function() {
            $(".invoiceselect").select2();
            $(".chosen-select").chosen();
           
});
    

    
var newotp='';

function approve(requestid,register_id){

swal({
      title: "Are you sure  you want to  Approve?",
      text: "",
      type: "warning",
      showCancelButton: true,
      confirmButtonColor: "#DD6B55",
      confirmButtonText: "Yes, Approve it!",
      closeOnConfirm: false,
      html: false
    }, function(){
    $(".pageloader").show();
       
        var data = {
                _token	     :$('#token_buyer').val(),
                requestid    :requestid,
                register_id  :register_id
       
    }
            $.ajax({
                url: 'https://www.meddbot.com/approve_thirdparty',
                type: "POST",
                data: data,
                success: function (res) {

                    console.log(res);

          $(".pageloader").hide();
              
                    swal({
                            title: "",
                            text: "Successfully Approved",
                            type: "success",
                            showCancelButton: false,
                            dangerMode: false,
                            confirmButtonText: 'OK'
                        },function () {
                            window.location = baseurl + 'buyers/registerproduct_details/'+register_id;
                        })
                  
                }
            });
        });

}





function reject(request_id){

$("#requestid").val(request_id);
$("#reject").modal({ backdrop: "static", keyboard: false });

}

$(document).ready(function() {


//Add observation
$("#reject_request_thirdparty").validate({

rules: {
    "reject_reason": {
        required: true
       
    }
},
submitHandler: function(form, e) {
   form.submit();
 }
});

//OTP VERIFICATION

$('#otpverify').on('click', function(event) {
    var pay_id     = $("#pay_id_approve").val();
    var order_id   = $("#order_id_approve").val();

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

           $('#otp1').val('');
            $('#otp2').val('');
            $('#otp3').val('');
            $('#otp4').val('');
            $('#otp5').val('');
            $('#otp6').val('');

        swal("", "Please Enter a valid OTP", "warning");

    }
     else{           
        if(newotp ==otp) {

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

                        var form = $('#change_vendor')[0];
                        var formData = new FormData(form);
                        formData.append('product_id',$("#product_id").val());
                        formData.append('producttype',$("#reg_soldtype").val());
                        formData.append('reg_id',$("#reg_id").val());
                        var data = formData;

                    $.ajax({
                    url: 'https://www.meddbot.com/buyers/changevendor',
                    type: "POST",
                    cache: false,
                    data: data,
                    processData: false,
                    contentType: false,
                    success: function(res) {

                        $("#approve").hide();
                        
                        swal({
							  title: "",
							  text: "Successfully send your request",
							  type: "success",
							  showCancelButton: false,
							  dangerMode: false,
							  confirmButtonText: 'OK'
						  },function () {
							  window.location = baseurl + 'buyers/registerproduct_details/'+$("#reg_id").val();
						  })

                      

                    }
                    });
                });

        }

    }
});
});
$("#change_vendor").validate({

rules: {
    
    "amc_changevendor": {
        required: true
       
    },
    "contact_name_changevendor": {
        required: true
       
    },
    "contact_email_changevendor": {
        required: true
       
    },
    "contact_phone_changevendor": {
        required: true
       
    },
    
},
submitHandler: function(form, e) {
    $(".pageloader").show();

                        var email = $('#email').val();
                        var phoneno = $('#phone_no').val();
                        var otp = Math.floor(100000 + Math.random() * 900000);


                        var SMS_URL = 'https://www.meddbot.com/twiliosms/';
                        var saveData = $.ajax({
                            type: 'POST',
                            url: SMS_URL,
                            data: {
                                phoneno:phoneno,
                                otp: otp,
                                _token: '<?php echo e(csrf_token()); ?>'
                            },
                            dataType: "text",
                            success: function(resultData) {

                              newotp=otp;

                              console.log(newotp);

                                $(".pageloader").hide();

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


        
         $(function() {
            $(".invoiceselect").select2();
            
        });
        $(document).ready(function() {
            $('#table_id').DataTable();
        });
        <?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; ?>
        function generatebarcode() {
            var product = $("#product_existing option:selected").val();
            var Arr = product.split('_');
            var product_id = Arr[0];
            var vendor_id = Arr[1];
            $('#exampleModal').modal('show');
            var barcode = '54321' + ' ' + product_id;
            $('#barcode').JsBarcode(barcode, {
                width: 1,
                height: 40
            });
            $("#barcode_existing").val(barcode);
        }
        function generatebarcode_new(product_id, type) {
            $('#exampleModal').modal('show');
            var barcode = type + '54321' + ' ' + product_id;
            $('#barcode').JsBarcode(barcode, {
                width: 1,
                height: 40
            });
            $("#barcode_new").val(barcode);
        }
        function viewBarcode(barcode) {
            $('#barcode').JsBarcode(barcode, {
                width: 1,
                height: 40
            });
			$('#exampleModal').modal('show');
        }
        $("#printBtn").click(function() {
            var divToPrint = document.getElementById('demo');
            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>
         <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;
          }
        }
      }
        
    
     document.querySelectorAll('.otp-dfle input[type="number"]').forEach(input =>{
         input.oninput = () =>{
             if(input.value.length > input.maxLength) input.value = input.value.slice(0, input.maxLength);
         };
     }) ;  
        
        
        
        
        
        
        
        
        
        
 $(".modal").on('shown.bs.modal', function () {
    $(this).find("#otp1").focus();
});   
        
        
    </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_product_details.blade.php ENDPATH**/ ?>