Subversion Repositories SmartDukaan

Rev

Rev 27809 | Rev 27813 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="icon_document_alt"></i>PARTNER ONBOARDING</h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                <li><i class="icon_document_alt"></i>Partner Onboarding</li>
            </ol>
        </div>
    </div>
    <div class="col-lg-6">
        <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal"
                style="font-size:12px; background:#696969;">New
        </button>
        <div id="myModal" class="modal fade" role="dialog">
            <div class="modal-dialog">
                <!-- Modal content-->
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h4 class="modal-title">Modal Header</h4>
                    </div>
                    <div class="modal-body"    style="height: 170px;">
                        <form>
                            <div class="form-row">
                                <div class="form-group col-md-6">
                                    <label for="outLetName1">OutLet Name</label>
                                    <input type="text" class="form-control" id="outLetName1"
                                           placeholder="OutLet Name">
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="number1">Mobile Number</label>
                                    <input type="number" class="form-control" id="number1" placeholder="Mobile Number">
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="acquireddate1">Acquired Date</label>
                                    <input type="date" class="form-control" id="acquireddate1" placeholder="Acquired Date">
                                </div>
                            </div>
                             <div class="form-group col-md-2" style="padding:22px;">
                            <button type="button" class="btn btn-primary" id="newmodal" data-dismiss="modal"
                                    data-backdrop='static' data-keyboard='false'>submit
                            </button>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-default" data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-12">
        <table class="table table-border table-condensed table-bordered" id="example" style="width:100%">

            <thead class="row htable">

            <tr style="color:black;">
                <th>Id</th>
                <th>Created On</th>
                <th>Acquired Date()</th>
                <th>Outlet Name(SM)</th>
                <th>Phone Number(SM)</th>
                <th>City (SM)</th>
                <th>State Head(SM)</th>
                <th>BDM (SM)</th>
                <th>Store Pics(SM)</th>
                <th>Agreed Brand fees(SM)</th>
                <th>Received Brand fees(SM)</th>
                <th>Payment Received(SM)</th>
                <th>Agreed Wallet(SM)</th>
                <th>Investment Date(SM)</th>
                <th>KYC (SM)</th>
                <th>Aadhaar(legal)</th>
                <th>pan(legal)</th>
                <th>GST(legal)</th>
                <th>Cancel cheque(legal)</th>
                <th>Rent agreement/Owner ship proof(legal)</th>
                <th>LOI(legal)</th>
                <th>Code(legal)</th>
                <th>Recee Planed(Kamini)</th>
                <th>Recee Actual(Kamini)</th>
                <th>Designing Planed(Kamini)</th>
                <th>Designing Actual(Kamini)</th>
                <th>Stock payment(kamini)</th>
                <th>Expected Date(kamini)</th>
                <th>Pay Date(Kamini)</th>
                <th>Billing Status(Niranjan)</th>
                <th>Submit</th>
                <th>OutLet Open</th>
                <th>OutLet Reject</th>
            </tr>
            </thead>
            <tbody>
                #foreach($pob in $partnerOnBoardingPanel )
                <tr id="trow2">
                    #if($pob.getId())
                        <td style="background:#87cefa;">$pob.getId()</td>
                    #else
                        <td>$pob.getId()</td>
                    #end
                   
                    #if($pob.getCreatedTimestamp())
                        <td style="background:lime;">$pob.getCreatedTimestamp().format($datehiphenFormatter)</td>
                        #else
                        <td style="background:pink;">
                        </td>
                     #end 
                    
                    
                    #if($pob.getAcquiredDate())
                        <td style="background:lime;"><input type="date" class="acquired" placeholder="Acquired Date(SM)" disabled
                                   name="acquireddate"
                                   value="$pob.getAcquiredDate().format($datehiphenFormatter)"></td>
                    #else
                        <td style="background:pink;"><input type="date" class="acquired" placeholder="Acquired Date(SM)" disabled
                                   name="acquireddate">
                        </td>
                    #end 
                    
                    #if($pob.getOutLetName() && $pob.getOutLetName() != "")
                        <td style="background:lime;"><input type="text" placeholder="OutLet Name" value="$pob.getOutLetName()" name="outlateName"
                                   disabled></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="OutLet Name" name="outlateName" disabled></td>
                    #end
                    #if($pob.getPhoneNumber() && $pob.getPhoneNumber() != 0)
                        <td style="background:lime;">
                        <input type="number" placeholder="9999999999" value="$pob.getPhoneNumber()"
                                   name="phonenumber1"
                                   disabled ></td>
                    #else
                        <td style="background:pink;"><input type="number" placeholder="9999999999" name="phonenumber1" disabled></td>
                    #end

                    #if($pob.getCity() && $pob.getCity() != "")
                        <td style="background:lime;"><input type="text" placeholder="City (SM)" disabled name="city1" value="$pob.getCity()"></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="City (SM)" disabled name="city1"></td>
                    #end
                    #if($pob.getStateHead() && $pob.getStateHead() != "")
                        <td style="background:lime;"><input type="text" placeholder="State Head(SM)" disabled name="shead1"
                                   value="$pob.getStateHead()"></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="State Head(SM)" disabled name="shead1"></td>
                    #end
                    #if($pob.getBDM() && $pob.getBDM() != "")
                        <td style="background:lime;"><input type="text" placeholder="BDM (SM)" disabled name="bdm1" value="$pob.getBDM()"></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="BDM (SM)" disabled name="bdm1"></td>
                    #end
                    #if($pob.getStorePics() && $pob.getStorePics() != 0)
                        <td class="storepics docfile" style="background:lime;"  >
                            <input type="hidden" class="storepicshidden" value="$pob.getStorePics()">
                            <input type="file" class="storepic" placeholder="Store Pics(SM)" disabled name="storepics1"
                                   value="$pob.getStorePics()">
                            ##<button type="button" class="btn btn-primary download-store-file" data-docid="$pob.getStorePics()" data-id="$pob.getId()">download</button>
                            <a href="${rc.contextPath}/download-attachment?documentId=$pob.getStorePics()">Download
                                Doc</a>
                        </td>
                    #else
                        <td class="storepics docfile" style="background:pink;">
                            <input type="hidden">
                            <input type="file" class="storepic" placeholder="Store Pics(SM)" disabled name="storepics1">
                        </td>
                    #end
                    #if($pob.getAgreedBrandFees() != 0)
                        <td style="background:lime;"><input type="text" placeholder="Agreed Brand fees(SM)" disabled name="abrand1"
                                   value="$pob.getAgreedBrandFees()" ></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="Agreed Brand fees(SM)" disabled name="abrand1"></td>
                    #end
                    
                    #if($pob.getReceivedBrandFees()!= 0)

                        <td style="background:lime;"><input type="text" placeholder="Received Brand fees" disabled name="recbrand1"
                                   value="$pob.getReceivedBrandFees()"></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="Received Brand fees" disabled name="recbrand1"></td>
                    #end
                    
                    #if($pob.getPendingPics()  && $pob.getPendingPics() != 0)
                        <td class="pendingpics docfile" style="background:lime">
                            <input type="hidden" class="pendpicshidden" value="$pob.getPendingPics()">
                            <input type="file" class="pendpics" placeholder="pending Pics(SM)" disabled name="pendpics1"
                                   value="$pob.getPendingPics()"/>
                            ##<button type="button" class="btn btn-primary download-pending-file" data-docpid="$pob.getPendingPics()" data-id="$pob.getId()">Download Document</button>
                            <a href="${rc.contextPath}/download-attachment?documentId=$pob.getPendingPics()">Download
                                Doc</a>


                        </td>
                    #else
                        <td class="pendingpics docfile" style="background:pink;">
                            <input type="hidden">
                            <input type="file" placeholder="Pending Pics(SM)" disabled name="pendpics1">
                        </td>
                    #end
                    #if($pob.getAgreedWallet()!= 0)
                        <td style="background:lime;"><input type="text" placeholder="Agreed Wallet(SM)" disabled name="awallet"
                                   value="$pob.getAgreedWallet()" ></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="Agreed Wallet(SM)" disabled name="awallet"></td>
                    #end

                    #if($pob.getInvestmentDate())

                        <td style="background:lime;"><input type="date" placeholder="Investment Date(SM)" disabled name="idate1" id="idate"
                                   value="$pob.getInvestmentDate().format($datehiphenFormatter)"
                                   ></td>
                    #else
                        <td style="background:pink;"><input type="date" placeholder="Investment Date(SM)" disabled name="idate1"></td>
                    #end
                    #if($pob.getKyc() && $pob.getKyc() != 0)
                        <td class="kyc docfile" style="background:lime;">
                            <input type="hidden" class="kychidden" value="$pob.getKyc()">
                            <input type="file" class="kyc" placeholder="KYC (SM)" disabled name="kyc1"
                                   value="$pob.getKyc()">
                            ##<button type="button" class="btn btn-primary download-kyc-file" data-docpid="$pob.getKyc()" data-id="$pob.getId()">Download Document</button>
                            <a href="${rc.contextPath}/download-attachment?documentId=$pob.getKyc()">Download Doc</a>

                        </td>
                    #else
                        <td class="kyc docfile" style="background:pink;">
                            <input type="hidden">
                            <input type="file" id="kyc" placeholder="KYC (SM)" disabled name="kyc1">
                        </td>
                    #end

                    #if($pob.getAadharDoc()  && $pob.getAadharDoc() != 0)
                        <td class="aadhar docfile" style="background:lime;">
                            <input type="hidden" class="aadharhidden" value="$pob.getAadharDoc()">
                            <input type="file" class="aadhar" placeholder="aadhar" disabled name="aadhar1"
                                   value="$pob.getAadharDoc()">
                             <a href="${rc.contextPath}/download-attachment?documentId=$pob.getAadharDoc()">Download
                                Doc</a>

                        </td>
                    #else
                        <td class="aadhar docfile" style="background:pink;">
                            <input type="hidden">
                            <input type="file" class="aadhar" placeholder="aadhar" disabled name="aadhar1">
                        </td>
                    #end
                    #if($pob.getPanDoc() && $pob.getPanDoc() != 0)
                        <td class="pan docfile" style="background:lime;">
                            <input type="hidden" class="panhidden" value="$pob.getPanDoc()">
                            <input type="file" class="pandoc" placeholder="pan(SM)" disabled name="pan1"
                                   value="$pob.getPanDoc()">
                        ##<button type="button" class="btn btn-primary download-pan-file" data-docpid="$pob.getPanDoc()" data-id="$pob.getId()">Download Document</button>
                        <a href="${rc.contextPath}/download-attachment?documentId=$pob.getPanDoc()">Download Doc</a>

                        </td>
                    #else
                        <td class="pan docfile" style="background:pink;">
                            <input type="hidden">
                            <input type="file" class="pandoc" placeholder="pan(SM)" disabled name="pan1">
                        </td>
                    #end
                    #if($pob.getGstdoc()  && $pob.getGstdoc() != 0)
                        <td class="gst docfile" style="background:lime;">
                            <input type="hidden" class="gsthidden" value="$pob.getGstdoc()">
                            <input type="file" class="gstdoc" placeholder="GST(SM)" disabled name="gst1"
                                   value="$pob.getGstdoc()">
                            ##<button type="button" class="btn btn-primary download-gst-file" data-docpid="$pob.getGstdoc()" data-id="$pob.getId()">Download Document</button>
                            <a href="${rc.contextPath}/download-attachment?documentId=$pob.getGstdoc()">Download Doc</a>

                        </td>
                    #else
                        <td class="gst docfile" style="background:pink;">
                            <input type="hidden">
                            <input type="file" class="gstdoc" placeholder="GST(SM)" disabled name="gst1">
                        </td>
                    #end
                    #if($pob.getCancelCheque() && $pob.getCancelCheque() != 0)

                        <td class="cancheque docfile" style="background:lime;">
                            <input type="hidden" class="canchequehidden" value="$pob.getCancelCheque()">
                           <input type="file" class="canchequedoc" placeholder="Cancel cheque(SM)" disabled name="cancheque1"
                            value="$pob.getCancelCheque()">
                            ##<button type="button" class="btn btn-primary download-cancheque-file" data-docpid="$pob.getCancelCheque()" data-id="$pob.getId()">Download Document</button>
                            <a href="${rc.contextPath}/download-attachment?documentId=$pob.getCancelCheque()">Download
                                Doc</a>

                        </td>

                    #else
                        <td class="cancheque docfile" style="background:pink;">
                            <input type="hidden">
                            <input type="file" class="canchequedoc" placeholder="Cancel cheque(SM)" disabled
                                   name="cancheque1">
                        </td>
                    #end
                     #if($pob.getRentAgreement() && $pob.getRentAgreement() != 0)
                        <td class="rent docfile" style="background:lime;">
                            <input type="hidden" class="renthidden" value="$pob.getRentAgreement()">
                            <input type="file" class="rentdoc" placeholder="Rent agreement/Owner ship proof(SM)" disabled name="ragreement1"
                                   value="$pob.getRentAgreement()">
                            <a href="${rc.contextPath}/download-attachment?documentId=$pob.getRentAgreement()">Download Doc</a>
                        </td>
                      #else
                       
                        <td class="rent docfile" style="background:pink;">
                        <input type="hidden">
                        <input type="file" placeholder="Rent agreement/Owner ship proof(SM)" disabled name="ragreement1">
                        </td>
                    #end
                    
                     #if($pob.getLOI() && $pob.getLOI() != 0)
                        <td class="loi docfile" style="background:lime;">
                            <input type="hidden" class="loihidden" value="$pob.getLOI()">
                            <input type="file" class="loidoc" placeholder="LOI(SM)" disabled  value="$pob.getLOI()">
                            <a href="${rc.contextPath}/download-attachment?documentId=$pob.getLOI()">Download Doc</a>
                        </td>
                      #else
                      
                        <td class="loi docfile" style="background:pink;">
                         <input type="hidden">
                        <input type="file" placeholder="LOI(SM)" disabled name="loi1">
                        </td>
                    #end
                    
                   
                   
                    #if($pob.getCode() && $pob.getCode() != "")
                        <td style="background:lime;"><input type="text" placeholder="Code(SM)" disabled name="code1" value="$pob.getCode()"
                                   ></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="Code(SM)" disabled name="code1"></td>
                    #end
                    #if($pob.getReceePlaned())
                        <td style="background:lime;"><input type="date" id="rplaned" placeholder="Recee Planed(Kamini)" disabled name="rplaned1"
                                   value="$pob.getReceePlaned().format($datehiphenFormatter)" >
                        </td>
                    #else
                        <td style="background:pink;"><input type="date" id="rplaned" placeholder="Recee Planed(Kamini)" disabled name="rplaned1">
                        </td>
                    #end
                    #if($pob.getReceeActual())
                        <td style="background:lime;"><input type="date" id="ractual" placeholder="Recee Actual(Kamini)" disabled name="ractual1"
                                   value="$pob.getReceeActual().format($datehiphenFormatter)" >
                        </td>
                    #else
                        <td style="background:pink;"><input type="date" id="ractual" placeholder="Recee Actual(Kamini)" disabled name="ractual1">
                        </td>
                    #end

                    #if($pob.getDesigningPlaned())
                        <td style="background:lime;"><input type="date" id="dplaned" placeholder="Designing Planed(Kamini)" disabled
                                   name="dplaned1"
                                   value="$pob.getDesigningPlaned().format($datehiphenFormatter)"></td>
                    #else
                        <td style="background:pink;"><input type="date" id="dplaned" placeholder="Designing Planed(Kamini)" disabled
                                   name="dplaned1">
                        </td>
                    #end
                    #if($pob.getDesigningActual())
                        <td style="background:lime;"><input type="date" id="dactual" placeholder="Designing Actual(Kamini)" disabled
                                   name="dactual1"
                                   value="$pob.getDesigningActual().format($datehiphenFormatter)"></td>
                    #else
                        <td style="background:pink;"><input type="date" id="dactual" placeholder="Designing Actual(Kamini)" disabled
                                   name="dactual1">
                        </td>
                    #end
                    #if($pob.getStockPayment()!= 0)
                        <td style="background:lime;"><input type="text" placeholder="Stock payment(kamini)" disabled name="spayment1"
                                   value="$pob.getStockPayment()"></td>
                    #else
                        <td style="background:pink;"><input type="text" placeholder="Stock payment(kamini)" disabled name="spayment1""></td>
                    #end

                 
                    
                     #if($pob.getExpectedDate())
                        <td style="background:lime;"><input type="date" class="expdate" placeholder="Expected Date(Kamini)" disabled  value="$pob.getExpectedDate().format($datehiphenFormatter)" >
                        </td>
                    #else
                        <td style="background:pink;"><input type="date" class="expdate" placeholder="Expected Date(Kamini)" disabled>
                        </td>
                    #end

                    #if($pob.getPayDate())
                        <td style="background:lime;">
                          <input type="date" class="paydate" placeholder="pay Date(Kamini)" disabled  value="$pob.getPayDate().format($datehiphenFormatter)"  >
                        </td>
                    #else
                        <td style="background:pink;"><input type="date" class="paydate" placeholder="Pay Date(Kamini)" disabled >
                        </td>
                    #end

                                        <td #if($pob.getBillingStatus()==0) style="background-color:pink"#else style="background-color:lime" #end>
                                                <input type="checkbox" disabled #if($pob.getBillingStatus()>0) checked #end >
                        #if($pob.getBillingStatus()>0) 
                        <label> YES</label>
                        #else
                         <label>NO</label>
                        #end 
                    <td>
                        <button type="submit" form="form1" value="Submit" style="background:blue; color:black;"
                                class="submit1">
                            Submit
                        </button>
                    </td>

                    <td>
                        <button type="submit" form="form2" value="Submit1" data-id="$pob.getId()"
                                style="background:#f18681;"
                                class="delete">open
                        </button>
                    </td>
                    
                    <td>
                        <button type="submit" form="form2" value="SubmitReject" data-id="$pob.getId()"
                                style="background:#f18681;"
                                class="reject">reject
                        </button>
                    </td>

                </tr>
                #end

            </tbody>

        </table>
    </div>
