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

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

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

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

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

    input#datepickerinproduction,
    #datepickerinpackage,
    #datepicker {
        border-radius: 30px;
    }
</style>

<?php $__env->startSection('content'); ?>
<?php $printId = 1; ?>
    <div class="common-content">
        <div class="page-content">
            <div class="page-heading">
                <div class="headings">
                    <h6>Purchase Order Summary</h6>
                    <input name="_token" type="hidden" id="token_pbg" value="<?php echo e(csrf_token()); ?>">
                </div>
            </div>
            <div class="dashboard-cnts">
                <div class="row">
                    <div class="col-12">
                      
                        <div class="boxings po-sum" style="border-radius: 15px;">
                       
                            <div class="tab-content meddbot-tabcontent">
                                <div id="home" class="tab-pane fade in active show">
                                    <?php if(count($order_summary_approved) != 0): ?>
                                        <?php $__currentLoopData = $order_summary_approved; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $summary): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <div class="purchase-order js-category-filterable" data-category="<?php echo $summary->individual_buyerid ?>">
                                                <div class="order-id d-flex justify-content-end">
                                                    <h4>Order ID <span class="green-order"><?php echo e($summary->id); ?></span>
                                                    </h4>
                                                </div>
                                                <div class="product_details-grd">
                                                 
                                                    <div class="product-details">
                                                        <ul>
                                                            <li><label class="p-o-label">Tender Number</label>:
                                                                <span><?php echo e($summary->tender_number); ?></span>
                                                            </li>
                                                                                            
                                                            <li><label class="p-o-label">Consignee</label>:
                                                                <span><?php echo e(ucfirst(App\Helpers\CustomHelper::manu_name($summary->individual_buyerid))); ?></span>
                                                            </li>                                                           
                                                            <?php if($summary->main_buyer_type == 'proc'): ?>
                                                            <li><label class="p-o-label">Ship To</label>:
                                                                <span><?php if($summary->ship_to==1): ?>Consignee <?php else: ?> Procurement <?php endif; ?></span>
                                                            </li>
                                                            <?php endif; ?>
                                                        </ul>
                                                    </div>
                                                </div>
                                              
                                                <div class="p-o-buttons">
                                                <?php
                                                    $pbg = App\Helpers\CustomHelper::pbgcount($summary->orderid);
                                                    $sum = App\Helpers\CustomHelper::poproductsum($summary->orderid);
                                                ?>
                                                <?php if($pbg['pbgcount'] == 0): ?>
                                                <button class="btn medd-buttons medd-blue" onclick="addpbg(<?php echo e($summary->orderid); ?>,<?php echo e($summary->main_buyer_id); ?>,'<?php echo e($sum); ?>')">Add PBG</button>
                                                       
                                                <?php elseif($pbg['pbgcount'] == 1): ?>


                                                <button class="btn medd-buttons medd-blue"
                                                    onclick="viewpbg(<?php echo e($pbg['pbgdetails']['id']); ?>)">PBG Details</button>
                                                    <?php if($pbg['pbgdetails']['status'] == 2): ?>
                                                    <button class="btn medd-buttons medd-blue"
                                                        onclick="editpbg(<?php echo e($pbg['pbgdetails']['id']); ?>,<?php echo e($summary->orderid); ?>,'<?php echo e($pbg['pbgdetails']['doc']); ?>',<?php echo e($summary->main_buyer_id); ?>)">Edit
                                                        PBG</button>
                                                    <?php endif; ?>

                                                <?php else: ?>

                                                <?php endif; ?>


                                               
                                                   
                                                    <button class="btn medd-buttons medd-blue"
                                                    onclick="printPdf('<?php echo 'print'.$printId; ?>')">Print PO</button>
                                                <iframe id="<?php echo 'print'.$printId; ?>" style="display: none;" src="<?php echo e(url('assets/pdf/po/file/' . $summary->pdf_file)); ?>"></iframe>
                                                <?php $printId++; ?>
                                                       <a href='<?php echo e(url('assets/pdf/po/file/' . $summary->pdf_file)); ?>' target="_blank"><button class="btn medd-buttons medd-blue"> View &amp; Download PO</button></a>
                                                        <a href='<?php echo e(url('vendors/po_products/' . $summary->orderid)); ?>' target="_blank"> <button class="btn medd-buttons btn-primary"  >View  Products</button></a>
                                                          
                                                    <?php
                                                        $paymentsHistory = App\Helpers\CustomHelper::paymentsHistoryWithOrderId($summary->orderid);
                                                    ?>
                                                    <?php if($paymentsHistory != false): ?>  
                                                    <a href='<?php echo e(url('vendors/payment_history/' . $summary->orderid)); ?>' target="_blank"> <button class="btn medd-buttons btn-primary"  >Payment History</button></a>

                                                    <?php endif; ?>

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

                                        <?php echo e($order_summary_approved->links()); ?>

                                    <?php else: ?>
                                        <div class="col-lg-12 col-md-6 col-sm-12 col-xs-12">
                                            <div class="product-display">
                                                <ul>
                                                    <li>
                                                        <div class="details">
                                                            <div>
                                                                <h6>
                                                                    No Orders available
                                                                </h6>
                                                            </div>
                                                        </div>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    <?php endif; ?>
                                </div>
                        
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal fade  new-modal" id="update-pbg" tabindex="-1" aria-labelledby="exampleModalLabel"
            aria-hidden="true">
            <div class="modal-dialog modal-lg cutom-modal">
                <form id="update_pbg" method="POST" action="<?php echo e(url('vendors/update_pbg')); ?>"
                    enctype="multipart/form-data"> <?php echo csrf_field(); ?>
                    <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">
                                <h5>Update PBG</h5>

                               

                            <div id="pbgedit1">
                                <div class="row pbg-itms" >
                                    <div class="col-lg-6" >
                                        <div class="form-group">
                                            <label>PBG Issue Date <sub>*</sub></label>
                                            <input type="hidden" name="pbgid" id="pbgid">
                                            <input type="hidden" name="po_id" id="po_id">
                                            <input type="hidden" name="filename" id="filename">
                                            <input type="hidden" name="main_buyerid" id="main_buyerid">
                                            <input id="issue_date_edit" name="issue_date_edit"
                                                data-zdp_readonly_element="true" type="text" class="form-control">
                                        </div>
                                        <div class="form-group">
                                            <label>PBG Number <sub>*</sub></label>
                                            <input type="text" class="form-control" name="pbg_number_edit"
                                                id="pbg_number_edit">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>PBG Expiry Date <sub>*</sub></label>
                                            <input id="expiry_date_edit" name="expiry_date_edit"
                                                data-zdp_readonly_element="true" type="text" class="form-control">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div id="pbgedit2">
                                <div class="row pbg-itms gey-section" >
                                    <div class="col-lg-12 p-0 m-0 my-2">
                                        <h5>Bank Details</h5>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Bank Name <sub>*</sub></label>
                                            <select class="form-control" placeholder="select" id="bank_name_edit"
                                                name="bank_name_edit">
                                                <option value=''>Select</option>
                                                <option value="Punjab National Bank">Punjab National Bank</option>
                                                <option value="Indian Bank">Indian Bank</option>
                                                <option value="State Bank of India">State Bank of India</option>
                                                <option value="Canara Bank">Canara Bank</option>
                                                <option value="Union Bank of India">Union Bank of India</option>
                                                <option value="Indian Overseas bank">Indian Overseas bank</option>
                                                <option value="UCO Bank">UCO Bank</option>
                                                <option value="Bank of Maharashtra">Bank of Maharashtra</option>
                                                <option value="Punjab and Sind Bank">Punjab and Sind Bank</option>
                                                <option value="Bank of India">Bank of India</option>
                                                <option value="Central Bank of India">Central Bank of India</option>
                                                <option value="Bank of Baroda">Bank of Baroda</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Branch <sub>*</sub></label>
                                            <input type="text" class="form-control" name="branch_name_edit"
                                                id="branch_name_edit">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 p-0 m-0 my-2">
                                        <h5>Contact Details</h5>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Name <sub>*</sub></label>
                                            <input id="c_name_edit" name="c_name_edit" data-zdp_readonly_element="false"
                                                type="text" class="form-control">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Email <sub>*</sub></label>
                                            <input id="c_email_edit" name="c_email_edit"
                                                data-zdp_readonly_element="false" type="text" class="form-control">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Phone <sub>*</sub></label>
                                            <input id="c_phone_edit" name="c_phone_edit"
                                                data-zdp_readonly_element="false" type="number" minlength="10" maxlength="13" class="form-control">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Country <sub>*</sub></label>
                                            <select class="form-control" placeholder="select" id="country_edit"
                                                name="country_edit">
                                                <option value="101">India</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>State <sub>*</sub></label>
                                            <select class="form-control" placeholder="select" id="state_edit"
                                                name="state_edit">
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-12 p-0 m-0">
                                        <div class="form-group">
                                            <label>Address <sub>*</sub></label>
                                            <textarea class="form-control" rows="5" cols="5" placeholder="address" name="address_edit"
                                                id="address_edit"> </textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                                <div class="row" style="padding: 0px 9px;">
                                    <div class="col-lg-12 m-0 p-0 ">
                                        <div class="container">
                                            <p id="file-list-x1"></p>
                                            <p><a id="file-input-button-x1" href="#"
                                                    class="btn btn-success file-input-button" data-id="x1">
                                                    <!--        <i class="icon-upload-alt"></i>-->
                                                    <i style="font-size: 30px;    color: #929292;"
                                                        class="bi bi-cloud-upload"></i>
                                                    Upload Attachments Here
                                                </a>
                                                <input id="file-input-x1" class="file-input1 visually-hidden"
                                                    type="file" name="doc1" data-id="x1">
                                            </p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="medd-pop-buttons">
                                <button class="btn medd-blue medd-buttons ml-2" type="submit"
                                    style=" margin-right: 10px;">Submit</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
            <div class="modal fade  new-modal" id="pre2" tabindex="-1" aria-labelledby="exampleModalLabel"
            aria-hidden="true">
            <div class="modal-dialog modal-lg cutom-modal">
                <div class="modal-content">
                    <div class="modal-body empty">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <div class="purchase-order purchase-order-no-border">
                            <div class="product_details-grd custom flex-column">
                                <div class="product-details custom" id="pbgdetails">
                                    <h5 class="mb-3">PBG Details</h5>
                                    <div id="pb">
                                    <ul class="custom-details pbg-details-pop">
                                        <li><label class="p-o-label">PBG Issue Date</label>: <span id="issuedate"></span>
                                        </li>
                                        <li><label class="p-o-label">PBG Expiry Date</label>: <span
                                                id="exdate_pbg"></span></li>
                                        <li><label class="p-o-label">PBG Number</label>: <span id="pbgnum"></span></li>
                                    </ul>
                                    <h5 class="bank-details bank-details2">Bank Details</h5>
                                    <ul class="custom-details pbg-details-pop">
                                        <li><label class="p-o-label">Bank Name</label>: <span id="bankname"></span></li>
                                        <li><label class="p-o-label">Branch</label>: <span id="branch"></span></li>
                                        <li><label class="p-o-label">Country</label>: <span id="countryname"></span></li>
                                        <li><label class="p-o-label">State</label>: <span id="statename"></span></li>
                                        <li style="width:100%;"><label class="p-o-label">Address</label>: <span
                                                id="addressname"></span></li>
                                        <li><label class="p-o-label">Contact Name</label>: <span id="cname"></span>
                                        </li>
                                        <li><label class="p-o-label">Contact Email</label>: <span id="cemail"></span>
                                        </li>
                                        <li><label class="p-o-label">Contact Phone</label>: <span id="cphone"></span>
                                        </li>
                                    </ul>
                                  </div>
                                </div>
                                <div class="medd-pop-buttons pt-3" id="docview">
                                </div>
                            </div>
                        </div>
                        <!--
                      <div class="medd-pop-buttons pt-3" id="docview">
                      </div>
            -->
                    </div>
                </div>
            </div>
        </div>






            <div class="modal fade  new-modal" id="add-pbg" tabindex="-1" aria-labelledby="exampleModalLabel"
            aria-hidden="true">
            <div class="modal-dialog modal-lg cutom-modal">
                <form id="save_pbg" method="POST" action="<?php echo e(url('vendors/save_pbg')); ?>"
                    enctype="multipart/form-data"> <?php echo csrf_field(); ?>
                    <div class="modal-content">
                        <div class="modal-body">
                            <button type="button" class="close" onclick="closepbg()">
                                <span aria-hidden="true">&times;</span>
                            </button>
                            <div class="otp">
                                <h5>Add PBG</h5>

                               <div class="p-3" style="disply:none;">

                                  
                                   <label>Add PBG<input type="radio" name="pbgoption" value="1" class="mx-3" checked ></label>
                                   <label> Exempted<input type="radio" name="pbgoption" value="2" class="mx-3" ></label>

                                </div>



                                <div id="pbgoptiondiv" style="display:block;">
                                <div class="row pbg-itms">
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>PBG Issue Date <sub>*</sub></label>
                                            <input id="issue_date" name="issue_date"   data-zdp_readonly_element="true"
                                                type="text" class="form-control">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>PBG Number <sub>*</sub></label>
                                            <input type="text" class="form-control" name="pbg_number"
                                                id="pbg_number">
                                        </div>
                                    </div>
                                </div>
                                <div class="row pbg-itms">
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>PBG Expiry Date <sub>*</sub></label>
                                            <input id="expiry_date" name="expiry_date" data-zdp_readonly_element="true"
                                                type="text" class="form-control">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Price <sub>*</sub></label>
                                            <input id="pbg_price" name="pbg_price" type="text" class="form-control"
                                                readonly>
                                        </div>
                                    </div>
                                </div>
                                <div class="row pbg-itms gey-section">
                                    <div class="col-lg-12 p-0 m-0 my-2">
                                        <h5>Bank Details</h5>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Bank Name <sub>*</sub></label>
                                            <select class="form-control" placeholder="select" id="bank_name"
                                                name="bank_name">
                                                <option value=''>Select</option>
                                                <option value="Punjab National Bank">Punjab National Bank</option>
                                                <option value="Indian Bank">Indian Bank</option>
                                                <option value="State Bank of India">State Bank of India</option>
                                                <option value="Canara Bank">Canara Bank</option>
                                                <option value="Union Bank of India">Union Bank of India</option>
                                                <option value="Indian Overseas bank">Indian Overseas bank</option>
                                                <option value="UCO Bank">UCO Bank</option>
                                                <option value="Bank of Maharashtra">Bank of Maharashtra</option>
                                                <option value="Punjab and Sind Bank">Punjab and Sind Bank</option>
                                                <option value="Bank of India">Bank of India</option>
                                                <option value="Central Bank of India">Central Bank of India</option>
                                                <option value="Bank of Baroda">Bank of Baroda</option>
                                            </select>
                                            <input type="hidden" name="product_id" id="product_id">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Branch <sub>*</sub></label>
                                            <input type="text" class="form-control" name="branch_name"
                                                id="branch_name">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 p-0 m-0 my-2">
                                        <h5>Contact Details</h5>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Name <sub>*</sub></label>
                                            <input type="text" class="form-control" name="c_name" id="c_name">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Email <sub>*</sub></label>
                                            <input type="text" class="form-control" name="c_email" id="c_email">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Phone Number <sub>*</sub></label>
                                            <input type="number" minlength="10" maxlength="13" class="form-control" name="c_phone" id="c_phone">
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>Country <sub>*</sub></label>
                                            <select class="form-control" placeholder="select" id="country"
                                                name="country">
                                                <option value="101">India</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>State <sub>*</sub></label>
                                            <select class="form-control" placeholder="select" id="state"
                                                name="state">
                                                <option value=''>Select</option>
                                                <?php $__currentLoopData = $statelist; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($list->id); ?>"><?php echo e(ucfirst($list->name)); ?>

                                                    </option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-12 p-0 m-0">
                                        <div class="form-group">
                                            <label>Address<sub>*</sub></label>
                                            <textarea class="form-control" rows="5" cols="5" placeholder="address" name="address" id="address"> </textarea>
                                        </div>
                                    </div>
                                </div>

                            </div>
                                <div class="row" style="padding: 0px 9px;">
                                    <div class="col-lg-12 m-0 p-0 ">
                                        <div class="container">
                                            <p id="file-list-x"></p>
                                            <p><a id="file-input-button-x" href="#"
                                                    class="btn btn-success file-input-button" data-id="x">
                                                    <!--        <i class="icon-upload-alt"></i>-->
                                                    <i style="font-size: 30px;    color: #929292;"
                                                        class="bi bi-cloud-upload"></i>
                                                    Upload Attachments Here(.docx,.doc,.pdf)
                                                </a>
                                                <input id="file-input-x"   accept=".docx,.doc,.pdf" class="file-input visually-hidden"
                                                    type="file" name="doc" data-id="x">
                                            </p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="medd-pop-buttons">
                                <input type="hidden" name="orderid" id="orderid" value="">
                                <input type="hidden" name="main_buyer_id" id="main_buyer_id" value="">
                                <button class="btn medd-blue medd-buttons ml-2" type="submit"
                                    style=" margin-right: 10px;">Submit</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    
        <?php $__env->stopSection(); ?>
        <?php $__env->startSection('scripts'); ?>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
        <script src="<?php echo e(URL::to('assets/js/vendorsnew.js')); ?>"></script>
        <script>







            var counter = 1
            $(document).on("click", ".remove", function() {
                $(this).closest('.amcs').remove();
                counter--;
            })

            function addprereq(e) {
                var addoption = '';
                addoption += '<div class="row amcs">';
                addoption += '<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">';
                addoption += '<div class="form-inputs">';
                addoption += '<div class="form-group">';
                addoption += ' <label>Pre-Requisites Item<sub>*</sub></label>';
                addoption += ' <input  type="text" class="form-control" id="prereq' + counter + '" name="prereq[]" value="" >';
                addoption += '</div>';
                addoption += '</div>';
                addoption += '</div>';
                addoption += '<div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">';
                addoption += '<div class="form-inputs">';
                addoption += '<div class="green-button rem">';
                addoption +=
                    '<button class="product-submit remove">Remove<i class="fa fa-minus" aria-hidden="true"></i></button>';
                addoption += '</div>';
                addoption += '</div>';
                addoption += '</div>';
                addoption += '</div>';
                if (counter < 5) {
                    $("#amitems").append(addoption);
                    counter++;
                }
                return false;
            }
            $(function() {
                $('#delivery_date_edit').Zebra_DatePicker({
                    format: 'd-m-Y'
                });
                $('#delivery_date').Zebra_DatePicker({
                    format: 'd-m-Y',
                    direction: 1
                });
                $('#issue_date').Zebra_DatePicker({
                    format: 'd-m-Y',
                    direction:1
                });
                $('#expiry_date').Zebra_DatePicker({
                    format: 'd-m-Y',
                    direction:1
                });
                $('#issue_date_edit').Zebra_DatePicker({
                    format: 'd-m-Y',
                    direction:1
                });
                $('#expiry_date_edit').Zebra_DatePicker({
                    format: 'd-m-Y',
                    direction:1
                });
                $('.file-input1').on('change', function(e) {
                    var file = this.files[0]
                    $("#file-list-x1").html('');
                    $('#file-list-' + $(this).data('id')).append('<span>' + file.name + '</span>')
                })
                $('.file-input-button1').on('click', function(e) {
                    $('#file-input-' + $(this).data('id')).trigger('click');
                })
                $('.file-input').on('change', function(e) {
                    var file = this.files[0]
                    //$("#file-list-x").html('');
                    $('#file-list-' + $(this).data('id')).append('<span>' + file.name + '</span>')
                })
                $('.file-input-button').on('click', function(e) {
                    $('#file-input-' + $(this).data('id')).trigger('click');
                })
            })
        </script>
        <script>
            $('.choosefile').click(function() {
                $('#productcatalouge').click();
            });
            $('.choosefilecertificate').click(function() {
                $('#productcertificate').click();
            });
            $('.choosefilereport').click(function() {
                $('#productperformancereport').click();
            });
            var $disabledResults = $(".js-example-disabled-results");
            $disabledResults.select2();
            <?php if(Session::has('message')): ?>
                swal({
                    title: "",
                    text: "<?php echo e(Session::get('message')); ?>",
                    type: "success",
                    showCancelButton: false,
                    dangerMode: false,
                    confirmButtonText: 'OK',
                });
            <?php endif; ?>
            $('#country').on('change', function() {
                $(".pageloader").show();
                var countryid = this.value;
                var APP_URL = <?php echo json_encode(url('/getstates1')); ?>;
                var saveData = $.ajax({
                    type: 'GET',
                    url: APP_URL + '/' + countryid,
                    data: {
                        countryid: countryid,
                        _token: '<?php echo e(csrf_token()); ?>'
                    },
                    dataType: "text",
                    success: function(resultData) {
                        $("#state").html(resultData);
                        $(".pageloader").hide();
                    }
                });
            });
            $('#country_edit').on('change', function() {
                $(".pageloader").show();
                var countryid = this.value;
                var APP_URL = <?php echo json_encode(url('/getstates1')); ?>;
                var saveData = $.ajax({
                    type: 'GET',
                    url: APP_URL + '/' + countryid,
                    data: {
                        countryid: countryid,
                        _token: '<?php echo e(csrf_token()); ?>'
                    },
                    dataType: "text",
                    success: function(resultData) {
                        $("#state_edit").html(resultData);
                        $(".pageloader").hide();
                    }
                });
            });

            function printChallan(id) {
                var getMyFrame = document.getElementById(id);
                getMyFrame.focus();
                getMyFrame.contentWindow.print();
            }
        </script>
        <script type="text/javascript" charset="utf8"
            src="https://cdnjs.cloudflare.com/ajax/libs/jsbarcode/3.5.9/JsBarcode.all.min.js"></script>
        <script type="text/javascript">