</section>


<script type="text/javascript">


    $(document).ready(function () {
    
    
    $('.submit1').on('click', function () {
            var row = $(this).closest("tr");
            console.log(row);
            
            var data0 = $(row).find("td:eq(0)").text();
            var data1 = $(row).find("td:eq(1)").text();
             if (data1 != "") {
                data1 = data1 + "T00:00:00";
            }
            var data2 = $(row).find("td:eq(2) input[type='date']").val();
            if (data2 != "") {
                data2 = data2 + "T00:00:00";
            }
            var data3 = $(row).find("td:eq(3) input[type='text']").val();
            var data4 = $(row).find("td:eq(4) input[type='number']").val();
            var data5 = $(row).find("td:eq(5) input[type='text']").val();
            var data6 = $(row).find("td:eq(6) input[type='text']").val();
            var data7 = $(row).find("td:eq(7) input[type='text']").val();
            var data8 = $(row).find(".storepics input[type=hidden]").val();
            var data9 = $(row).find("td:eq(9) input[type='text']").val();
            var data10= $(row).find("td:eq(10) input[type='text']").val();
            var data11 = $(row).find(".pendingpics input[type=hidden]").val();
            var data12 = $(row).find("td:eq(12) input[type='text']").val();

            var data13 = $(row).find("td:eq(13) input[type='date']").val();
            if (data13 != "") {
                data13 = data13 + "T00:00:00";
            }
            var data14 = $(row).find(".kyc input[type=hidden]").val();
            var data15 = $(row).find(".aadhar input[type=hidden]").val();
            var data16 = $(row).find(".pan input[type=hidden]").val();
            var data17 = $(row).find(".gst input[type=hidden]").val();
            var data18 = $(row).find(".cancheque input[type=hidden]").val();
            var data19 = $(row).find(".rent input[type=hidden]").val();
            console.log("data17"+data17);
            var data20 = $(row).find(".loi input[type=hidden]").val();
            console.log("data18"+data18);
            var data21 = $(row).find("td:eq(21) input[type='text']").val();
            var data22 = $(row).find("td:eq(22) input[type='date']").val();
            if (data22 != "") {
                data22 = data22 + "T00:00:00";
            }
            var data23 = $(row).find("td:eq(23) input[type='date']").val();
            if (data23 != "") {
                data23 = data23 + "T00:00:00";
            }
            var data24 = $(row).find("td:eq(24) input[type='date']").val();
            if (data24 != "") {
                data24 = data24 + "T00:00:00";
            }
            var data25 = $(row).find("td:eq(25) input[type='date']").val();
            if (data25 != "") {
                data25 = data25 + "T00:00:00";
            }
            var data26 = $(row).find("td:eq(26) input[type='text']").val();
           
             var data27 = $(row).find("td:eq(27) input[type='date']").val();
            if (data27 != "") {
                data27 = data27 + "T00:00:00";
            }
            
             var data28 = $(row).find("td:eq(28) input[type='date']").val();
             
            if (data28 != "") {
                data28 = data28 + "T00:00:00";
            }
            
            
            var data29 = $(row).find("td:eq(29) input[type='checkbox']").is(":checked") ? 1 : 0;

            var prebookingListingObject = {};
            prebookingListingObject['id'] = data0
             prebookingListingObject['createdTimestamp'] = data1
            prebookingListingObject['acquiredDate'] = data2
            prebookingListingObject['outletName'] = data3
            prebookingListingObject['phoneNumber'] = data4
            prebookingListingObject['city'] = data5
            prebookingListingObject['stateHead'] = data6
            prebookingListingObject['bdm'] = data7
            prebookingListingObject['storePics'] = data8
            prebookingListingObject['agreedBrandFees'] = data9
            prebookingListingObject['receivedBrandFees'] = data10
            prebookingListingObject['pendingPics'] = data11
            prebookingListingObject['agreedWallet'] = data12
            prebookingListingObject['investmentDate'] = data13
            prebookingListingObject['kyc'] = data14
            prebookingListingObject['aadharDoc'] = data15
            prebookingListingObject['panDoc'] = data16
            prebookingListingObject['gst'] = data17
            prebookingListingObject['cancelCheque'] = data18
            prebookingListingObject['rentAgreement'] = data19
            prebookingListingObject['loi'] = data20
            prebookingListingObject['code'] = data21
            prebookingListingObject['receePlaned'] = data22
            prebookingListingObject['receeActual'] = data23
            prebookingListingObject['designingPlaned'] = data24
            prebookingListingObject['designingActual'] = data25
            prebookingListingObject['stockPayment'] = data26
            prebookingListingObject['expectedDate'] = data27
            prebookingListingObject['payDate'] = data28
            prebookingListingObject['billingStatus'] = data29

            var jsonObject = JSON.stringify(prebookingListingObject);

            console.log(jsonObject);

            doAjaxRequestWithJsonHandler(
                    context
                    + "/partnerOnBoardingListing",
                    "POST",
                    jsonObject,
                    function (response) {

                        console.log("reponse" + response);
                        if (response == 'true') {
                            alert("successfully submit");
                            panelListing("main-content");
                           
                        }
                    });

        });


        var dtable = $('#example').DataTable(
                {

                    "bPaginate": true,
                    "bLengthChange": true,
                    "bFilter": true,
                    "bInfo": false,
                    "bAutoWidth": false,
                    "scrollX": true,
                 
                   
                });

        

        $('#newmodal').on('click', function () {


            var json = partnerOnBoardingListingJson();
            console.log(json);
            doAjaxRequestWithJsonHandler(
                    context
                    + "/partnerOnBoardingListing",
                    "POST",
                    json,
                    function (response) {

                        console.log("reponse" + response);
                        if (response == 'true') {
                            alert("successfully submit");
                            panelListing("main-content");
                        }

                    });
        });

        $(document).ready(function () {
            var table = $('#example').DataTable();
            $('#example tbody').on('dblclick', 'tr', function () {
                console.log(this);
              
                var data = table.row(this).data();

                $(this).find(":input").attr('disabled', false).show();
                $(this).css("background-color", "#87d3f8");
            });
        });

        $(document).on('input', 'table#example input[type=file]', function () {
            if (confirm('Confirm upload ?')) {
                var fileSelector = $(this)[0];
                if (fileSelector != undefined
                        && fileSelector.files[0] != undefined) {
                    var url = `${context}/document-upload`;
                    console.log(url);
                    var file = this.files[0];
                        let fileInput = $(this);
                    doAjaxUploadRequestHandler(
                            url,
                            'POST',
                            file,
                            function (response) {
                                console.log(response);
                                var documentId = response.response.document_id;
                                console.log("documentId : " + documentId);
                                fileInput.closest('td').find("input[type=hidden]").val(documentId);
                            });
// alert("Retailer Shop Document
// is required");
                }
            } else {
// Do nothing!
            }
        });


        $('.delete').on('click', function () {
            var id = $(this).data('id');
            console.log('helo');
            var id = $(this).data('id');
            console.log(id);
            doPostAjaxRequestHandler(context + "/partnerOnBoardingOpen?id=" + id,
                    function (response) {

                        console.log("reponse" + response);
                        if (response == 'true') {
                            alert("successfully delete");
                            panelListing("main-content");
                        }
                    });

        });
        $('.reject').on('click', function () {
            var id = $(this).data('id');
            console.log('helo');
            var id = $(this).data('id');
            console.log(id);
            doPostAjaxRequestHandler(context + "/partnerOnBoardingReject?id=" + id,
                    function (response) {

                        console.log("reponse" + response);
                        if (response == 'true') {
                            alert("successfully delete");
                            panelListing("main-content");
                        }
                    });

        });
        function partnerOnBoardingListingJson() {
            var prebookingListingObject = {};
            prebookingListingObject['outletName'] = $('#outLetName1').val();
            prebookingListingObject['phoneNumber'] = $('#number1').val();
            acquireddate1 =$('#acquireddate1').val();
            if (acquireddate1 != "") {
                acquireddate1 = acquireddate1 + "T00:00:00";
            }
            
             prebookingListingObject['acquiredDate']=acquireddate1
            return JSON.stringify(prebookingListingObject);
        }


        function panelListing(domId) {
            doAjaxRequestHandler(context + "/partnerOnBoardingPanel", "GET",
                    function (response) {
                        $('#' + domId).html(response);
                    });
        }


    });
</script>