window.baseurl = 'https://www.meddbot.com/';

            function closepbg(){

                window.location = baseurl + 'vendors/add_pbg';

            }

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

            function generatebarcode(data) {
                $('#exampleModal').modal('show');
                $('#barcode').JsBarcode(data, {
                    width: 1,
                    height: 40
                });

            }



            $(document).ready(function() {

                $('input[type=radio][name=pbgoption]').change(function() {

                        if (this.value == '1') {

                            $("#pbgoptiondiv").show();
                        }
                        else{

                            $("#pbgoptiondiv").hide();

                        }
                        
                });


                $('input[type=radio][name=pbgoptionupdate]').change(function() {

                    if (this.value == '1') {

                        $("#pbgedit1").show();
                        $("#pbgedit2").show();
                    }
                    else{

                        $("#pbgedit1").hide();
                        $("#pbgedit2").hide();

                    }

                    });

                $("#doc").on('change', function () {
                
                $('label[for=doc]').hide();

                alert();
           
        });



                    $("#printBtn").click(function() {
                        var divToPrint = document.getElementById('barcodeModal');
                        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);
                    });
                });
                function printPdf(id) {
                    var getMyFrame = document.getElementById(id);
                    getMyFrame.focus();
                    getMyFrame.contentWindow.print();
                }

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


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