JezK
Edit File: application.php
<?php include("header.php"); if(isset($_SESSION['bcUserID'])) { $userID = $_SESSION['bcUserID']; include("app/getUserDetailsApp.php"); include("app/getStates.php"); } if(isset($_SESSION['deleteSuccess'])) { echo "<script>alert('Data deleted succesfully.');</script>"; unset($_SESSION['deleteSuccess']); } if(isset($_SESSION['deleteFailed'])) { echo "<script>alert('Error!!! Unable to delete registration details. Internal server error.');</script>"; unset($_SESSION['deleteFailed']); } if(isset($_SESSION['operationsSaveFailed'])) { echo "<script>alert('Error!!! Unable to save operation details. Internal server error.');</script>"; unset($_SESSION['operationsSaveFailed']); } if(isset($_SESSION['operationsUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update operations details. Internal server error.');</script>"; unset($_SESSION['operationsUpdateFailed']); } if(isset($_SESSION['updatePage1Failed'])) { echo "<script>alert('Error!!! Unable to save user details. Internal server error.');</script>"; unset($_SESSION['updatePage1Failed']); } if(isset($_SESSION['projectsSaveFailed'])) { echo "<script>alert('Error!!! Unable to save projects details. Internal server error.');</script>"; unset($_SESSION['projectsSaveFailed']); } if(isset($_SESSION['projectsUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update projects details. Internal server error.');</script>"; unset($_SESSION['projectsUpdateFailed']); } if(isset($_SESSION['fileUploadFailed'])) { echo "<script>alert('Upload Error!!! Unable to upload management files. Internal server error.');</script>"; unset($_SESSION['fileUploadFailed']); } if(isset($_SESSION['kycUploadFailed'])) { echo "<script>alert('Upload Error!!! Unable to upload KYC files. Internal server error.');</script>"; unset($_SESSION['kycUploadFailed']); } if(isset($_SESSION['page3SaveFailed'])) { echo "<script>alert('Error!!! Unable to save user details. Internal server error.');</script>"; unset($_SESSION['page3SaveFailed']); } if(isset($_SESSION['bcManagementSaveFailed'])) { echo "<script>alert('Error!!! Unable to save management details. Internal server error.');</script>"; unset($_SESSION['bcManagementSaveFailed']); } if(isset($_SESSION['bcManagementUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update management details. Internal server error.');</script>"; unset($_SESSION['bcManagementUpdateFailed']); } if(isset($_SESSION['bcCEOSaveFailed'])) { echo "<script>alert('Error!!! Unable to save CEO details. Internal server error.');</script>"; unset($_SESSION['bcCEOSaveFailed']); } if(isset($_SESSION['staffingSaveFailed'])) { echo "<script>alert('Error!!! Unable to save staff details. Internal server error.');</script>"; unset($_SESSION['staffingSaveFailed']); } if(isset($_SESSION['staffingUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update staff details. Internal server error.');</script>"; unset($_SESSION['staffingUpdateFailed']); } if(isset($_SESSION['bcCEOUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update CEO details. Internal server error.');</script>"; unset($_SESSION['bcCEOUpdateFailed']); } if(isset($_SESSION['page4SaveFailed'])) { echo "<script>alert('Error!!! Unable to save user details. Internal server error.');</script>"; unset($_SESSION['page4SaveFailed']); } if(isset($_SESSION['auditUploadFailed'])) { echo "<script>alert('Error!!! Unable to upload audit files. Internal server error.');</script>"; unset($_SESSION['auditUploadFailed']); } if(isset($_SESSION['fileUploadFailed'])) { echo "<script>alert('Error!!! Unable to upload ceo profile files. Internal server error.');</script>"; unset($_SESSION['fileUploadFailed']); } if(isset($_SESSION['bcIncomeSaveFailed'])) { echo "<script>alert('Error!!! Unable to update staff details. Internal server error.');</script>"; unset($_SESSION['bcIncomeSaveFailed']); } if(isset($_SESSION['bcIncomeUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update income details. Internal server error.');</script>"; unset($_SESSION['bcIncomeUpdateFailed']); } if(isset($_SESSION['bcCEOProfileSaveFailed'])) { echo "<script>alert('Error!!! Unable to save ceo profile details. Internal server error.');</script>"; unset($_SESSION['bcCEOProfileSaveFailed']); } if(isset($_SESSION['bcCEOProfileUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update ceo profile details. Internal server error.');</script>"; unset($_SESSION['bcCEOProfileUpdateFailed']); } if(isset($_SESSION['bcMFISaveFailed'])) { echo "<script>alert('Error!!! Unable to save mfi details. Internal server error.');</script>"; unset($_SESSION['bcMFISaveFailed']); } if(isset($_SESSION['bcMFIUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update mfi details. Internal server error.');</script>"; unset($_SESSION['bcMFIUpdateFailed']); } if(isset($_SESSION['fileUploadFailed'])) { echo "<script>alert('Error!!! Unable to upload bank files. Internal server error.');</script>"; unset($_SESSION['fileUploadFailed']); } if(isset($_SESSION['page6SaveFailed'])) { echo "<script>alert('Error!!! Unable to save user details. Internal server error.');</script>"; unset($_SESSION['page6SaveFailed']); } if(isset($_SESSION['partnerSaveFailed'])) { echo "<script>alert('Error!!! Unable to save partner details. Internal server error.');</script>"; unset($_SESSION['partnerSaveFailed']); } if(isset($_SESSION['partnerUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update partner details. Internal server error.');</script>"; unset($_SESSION['partnerUpdateFailed']); } if(isset($_SESSION['proposedSaveFailed'])) { echo "<script>alert('Error!!! Unable to save proposed details. Internal server error.');</script>"; unset($_SESSION['proposedSaveFailed']); } if(isset($_SESSION['proposedUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update proposed details. Internal server error.');</script>"; unset($_SESSION['proposedUpdateFailed']); } //checking if userExpired and userHasRenewal the application $isUserRenewal = $bc->isUserRenewal($_SESSION['bcUserID']); $renewalSubmitted = $bc->isUserRenewalSubmitted($_SESSION['bcUserID']); if($renewalSubmitted) { echo "<script>location.replace('dashboard.php');</script>"; } if(!$isUserExpired && !$isUserRenewal) { echo "<script>location.replace('dashboard.php');</script>"; } if(isset($_SESSION['structuralFileUploadFailed'])) { echo "<script>alert('Error!!! Unable to upload structural file. Internal server error.');</script>"; unset($_SESSION['structuralFileUploadFailed']); } if(isset($_SESSION['structuralFileSaveFailed'])) { echo "<script>alert('Error!!! Unable to save structural file details. Internal server error.');</script>"; unset($_SESSION['structuralFileSaveFailed']); } if(isset($_SESSION['resolutionFileUploadFailed'])) { echo "<script>alert('Error!!! Unable to upload resolution file. Internal server error.');</script>"; unset($_SESSION['resolutionFileUploadFailed']); } if(isset($_SESSION['resolutionFileSaveFailed'])) { echo "<script>alert('Error!!! Unable to save resolution file details. Internal server error.');</script>"; unset($_SESSION['resolutionFileSaveFailed']); } ?> <div style="clear:both;"></div> <div class="container main previewBlock"> <div class="row"> <form action = "app/applicationApp.php" enctype="multipart/form-data" class="form-horizontal col-md-12" method="post" onsubmit="return validateForm()"> <section> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="applicationName">Application for</label> <div> <input type="radio" name="applicationType" id="businessFacilitator" value="1" <?php echo $applicationType1; ?> onclick=onclick="return false"> <label for="businessFacilitator">Business facilitator</label> <input type="radio" name="applicationType" id="businessCorrespondent" value="2" <?php echo $applicationType2; ?> onclick=onclick="return false"> <label for="businessCorrespondent">Business Correspondent</label> </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="applicationName">Name of the Application</label> <div> <input type="text" name="applicationName" id="applicationName" value="<?php echo $applicationName; ?>" class="col-md-4 col-sm-4 col-xs-4" disabled> </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="address" >Address</label> <div > <input type="text" name="appAddress" id="appAddress" value="<?php echo $address; ?>" placeholder="H.no,Street Name" class="col-md-4 col-sm-4 col-xs-4" > </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="city">City/Village Name</label> <div class=""> <input type="text" name="city" id="city" value="<?php echo $city; ?>" placeholder="City" class="col-md-4 col-sm-4 col-xs-4" > </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="state">State</label> <select name="appState" id="appState" class="col-md-4" onchange="getDistricts(this.value)"> <option value="0">Select State</option> <?php echo $states; ?> </select> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="district">District</label> <div class=""> <select name="appDistrict" id="appDistrict" class="col-md-4"> <option value="0">Select District</option> <?php echo $districts; ?> </select> </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="phoneNumber">Phone Number</label> <div class=""> <input type="text" name="mobileNumber" id="mobileNumber" value="<?php echo $mobileNumber; ?>" placeholder="Ex:0123456789" class="col-md-4 col-sm-4 col-xs-4" maxlength="15" onkeypress="return number3(event)"> </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="faxNumber">Fax Number</label> <div class=""> <input type="text" name="fax" id="fax" placeholder="Ex:0123456789" value="<?php echo $fax; ?>" class="col-md-4 col-sm-4 col-xs-4" maxlength="15" onkeypress="return number(event)"> </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="email">Email</label> <div class=""> <input type="text" name="email" id="email" maxlength="256" value="<?php echo $email; ?>" placeholder="abc@gmail.com" class=" col-md-4 col-sm-4 col-xs-4" disabled> </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="website">Website</label> <div class=""> <input type="text" name="website" id="website" value="<?php echo $website; ?>" placeholder="http://www.xyz.com" class="col-md-4 col-sm-4 col-xs-4 " disabled> </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="contactPerson">Contact Person</label> <div class=""> <input type="text" name="contactPerson" id="contactPerson" value="<?php echo $contactPerson; ?>" placeholder="" class="col-md-4 col-sm-4 col-xs-4" > </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="designation">Designation</label> <div class=""> <input type="text" name="appDesignation" id="appDesignation" value="<?php echo $bcDesignation; ?>" placeholder="" class="col-md-4 col-sm-4 col-xs-4" > </div> </div> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="constitution">Constitution</label> <div class=""> <input type="text" name="constitution" id="constitution" class="col-md-4 col-sm-4 col-xs-4" value="<?php echo $constitutionName; ?>" disabled> </div> </div> </section> <section> <div class="col-md-12 removePadding"> <h3 class="subHead">Details Of Registration</h3> </div> <div class="col-md-12 table-responsive removePadding"> <table class="table table-bordered cs-table"> <thead> <tr> <th>Acts unders which registered</th> <th>Date & Place Of Registration</th> <th>Registration Number</th> <th>Validity Period</th> </tr> </thead> <tbody class="input_fields_wrap"> <?php echo $registrationDetailsView; ?> </tbody> </table> </div> </section> <section> <div class=""> <h3 class="subHead ">Activities of the Business Entity</h3> <div class="col-md-12 removePadding"> <textarea style="width:100%" name="appActivity" id="appActivity" rows="7" ><?php echo $bcActivity; ?></textarea> </div> </div> </section> <!--page2--> <section> <div class="col-md-12 removePadding"> <h3 class="subHead col-md-11 col-sm-11 col-xs-11 removePadding">Area of Operation</h3> <input type="button" class="btn btn-default addBtn1 pull-right col-md-1" value="Add New" > </div> <div class="col-md-12 col-sm-12 col-xs-12 input_fields_wrapOPerations"></div> <?php echo $operationsDetails; ?> </section> <section> <div class="col-md-12 col-sm-12 col-xs-12 removePadding"> <h3 class="subHead col-md-11 col-sm-11 col-xs-11 removePadding">Projects Undertaken</h3> <input type="button" class="btn btn-default col-md-1 addBtn2 pull-right" value="Add New" > </div> <div class="col-md-12 col-sm-12 col-xs-12 table-responsive removePadding"> <table class="table table-bordered cs-table table-responsive"> <thead> <tr> <th>S.No</th> <th>Previous Projects</th> <th>Funder</th> <th>Period - Start Date</th> <th>Period - End Date</th> <th>Activity</th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap2"> <?php echo $projectsDetails; ?> </tbody> </table> </div> </section> <section> <div class="col-md-12 removePadding"> <h3 class="subHead">Whether Registered under Foreign Contribution (Regulation) Act, 1976(FCRA)? <input type="radio" name="isFCRA" value="1" id="fcraYes" <?php echo $isFCRA1; ?> > <label for="fcraYes" style="color:black;font-weight:normal;cursor:pointer;">Yes</label> <input type="radio" name="isFCRA" value="0" id="fcraNo" <?php echo $isFCRA2; ?> > <label for="fcraNo" style="color:black;font-weight:normal;cursor:pointer;">No</label> </h3> </div> <?php echo $FCRADisplayDetails; ?> </section> <section> <!--div class="col-md-12 removePadding"> <h3 class="subHead">Whether a *Permanent Account Number (PAN) obtained from Competent Authority? <input type="radio" name="isPAN" value="1" id="panYes" <?php echo $isPAN1; ?> onclick="return false;"> <label for="panYes" style="color:black;font-weight:normal;cursor:pointer;">Yes</label> <input type="radio" name="isPAN" value="0" id="panNo" <?php echo $isPAN2; ?> onclick="return false;"> <label for="panNo" style="color:black;font-weight:normal;cursor:pointer;">No</label> </h3> </div--> <?php echo $PANDisplayDetails; ?> </section> <!--page3--> <section> <div class="col-md-12 removePadding"> <h3 class="subHead col-md-11 removePadding">Name of members of Governing body/Board of trustees/Board of directors/Proprietors/Partners/Authorised Signatories/Principal Share Holders</h3> <input type="button" class="btn btn-default addBtn3 pull-right" value="Add New" > </div> <div class="col-md-12 table-responsive removePadding"> <table class="table table-bordered cs-table table-responsive"> <thead> <tr> <th>Name</th> <th>Designation</th> <th>Date of Appointment</th> <th>Address</th> <th>Educational Qualification</th> <th>Experience in years</th> <th>Experience Details</th> <th>Association with any other institution</th> <th>Relationship with other Board Members</th> <th>Authorize signatory </th> <th style="width:100px;">Board Approval<br> <small> (upload pdf/image only)</small></th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap3"> <?php echo $bcManagementDetails; ?> </tbody> </table> </div> </section> <section> <div class=""> <div class="col-md-12 removePadding"> <h3 class="subHead">Details of the Board meeting held in last three years</h3> </div> <div class="col-md-12 removePadding table-responsive"> <table class="table table-bordered cs-table"> <thead> <tr> <th>Financial Year</th> <th>No. of Board meetings held</th> <th>Average Attendance of members</th> </tr> </thead> <tbody class=""> <tr> <td> <input type="text" name="boardMeetingY3" id="boardMeetingY3" value="<?php echo $previousYear3; ?>" readonly> </td> <td> <input type='text' name="totalBoardMeetingsY3" id="totalBoardMeetingsY3" value="<?php echo $totalBoardMeetingsY3; ?>" placeholder="No. of Board meeting held" > </td> <td> <input type="text" name="Y3Attendance" id="Y3Attendance" value="<?php echo $Y3Attendance; ?>" placeholder="Average Attendance" > </td> </tr> <tr> <td> <input type="text" name="boardMeetingY2" id="boardMeetingY2" value="<?php echo $previousYear2; ?>" readonly> </td> <td> <input type='text' name="totalBoardMeetingsY2" id="totalBoardMeetingsY2" value="<?php echo $totalBoardMeetingsY2; ?>" placeholder="No. of Board meeting held" > </td> <td> <input type="text" name="Y2Attendance" id="Y2Attendance" value="<?php echo $Y2Attendance; ?>" placeholder="Average Attendance" > </td> </tr> <tr> <td> <input type="text" name="boardMeetingY1" id="boardMeetingY1" value="<?php echo $previousYear1; ?>" readonly> </td> <td> <input type='text' name="totalBoardMeetingsY1" id="totalBoardMeetingsY1" value="<?php echo $totalBoardMeetingsY1; ?>" placeholder="No. of Board meeting held" > </td> <td> <input type="text" name="Y1Attendance" id="Y1Attendance" value="<?php echo $Y1Attendance; ?>" placeholder="Average Attendance" > </td> </tr> </tbody> </table> </div> </div> </section> <section> <div class="col-md-12 removePadding"> <h3 class="subHead col-md-11 removePadding">Profile of the C.E.O/ Key Functionary </h3> <input type="button" class="col-md-1 btn btn-default addBtn4 pull-right" value="Add New"> </div> <div class="table-responsive col-md-12 removePadding"> <table class="table table-bordered cs-table table-responsive"> <thead> <tr> <th>Name</th> <th>Designation</th> <th>Qualification</th> <th>Experience in years</th> <th>Date of appointment</th> <th>Association with any other institution</th> <th>Upload KYC photograph<br> <small> (Jpg,jpeg,png,pdf)</small></th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap4"> <?php echo $bcCeoDetails; ?> </tbody> </table> </div> </section> <div style="clear:both;"></div> <!--page4--> <section> <div class="col-md-12 removePadding"> <h3 class="subHead">Please give details of organizational structure/profile</h3> <textarea style="width:100%" name="structuralDetails" id="structuralDetails" rows="7" ><?php echo $structuralDetails;; ?></textarea> <!--<div class="form-group"> <label class="" style="padding:10px 0px 0px 18px;" >File Upload:<br> <small> (upload pdf only)</small></label> <input type="file" name="structuralFile" id="structuralFile" value="" class="browse-o" onchange="ValidateStructuralFileUpload('structuralFile',1,'txtStructureUpload')"> <input type="hidden" value="<?php echo $txtStructureStatus; ?>" id="txtStructureUpload"> <button type="button" class="browse-d">Browse</button> <!--<input type="button" value="Upload" class="uploadBtn" onclick="validatePDF3(4,'structuralFile')"> <div id="uploadStatus1" class="divSuccess"><?php echo $structuralUploadStatus; ?></div> </div>--> </div> </section> <section> <h3 class="subHead col-md-11 removePadding">Staff Details</h3> <input type="button" class="btn btn-default addBtn5 pull-right" value="Add New" > <div class="col-md-12 table-responsive removePadding"> <table class="table table-bordered cs-table table-responsive"> <thead> <tr> <th>Name</th> <th>Designation(Office Staff, Supervisory staff, or Volunteer)</th> <th>Experience in years</th> <th>Date of appointment</th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap5"> <?php echo $staffingDetails; ?> </tbody> </table> </div> </section> <section> <div class=""> <div class="col-md-12 removePadding"> <h3 class="subHead">Financial year staff progress</h3> </div> <div class="col-md-12 removePadding table-responsive"> <table class="table table-bordered cs-table"> <thead> <tr> <th>S. No</th> <th>Total Staff (No.) [A]</th> <th>Staff Left during this year [B]</th> <th>Attrition Rate B/A %</th> </tr> </thead> <tbody class=""> <tr> <td><input type='text' value="<?php echo $financialYear3; ?>" name="financialYear1" id="financialYear1" placeholder="Year" maxlength="4"></td> <td> <input type='text' name="totalStaff1" id="totalFinancialStaff1" value="<?php echo $totalStaff1; ?>" placeholder="" onkeypress="return number(event)" onblur="calculateAttributionRate(1)"> </td> <td> <input type="text" name="staffLeft1" id="staffLeft1" value="<?php echo $staffLeft1; ?>" placeholder="" onkeypress="return number(event)" onblur="calculateAttributionRate(1)"> </td> <td> <input type="text" name="attributionRate1" id="attributionRate1" value="<?php echo $attributionRate1; ?>" placeholder=""> </td> </tr> <tr> <td><input type='text' value="<?php echo $financialYear2; ?>" name="financialYear2" id="financialYear2" placeholder="Year" maxlength="4"></td> <td> <input type='text' name="totalStaff2" id="totalFinancialStaff2" value="<?php echo $totalStaff2; ?>" placeholder="" onkeypress="return number(event)" onblur="calculateAttributionRate(2)"> </td> <td> <input type="text" name="staffLeft2" id="staffLeft2" value="<?php echo $staffLeft2; ?>" placeholder="" onkeypress="return number(event)" onblur="calculateAttributionRate(2)"> </td> <td> <input type="text" name="attributionRate2" id="attributionRate2" value="<?php echo $attributionRate3; ?>" placeholder=""> </td> </tr> <tr> <td><input type='text' value="<?php echo $financialYear1; ?>" name="financialYear3" id="financialYear3" placeholder="Year" maxlength="4"></td> <td> <input type='text' name="totalStaff3" id="totalFinancialStaff3" value="<?php echo $totalStaff3; ?>" placeholder="" onkeypress="return number(event)" onblur="calculateAttributionRate(3)"> </td> <td> <input type="text" name="staffLeft3" id="staffLeft3" value="<?php echo $staffLeft3; ?>" placeholder="" onkeypress="return number(event)" onblur="calculateAttributionRate(3)"> </td> <td> <input type="text" name="attributionRate3" id="attributionRate3" value="<?php echo $attributionRate3; ?>" placeholder=""> </td> </tr> </tbody> </table> </div> </div> </section> <section> <div class="col-md-12 removePadding"> <h3 class="subHead">Details of infrastructure available for the activity:</h3> </div> <div class="table-responsive col-md-12 removePadding"> <table class="table table-bordered cs-table table-responsive"> <thead> <tr> <th>Type of Infrastructure</th> <th>Description</th> <th>Remarks</th> </tr> </thead> <tbody class="input_fields_wrap35"> <tr> <td> Head Office Address </td> <td> <textarea type='text' name="headOfficeDescription" id="headOfficeDescription" placeholder="" ><?php echo $headOfficeDescription; ?></textarea> </td> <td> <textarea type='text' name="headOfficeRemarks" id="headOfficeRemarks" placeholder="" ><?php echo $headOfficeRemarks; ?></textarea> </td> </tr> <tr> <td> Number of field officers </td> <td> <textarea type='text' name="fieldOfficeDescription" id="fieldOfficeDescription" placeholder="" ><?php echo $fieldOfficeDescription; ?></textarea> </td> <td> <textarea type='text' name="fieldOfficeRemarks" id="fieldOfficeRemarks" placeholder="" ><?php echo $fieldOfficeRemarks; ?></textarea> </td> </tr> <tr> <td> Training Center </td> <td> <textarea type='text' name="trainingCenterDescription" id="trainingCenterDescription" placeholder="" ><?php echo $trainingCenterDescription; ?></textarea> </td> <td> <textarea type='text' name="trainingCenterRemarks" id="trainingCenterRemarks" placeholder="" ><?php echo $trainingCenterRemarks; ?></textarea> </td> </tr> <!--<tr> <td> Number of Staff </td> <td> <input type='text' name="numberOfStaff" id="numberOfStaff" value="<?php echo $numberOfStaff; ?>" placeholder="" > </td> <td> <textarea type='text' name="staffRemarks" id="staffRemarks" placeholder="" ><?php echo $staffRemarks; ?></textarea> </td> </tr>--> <tr> <td> How many of them have own vehicles </td> <td> <input type="text" name="vehiclesOwned" id="vehiclesOwned" value="<?php echo $vehiclesOwned; ?>" placeholder="" > </td> <td> <textarea type='text' name="vehiclesRemarks" id="vehiclesRemarks" placeholder="" ><?php echo $vehiclesRemarks; ?></textarea> </td> </tr> <tr> <td> Office Purpose Computers / Laptops </td> <td> <input type="text" name="totalComputers" id="totalComputers" value="<?php echo $totalComputers; ?>" placeholder="" > </td> <td> <textarea type='text' name="computersRemarks" id="computersRemarks" placeholder="" ><?php echo $computersRemarks; ?></textarea> <input type="button" value="Any other" class="btn btn-default newField pull-right" > </td> </tr> <?php echo $otherDetailsView; ?> <!--<tr> <td> <input type="text" name="otherName" id="otherName" value="" placeholder="Any other" > </td> <td> <textarea name="otherDescription" id="otherDescription" placeholder="" ><?php echo $otherDescription; ?></textarea> </td> <td> <textarea type='text' name="otherRemarks" id="otherRemarks" placeholder="" ><?php echo $otherRemarks; ?></textarea> </td> </tr>--> </tbody> </table> </div> </section> <!--page5--> <section> <div class=""> <div class="col-md-12 removePadding"> <h3 class="subHead">Income, Expenditure For Past 3 Years</h3> <!--<input type="button" class="col-md-1 btn btn-default addBtn6 pull-right" value="Add New" >--> </div> <div class="col-md-12 removePadding table-responsive"> <table class="table table-bordered cs-table"> <thead> <tr> <th> Year</th> <th>Total Income<small>(Rs)</small></th> <th>Total Expenditure<small>(Rs)</small></th> <th>Profit Or Loss<small>(Rs)</small></th> <th>upload audit report</th> <!--<th>Action</th>--> </tr> </thead> <tbody class="input_fields_wrap6"> <?php echo $incomeDetails; ?> </tbody> </table> </div> </div> </section> <section> <div class="col-md-12 removePadding"> <h3 class="subHead col-md-11 removePadding ">Particulars of SHGs formed and credit linked</h3> <input type="button" class="col-md-1 btn btn-default addBtn7 pull-right" value="Add New" > </div> <div class="table-responsive col-md-12 removePadding"> <table class="table table-bordered cs-table table-responsive"> <thead> <tr> <th>Year</th> <th>No. of SHGs formed</th> <th>No. of SHG’s adopted</th> <th>No. of SHGs savings Linked</th> <th>No. of SHGs credit Linked</th> <th>Total loan disbursed <small>(Rs)</small></th> <!--<th>Upload<br> <small> (upload pdf only)</small></th>--> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap7"> <?php echo $ceoProfileDetails; ?> </tbody> </table> </div> <div class="form-group col-md-12" style="padding-top:10px;"> <label class="col-md-0">Loyalty List<small></small>:</label> <input type="hidden" value="<?php echo $excelFileStatus; ?>" id="excelUploadStatus"> <input type="file" value="" id="excelFile" name="excelFile" class="browse-o" onchange="ValidateExcelFileUpload()"> <div style="min-width:150px;display:inline-block;"> <button type="button" class="browse-d">Browse</button> <div id="excelFileStatus" class="divSuccess"><?php echo $excelFileUploadStatus; ?></div> </div> <a href="download.php?type=1&file=loyaltiList.xlsx" class="btn btn-default" style="margin-left:20px;">Download Sample Excel Sheet</a> </div> </section> <section> <h3>If already acting as MFI date of commencement of MFI activity <input type="radio" name="isMFI" value="1" id="mfiYes1" <?php echo $isMFI1; ?> onclick="displayMFI(1)"> <label for="mfiYes1" style="color:black;font-weight:normal;cursor:pointer;">Yes</label> <input type="radio" name="isMFI" value="0" id="mfiNo1" <?php echo $isMFI2; ?> onclick="displayMFI(0)"> <label for="mfiNo1" style="color:black;font-weight:normal;cursor:pointer;">No</label> </h3> <div id="mfiActivity" > <!--<input type="button" class="btn btn-default addBtn4 pull-right" value="Add New" >--> <div style="clear:both;"></div> <div class="input_fields_wrapMFI"></div> <!--MFI details--> <div class="input_fields_wrap4"> <div class="form-group"> <label class="col-md-3" for="details" >Date of commencement of operation :</label> <input type="hidden" name="mfiID" id="mfiID" value=""> <div class="input-group date col-md-3" > <input type="text" class="form-control" name="mfiDate" id="mfiDate" placeholder="Date of commencement of operation" value="<?php echo $mfiDate; ?>"> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> <div class="form-group"> <label class="col-md-3" for="details" >H.O Address</label> <div class=""> <textarea name="mfiAddress" id="mfiAddress" class="col-md-3" rows="3"><?php echo $mfiAddress; ?></textarea> </div> </div> <!--<div class="form-group"> <label class="col-md-3" for="activeGroups" >No. of active groups</label> <div class=""> <input type="text" name="mfiTotalActiveGroups" id="mfiTotalActiveGroups" placeholder="" class="col-md-4" onkeypress="return number2(event)" value="<?php echo $mfiTotalActiveGroups; ?>"> </div> </div>--> <div class="form-group"> <label class="col-md-3" for="totalLoanDisbursed" >Total loan amount disbursed (Rs in Lakhs)</label> <div class=""> <input type="text" name="mfiTotalLoan" id="mfiTotalLoan" placeholder="" class="col-md-4" onkeypress="return number2(event)" value="<?php echo $mfiTotalLoan; ?>"> </div> </div> <div class="form-group"> <label class="col-md-3" for="outStanding" >Outstanding amount (Rs in Lakhs) </label> <div class=""> <input type="text" name="mfiOutstanding" id="mfiOutstanding" placeholder="" value="<?php echo $mfiOutstanding; ?>" class="col-md-4" onkeypress="return number2(event)"> </div> </div> <div class="form-group"> <label class="col-md-3" for="outstandingGroups" >Outstanding no of groups </label> <div class=""> <input type="text" name="mfiOutstandingGroups" id="mfiOutstandingGroups" placeholder="" class="col-md-4" value="<?php echo $mfiOutstandingGroups; ?>"> </div> </div> <h3 class="col-md-12 removePadding" for="MFIRating" >Credit Rating of MFI, If any</h3> <div class="table-responsive col-md-12 removePadding"> <table class="table table-bordered cs-table table-responsive"> <thead> <tr> <th>Name of Credit Rating Agency groups</th> <th>Rating Awarded </th> </tr> </thead> <tbody class="input_fields_wrap33"> <tr> <td> <input type="text" name="mfiCreditRatingName" id="mfiCreditRatingName" placeholder="" value="<?php echo $mfiCreditRatingName; ?>"> </td> <td> <input type="text" name="mfiRatingAwarded" id="mfiRatingAwarded" placeholder="" value="<?php echo $mfiRatingAwarded; ?>"> </td> </tr> </tbody> </table> </div> <div class="form-group"> <label class="col-md-3 subHead" for="district">Portfolio at Risk:</label> </div> <div class="table-responsive col-md-12 removePadding"> <table class="table table-bordered cs-table table-responsive"> <thead> <tr> <th>PAR(30-60)</th> <th>PAR(60-90)</th> <th>PAR(>90)</th> </tr> </thead> <tbody class=""> <!--<tr> <td><input type="text" name="mfiNPAAmout30" id="mfiNPAAmout30" placeholder=" " value="<?php echo $mfiNPAAmout30; ?>"></td> <td><input type="text" name="mfiNPAAmout60" id="mfiNPAAmout60" placeholder="" value="<?php echo $mfiNPAAmout60; ?>"></td> <td><input type="text" name="mfiNPAAmout90" id="mfiNPAAmout90" placeholder="" value="<?php echo $mfiNPAAmout90; ?>"></td> </tr>--> <tr> <td> <div style="padding-bottom:10px;"> <label class="col-xs-5">No. Of groups : </label> <input type="text" name="mfiGroups30" id="mfiGroups30" placeholder=" " value="<?php echo $mfiGroups30; ?>" onkeypress="return number2(event)"> </div> <div> <label class="col-xs-5">Amount (₹): </label> <input type="text" name="mfiNPAAmout30" id="mfiNPAAmout30" placeholder=" " value="<?php echo $mfiNPAAmout30; ?>" onkeypress="return number2(event)"> </div> </td> <td> <div style="padding-bottom:10px;"> <label class="col-xs-5">No. Of groups : </label> <input type="text" name="mfiGroups60" id="mfiGroups60" placeholder="" value="<?php echo $mfiGroups60; ?>" onkeypress="return number2(event)"> </div> <div> <label class="col-xs-5">Amount (₹): </label> <input type="text" name="mfiNPAAmout60" id="mfiNPAAmout60" placeholder="" value="<?php echo $mfiNPAAmout60; ?>" onkeypress="return number2(event)"> </div> </td> <td> <div style="padding-bottom:10px;"> <label class="col-xs-5">No. Of groups : </label> <input type="text" name="mfiGroups90" id="mfiGroups90" placeholder="" value="<?php echo $mfiGroups90; ?>" onkeypress="return number2(event)"> </div> <div> <label class="col-xs-5">Amount (₹): </label> <input type="text" name="mfiNPAAmout90" id="mfiNPAAmout90" placeholder="" value="<?php echo $mfiNPAAmout90; ?>" onkeypress="return number2(event)"> </div> </td> </tr> </tbody> </table> </div> <div class="form-group"> <label class="col-md-3" for="repaymentRate" >Repayment % against demand </label> <div class=""> <input type="text" name="mfiRepaymentRate" id="mfiRepaymentRate" placeholder="" class="col-md-4" onkeypress="return number2(event)" value="<?php echo $mfiRepaymentRate; ?>"> </div> </div> <div class="form-group"> <label class="col-md-3" for="totalGroups" >No of groups</label> <div class=""> <input type="text" name="mfiTotalGroups" id="mfiTotalGroups" placeholder=" " onkeypress="return number(event)" value="<?php echo $mfiTotalGroups; ?>"> </div> </div> <h3 class="col-md-11 removePadding">Area of operations</h3> <div class="addressBlock "> <input type="button" class="btn btn-default addAddressBtn pull-right col-md-1" value="Add New" > <?php echo $bcMFIStates; ?> </div> </div> <!--MFI details--> </div> </section> <!--page6--> <section> <div class="col-md-12 col-sm-12 col-xs-12 removePadding"> <h3>Details of experience as Business Correspondent/ Business Facilitator <span class="star">*</span> <input type="radio" name="isFacilitator" value="1" id="facilitatorYes" <?php echo $isFacilitator1; ?> onclick="displayFacilitator(1)"> <label for="facilitatorYes" style="color:black;font-weight:normal;cursor:pointer;">Yes</label> <input type="radio" name="isFacilitator" value="0" id="facilitatorNo" <?php echo $isFacilitator2; ?> onclick="displayFacilitator(0)"> <label for="facilitatorNo" style="color:black;font-weight:normal;cursor:pointer;">No</label> </h3> <div id="facilitatorDiv" style="display:<?php echo $facilitatorDisplay; ?>;"> <textarea style="width:100%" name="bcBfDescription" id="bcBfDescription" rows="7" placeholder=""><?php echo $bcBfDescription; ?></textarea> <!-----------Agencies wrapper start---> <div class="agenciesWrapper removePadding"> <input type="button" class="col-md-1 btn btn-default addAgenciesBtn pull-right " value="Add New" style="margin:10px;"> <?php echo $partnerDetails; ?> </div> <!-----------Agencies wrapper end---> </div> </div> <div class="form-group"> <label class="col-md-10 col-sm-10 col-xs-10" for="dateOfResolution" >Date & Reference of resolution passed by the governing body for applying for empanelment as Business Correspondent / Business Facilitator of NABFINS </label> <div class='input-group col-md-2 col-sm-2 col-xs-2' > <input type='text' class="form-control" name="facilitatorDate" id="facilitatorDate" value="<?php echo $facilitatorDate; ?>" placeholder="" readonly> </div> </div> <div class="form-group"> <label class="col-md-2 labelPadding" >Upload resolution :<br> <small> (upload pdf/image only)</small></label> <input type="file" name="resolutionFile" id="resolutionFile" value="" class="browse-o" onchange="ValidateStructuralFileUpload('resolutionFile',2,'txtResolutionUpload')"> <input type="hidden" value="<?php echo $txtResolutionStatus; ?>" id="txtResolutionUpload"> <button type="button" class="browse-d">Browse</button> <!--<input type="button" value="Upload" class="uploadBtn" onclick="validatePDF3(3,'resolutionFile')">--> <div id="uploadStatus2" class="divSuccess"><?php echo $resolutionFileUploadStatus; ?></div> </div> <h3 class="col-md-11 removePadding">Proposed Area/ Villages proposed to be covered</h3> <div class="col-md-1"><input type="button" class="btn btn-default addNewBtn text-right" value="Add New" ></div> <div class="inputWrapper"> </div> <?php echo $proposedDetails; ?> <div class="form-group"> <label class="col-md-3 col-sm-3 col-xs-3" for="proposedActivities">Details of services / activities proposed to be rendered to NABFINS</label> <div class=""> <input type="text" name="proposedActivities" id="proposedActivities" class="col-md-4 col-sm-4 col-xs-4" value="<?php echo $proposedActivity; ?>" disabled> </div> </div> </div> </section> <div class="text-center col-md-12"> <a href="dashboard.php"><input type="button" value="Back" class="btn btn-cs"></a> <input type="submit" value="Next" class="btn btn-cs"> </div> </form> </div> </div> <script> $(document).ready(function() { isMFI = '<?php echo $isMFI; ?>'; displayMFI(isMFI); }); $(document).ready(function() { }); pdfFlag2 = 0; pdfFlag = 0; $(".browse-d").click(function(){ $(this).parents(".form-group").find('.browse-o').click(); //$(".browse-o").closest(".form-group"); }); $('.input-group.date').datepicker( { calendarWeeks: true, todayHighlight: true, autoclose: true, format:"dd/mm/yyyy" }); //var max_fields = ; //maximum input boxes allowed var wrapper1 = $(".input_fields_wrapOPerations"); //Fields wrapper var add_button1 = $(".addBtn1"); //Add button ID var x1 = '<?php echo $operationsCount; ?>'; //initlal text box count $(add_button1).click(function(e) { /*address = document.getElementById('opAddress'+x1); state = document.getElementById('opState'+x1).value; district = document.getElementById('opDistrict'+x1).value;*/ //totalBoardMembers = document.getElementById('totalBoardMembers'+x1); addressLength = document.getElementsByName('opAddress[]').length; //alert(addressLength); for(i=0;i<addressLength;i++) { address = document.getElementsByName('opAddress[]'); state = document.getElementsByName('opState[]'); district = document.getElementsByName('opDistrict[]'); //totalBoardMembers = document.getElementsByName('totalBoardMembers[]'); totalStaff = document.getElementsByName('totalStaff[]'); if(address[i].value.trim() != "" && state[i].value.trim() != 0 && district[i].value.trim() != 0 && totalStaff[i].value.trim() != "") { flag = 1; } else { flag = 0; break; } } if(flag == 1) { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x1++; //text box increment $(wrapper1).prepend('<hr><div class="tr"><a class="action2"><i class="fa fa-trash remove_field1 pull-right" aria-hidden="true" ></i></a><div class="form-group"><label class="col-md-3" for="address">Address</label><div class=""><input type="hidden" name="operationID[]" id="operationID'+x1+'" value=""><input type="text" name="opAddress[]" id="opAddress'+x1+'" placeholder="H.no,Street Name" class="col-md-4"></div></div><div class="form-group"><label class="col-md-3" for="state" >State</label><div class=""><select name="opState[]" id="opState'+x1+'" class="col-md-4" onchange="getDistricts3(this.value,'+x1+')"><option value="0">Select State</option><?php echo $newStates; ?></select></div></div><div class="form-group"><label class="col-md-3" for="district">District</label><div class=""><select name="opDistrict[]" id="opDistrict'+x1+'" class="col-md-4"><option value="0">Select District</option></select></div></div><div class="form-group"><label class="col-md-3" for="address" >Total No.of Staff</label><div class=""><input type="text" name="totalStaff[]" id="totalStaff'+x1+'" placeholder="Total No.of Staff" class="col-md-4" onkeypress="return number(event)"></div></div></div>'); //add input box //} } else { alert("Please fill all fields first."); } }); $(wrapper1).on("click",".remove_field1", function(e){ //user click on remove text e.preventDefault(); $(this).closest('.tr').remove(); }) var wrapper2 = $(".input_fields_wrap2"); var add_button2 = $(".addBtn2"); var x = '<?php echo $projectsCount; ?>'; $(add_button2).click(function(e) { /*projectName = document.getElementById('projectName'+x); funder = document.getElementById('funder'+x); startDate = document.getElementById('startDate'+x); endDate = document.getElementById('endDate'+x); activity = document.getElementById('activity'+x);*/ projectNameLength = document.getElementsByName('projectName[]').length; for(i=0;i<projectNameLength;i++) { projectName = document.getElementsByName('projectName[]'); funder = document.getElementsByName('funder[]'); startDate = document.getElementsByName('startDate[]'); endDate = document.getElementsByName('endDate[]'); activity = document.getElementsByName('activity[]'); if(projectName[i].value.trim() != "" && funder[i].value.trim() != 0 && startDate[i].value.trim() != 0 && endDate[i].value.trim() != "" && activity[i].value.trim() != "") { flag1 = 1; } else { flag1 = 0; break; } } if(flag1 == 1) { e.preventDefault(); // if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper2).append('<tr><td>'+x+'</td><td><input type="hidden" name="projectID[]" id="projectID'+x+'" value=""><input type="text" name="projectName[]" id="projectName'+x+'" placeholder="Previous Projects"></td><td><input type="text" name="funder[]" id="funder'+x+'" placeholder="Funder" /></td><td><div class="input-group date" ><input type="text" class="form-control" name="startDate[]" id="startDate'+x+'" placeholder="Period - Start Date" readonly /><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div> </td><td><div class="input-group date" ><input type="text" class="form-control" name="endDate[]" id="endDate'+x+'" placeholder="Period - End Date" readonly /><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div></td><td><input type="text" name="activity[]" id="activity'+x+'" placeholder="Activity"></td><td><a class="action2"><i class="fa fa-trash remove_field2" aria-hidden="true" ></i></a></td></tr>'); //add input box //} $('.input-group.date').datepicker( { calendarWeeks: true, todayHighlight: true, autoclose: true, format:"dd/mm/yyyy" }); } else { alert("Please fill all fields first."); } }); $(wrapper2).on("click",".remove_field2", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove();x--; }) //var max_fields = ; //maximum input boxes allowed var wrapper3 = $(".input_fields_wrap3"); //Fields wrapper var add_button3 = $(".addBtn3"); //Add button ID var x3 = '<?php echo $bcManagementDetailsCount; ?>'; //initlal text box count $(add_button3).click(function(e) { /*designation = document.getElementById('designation'+x3).value; name1 = document.getElementById('name'+x3); address = document.getElementById('address'+x3); qualification = document.getElementById('qualification'+x3); experience = document.getElementById('experience'+x3); experienceDetails = document.getElementById('experienceDetails'+x3); otherInstitutionDetails = document.getElementById('otherInstitutionDetails'+x3); managementFileStatus = document.getElementById('managementFileStatus'+x3);*/ nameLength = document.getElementsByName('bcManagementName[]').length; //alert(nameLength); statusFlag = 0; for(i=0;i<nameLength;i++) { designation = document.getElementsByName('bcManagementDesignation[]'); mgName = document.getElementsByName('bcManagementName[]'); address = document.getElementsByName('bcManagementAddress[]'); qualification = document.getElementsByName('bcManagementQualification[]'); experience = document.getElementsByName('bcManagementExperience[]'); experienceDetails = document.getElementsByName('bcManagementExperienceDetails[]'); otherInstitutionDetails = document.getElementsByName('otherInstitutionDetails[]'); managementFileStatus = document.getElementsByName('managementFileStatus[]'); //managementFileStatus =managementFileStatus[i] ; if(designation[i].value.trim() != "" && mgName[i].value.trim() != "" && address[i].value.trim() != "" && qualification[i].value.trim() != "" && experience[i].value.trim() != "" && experienceDetails[i].value.trim() != "" && otherInstitutionDetails[i].value.trim() != "" ) { flag1 = 1; } else { flag1 = 0; break; } if(managementFileStatus[i].value.trim() == 1) { statusFlag = 1; } else { statusFlag = 0; break; } } if(flag1 == 1) { if(statusFlag == 1) { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x3++; //text box increment $(wrapper3).append('<tr><td><input type="hidden" name="bcManagementID[]" id="managementID'+x3+'" placeholder=" Name"><input type="text" name="bcManagementName[]" id="name'+x3+'" placeholder=" Name"></td><td><select name="bcManagementDesignation[]" id="designation'+x3+'"><option value="0">Select Designation</option><option value="1">President</option><option value="2">Secretery</option><option value="3">Treasurey</option><option value="4">Member</option><option value="5">Any other</option></select></td>\ <td> \ <div class="input-group date" > \ <input type="text" class="form-control" value="" name="bcManagementDate[]" id="bcManagementDate'+x3+'" placeholder="Date" readonly /> \ <span class="input-group-addon"> \ <span class="glyphicon glyphicon-calendar"></span> \ </span> \ </div> \ </td> \ <td><input type="text" name="bcManagementAddress[]" id="address'+x3+'" placeholder="Address"></td><td><textarea type="text" name="bcManagementQualification[]" id="qualification'+x3+'" placeholder="Qualification"></textarea></td><td><input type="text" name="bcManagementExperience[]" id="experience'+x3+'" placeholder="Experience" ></td><td><textarea type="text" name="bcManagementExperienceDetails[]" id="experienceDetails'+x3+'" placeholder="Experience Details"></textarea></td><td><textarea type="text" name="otherInstitutionDetails[]" id="otherInstitutionDetails'+x3+'" placeholder="Details of association"></textarea></td>\ <td> \ <input type="hidden" name="relationshipStatus[]" value="0" id="isRelationshipStatus'+x3+'">\ <input type="radio" name="relationshipStatus'+x3+'[]" id="relationshipStatus'+x3+'" value="1" onclick="saveRelationShipStatus(this.value,'+x3+')"> Yes<br> \ <input type="radio" name="relationshipStatus'+x3+'[]" id="relationshipStatus'+x3+'" value="0" checked onclick="saveRelationShipStatus(this.value,'+x3+')"> No </td> \ <td class="tdWidht"><input type="hidden" name="isAuthorized[]" value="1" id="isAuthorized'+x3+'"><input type="radio" name="authorized'+x3+'[]" id="authorized'+x3+'" value="1" onclick="saveIsAuthorized(this.value,'+x3+')"> Yes<br><input type="radio" name="authorized'+x3+'[]" id="authorized'+x3+'" value="0" checked onclick="saveIsAuthorized(this.value,'+x3+')">No</td><td><div class="form-group" style="margin:0px;"><input type="hidden" name="managementFile[]" value="" id="managementFile'+x3+'"><input type="hidden" value="1" id="managementFileStatus'+x3+'" name="managementFileStatus[]"><input type="file" name="file[]" id="file'+x3+'" readonly value="" class="browse-o" onchange=\'ValidateFileUpload("file'+x3+'","managementFileStatus'+x3+'")\'><button type="button" class="disabledClass browse-d" id="browse-dd'+x3+'">Browse</button><div id="managementFileUploadStatus'+x3+'" class="divSuccess"></div></div></div></td><td><a class="action2"><i class="fa fa-trash remove_field3" aria-hidden="true" ></i></a></td></tr>'); //add input box //} $('.input-group.date').datepicker( { calendarWeeks: true, todayHighlight: true, autoclose: true, format:"dd/mm/yyyy" }); } else { alert("Please upload a valid file."); } } else { alert("Please fill all fields first."); } var str='<script>$("#browse-dd'+x3+'").click(function(){$(this).closest(".form-group").find("#file'+x3+'").click();});'; str+="<"; str+="/script>"; $("body").append(str); }); $(wrapper3).on("click",".remove_field3", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove();x3--; }); //Profile of the Chief Executive Officer * //var max_fields = ; //maximum input boxes allowed var wrapper4 = $(".input_fields_wrap4"); //Fields wrapper var add_button4 = $(".addBtn4"); //Add button ID $('.input-group.date').datepicker({ calendarWeeks: true, todayHighlight: true, autoclose: true, format:"dd/mm/yyyy" }); var x4 = '<?php echo $bcCeoDetailsCount; ?>'; //initlal text box count $(add_button4).click(function(e) { /*ceoDesignation = document.getElementById('ceoDesignation'+x4).value; ceoName = document.getElementById('ceoName'+x4); ceoQualification = document.getElementById('ceoQualification'+x4); ceoExperience = document.getElementById('ceoExperience'+x4); appointmentDate = document.getElementById('appointmentDate'+x4); details = document.getElementById('details'+x4); kycFileStatus = document.getElementById('kycFileStatus'+x4);*/ ceoNameLenth = document.getElementsByName('ceoName[]').length; statusFlag1 = 0; for(i=0;i<ceoNameLenth;i++) { ceoDesignation = document.getElementsByName('ceoDesignation[]'); ceoName = document.getElementsByName('ceoName[]'); ceoQualification = document.getElementsByName('ceoQualification[]'); ceoExperience = document.getElementsByName('ceoExperience[]'); appointmentDate = document.getElementsByName('appointmentDate[]'); details = document.getElementsByName('details[]'); kycFileStatus = document.getElementsByName('kycFileStatus[]'); if(ceoDesignation[i].value.trim() != "" && ceoName[i].value.trim() != "" && ceoQualification[i].value.trim() != "" && ceoExperience[i].value.trim() != "" && appointmentDate[i].value.trim() != "" && details[i].value.trim() != "" ) { flag1 = 1; } else { flag1 = 0; break; } //alert(kycFileStatus[0].value); if(kycFileStatus[i].value.trim() == 1) { statusFlag1 = 1; } else { statusFlag1 = 0; break; } } if(flag1 == 1) { if(statusFlag1 == 1) { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x4++; //text box increment $(wrapper4).append('<tr><td><input type="hidden" name="ceoID[]" name="ceoI'+x4+'"><input type="text" name="ceoName[]" id="ceoName'+x4+'" placeholder=" Name"></td><td><input type="text" name="ceoDesignation[]" id="ceoDesignation'+x4+'" placeholder="" value="" ></td><td><input type="text" name="ceoQualification[]" id="ceoQualification'+x4+'" placeholder="Qualification"></td><td><input type="text" name="ceoExperience[]" name="ceoExperience'+x4+'" placeholder="Experience" ></td><td><div class="input-group date "><input type="text" class="form-control" name="appointmentDate[]" id="appointmentDate'+x4+'" placeholder="Date of appointment" readonly/><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div></td><td class="td4"><textarea name="details[]" id="details'+x4+'" placeholder="Details of association with any other institution" /></textarea></td><td><div class="form-group" style="margin:0px;"><input type="hidden" name="kycFile[]" value="" id="kycFile'+x4+'"><input type="hidden" value="0" id="kycFileStatus'+x4+'" name="kycFileStatus[]"><input type="file" name="kyc[]" id="kyc'+x4+'" value="" class="browse-o" onchange=\'ValidateFileUpload2("kyc'+x4+'","kycFileStatus'+x4+'")\'><button type="button" class="browse-d" id="browse-d'+x4+'">Browse</button> <div class="divSuccess"></div></div></td><td><a class="action2"><i class="fa fa-trash remove_field4" aria-hidden="true" ></i></a></td></tr>'); //add input box } else { alert("Please upload a valid file."); } } else { alert("Please fill all fields first."); } var str='<script>$("#browse-d'+x4+'").click(function(){$(this).closest(".form-group").find("#kyc'+x4+'").click();});'; str+="<"; str+="/script>"; $("body").append(str); $('.input-group.date').datepicker({ calendarWeeks: true, todayHighlight: true, autoclose: true, format:"dd/mm/yyyy" }); }); $(wrapper4).on("click",".remove_field4", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove();x4--; }); //Please give details of organizational structure/profile //var max_fields = ; //maximum input boxes allowed var wrapper5 = $(".input_fields_wrap5"); //Fields wrapper var add_button5 = $(".addBtn5"); //Add button ID var x5 = '<?php echo $staffingDetailsCount; ?>'; //initlal text box count $(add_button5).click(function(e) { /*staffName = document.getElementById('staffName'+x5); staffDesignation = document.getElementById('staffDesignation'+x5); staffExperience = document.getElementById('staffExperience'+x5); staffAppointmentDate = document.getElementById('staffAppointmentDate'+x5);*/ staffNameLength = document.getElementsByName('staffName[]').length; for(i=0;i<staffNameLength;i++) { staffName = document.getElementsByName('staffName[]'); designation = document.getElementsByName('staffDesignation[]'); experience = document.getElementsByName('staffExperience[]'); appointmentDate = document.getElementsByName('staffAppointmentDate[]'); if(staffName[i].value.trim() != "" && designation[i].value.trim() != "" && experience[i].value.trim() != "" && appointmentDate[i].value.trim() != "" ) { flag1 = 1; } else { flag1 = 0; break; } } if(flag1 == 1) { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x5++; //text box increment <!--<input type="text" name="staffDesignation[]" id="staffDesignation'+x5+'" placeholder=" Name"> --> $(wrapper5).append('<tr ><td><input type="hidden" name="staffID[]" id="staffID'+x5+'" value=""><input type="text" name="staffName[]" id="staffName'+x5+'" placeholder=" Name"></td><td> \ <select name="staffDesignation[]" id="staffDesignation'+x5+'" > \ <option value="Office Staff" >Office Staff</option> \ <option value="Field Staff">Field Staff</option> \ <option value="Supervisory staff" >Supervisory staff</option> \ <option value="Volunteer" >Volunteer</option> \ </select> \ </td><td><input type="text" name="staffExperience[]" id="staffExperience'+x5+'" placeholder="Experience" maxlength="2" onkeypress="return number(event)"></td><td><div class="input-group date" ><input type="text" class="form-control" name="staffAppointmentDate[]" id="staffAppointmentDate'+x5+'" placeholder="Date of appointment" readonly /><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div></td><td><a class="action2"><i class="fa fa-trash remove_field5" aria-hidden="true" ></i></a></td></tr>'); //add input box //} $('.input-group.date').datepicker({ calendarWeeks: true, todayHighlight: true, autoclose: true, format:"dd/mm/yyyy" }); } else { alert("Please fill all fields first."); } }); $(wrapper5).on("click",".remove_field5", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove();x5--; }); //Income, Expenditure For Past 3 Years * var wrapper6 = $(".input_fields_wrap6"); var add_button6 = $(".addBtn6"); $('.input-group.date').datepicker( { calendarWeeks: true, todayHighlight: true, autoclose: true , format:"dd/mm/yyyy" }); var x6 = '<?php echo $incomeDetailsCount; ?>'; $(add_button6).click(function(e) { /*financialYear = document.getElementById('financialYear'+x6); totalIncome = document.getElementById('totalIncome'+x6); totalExpenditure = document.getElementById('totalExpenditure'+x6); excess = document.getElementById('excess'+x6); auditStatus = document.getElementById('auditStatus'+x6);*/ financialYear = document.getElementById('financialYear1'); totalIncome = document.getElementById('totalIncome1'); totalExpenditure = document.getElementById('totalExpenditure1'); excess = document.getElementById('excess1'); auditStatus = document.getElementById('auditStatus1'); if(financialYear.value.trim() != "" && totalIncome.value.trim() != "" && totalExpenditure.value.trim() != "" && excess.value.trim() != "") { if(auditStatus.value == 1) { e.preventDefault(); // if(x < max_fields){ //max input box allowed x6++; //text box increment $(wrapper6).append('<tr><td><input type="hidden" name="incomeID[]" id="incomeID'+x6+'" value=""><input type="text" name="financialYear[]" id="financialYear'+x6+'" maxlength="4" placeholder="Year" onkeypress="return number(event)"></td><td><input type="text" name="totalIncome[]" id="totalIncome'+x6+'" placeholder="Total Income" onkeypress="return number2(event)"></td><td><input type="text" name="totalExpenditure[]" id="totalExpenditure'+x6+'" placeholder="Total Expenditure" onkeypress="return number2(event)"></td><td><input type="text" name="excess[]" name="excess'+x6+'" placeholder="Excess of income over expenditure" onkeypress="return number2(event)"></td><td><div class="form-group" style="margin:0px;"><input type="hidden" name="auditFile[]" id="auditFile'+x6+'" value=""><input type="hidden" value="0" id="auditStatus'+x6+'"><input type="file" name="audit[]" id="audit'+x6+'" value="" class="browse-o" onchange=\'ValidateFileUpload("audit'+x6+'","auditStatus'+x6+'")\'><button type="button" class="browse-d" id="browse-audit'+x6+'">Browse</button> <div class="divSuccess"></div></div></td><td><a class="action2 text-center"><i class="fa fa-trash remove_field6" aria-hidden="true" ></i></a></td></tr>'); //add input box //} } else { alert("Please upload a valid file.");x6--; } } else { alert("Please fill all fields first."); } var str='<script>$("#browse-audit'+x6+'").click(function(){$(this).closest(".form-group").find("#audit'+x6+'").click();});'; str+="<"; str+="/script>"; $("body").append(str); }); $(wrapper6).on("click",".remove_field6", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove();x6--; }); //Profile of the Chief Executive Officer //var max_fields = ; //maximum input boxes allowed var wrapper7 = $(".input_fields_wrap7"); //Fields wrapper var add_button7 = $(".addBtn7"); //Add button ID $('.input-group.date').datepicker( { calendarWeeks: true, todayHighlight: true, autoclose: true , format:"dd/mm/yyyy" }); var x7 = '<?php echo $ceoProfileCount; ?>'; //initlal text box count $(add_button7).click(function(e) { //on add input button click e.preventDefault(); /*ceoYear = document.getElementById('ceoYear'+x7); totalSHGFormed = document.getElementById('totalSHGFormed'+x7); totalSHGAdopted = document.getElementById('totalSHGAdopted'+x7); totalSHGSavings = document.getElementById('totalSHGSavings'+x7); totalSHGCredit = document.getElementById('totalSHGCredit'+x7); totalLoan = document.getElementById('totalLoan'+x7);*/ totalLength = document.getElementsByName('totalSHGFormed[]').length; for(i=0;i<totalLength;i++) { ceoYear = document.getElementsByName('ceoYear[]'); totalSHGFormed = document.getElementsByName('totalSHGFormed[]'); totalSHGAdopted = document.getElementsByName('totalSHGAdopted[]'); totalSHGSavings = document.getElementsByName('totalSHGSavings[]'); totalSHGCredit = document.getElementsByName('totalSHGCredit[]'); totalLoan = document.getElementsByName('totalLoan[]'); //managementFileStatus =managementFileStatus[i] ; if(ceoYear[i].value.trim() != "" && totalSHGFormed[i].value.trim() != "" && totalSHGAdopted[i].value.trim() != "" && totalSHGSavings[i].value.trim() != "" && totalSHGCredit[i].value.trim() != "" && totalLoan[i].value.trim() != "") { flag1 = 1; } else { flag1 = 0; break; } } if(flag1 == 1) { /*if(ceoFileStatus.value == 1) {*/ x7++; //text box increment $(wrapper7).append('<tr><td><input type="hidden" name="ceoProfileID[]" id="ceoProfileID'+x7+'" value=""><input type="text" name="ceoYear[]" id="ceoYear'+x7+'" maxlength="4" placeholder=" YYYY" onkeypress="return number(event)"></td><td><input type="text" name="totalSHGFormed[]" id="totalSHGFormed'+x7+'" placeholder="No. of SHGs formed" onkeypress="return number(event)"></td><td><input type="text" name="totalSHGAdopted[]" id="totalSHGAdopted'+x7+'" placeholder="No. of SHG’s adopted " onkeypress="return number(event)"></td><td><input type="text" name="totalSHGSavings[]" id="totalSHGSavings'+x7+'" placeholder="No. of SHGs savings Linked" onkeypress="return number(event)"></td><td class=""><input type="text" name="totalSHGCredit[]" id="totalSHGCredit'+x7+'" placeholder="No. of SHGs credit Linked" onkeypress="return number2(event)"></td><td class=""><input type="text" name="totalLoan[]" id="totalLoan'+x7+'" placeholder="Total loan disbursed" onkeypress="return number2(event)"></td><td><a class="action2"><i class="fa fa-trash remove_field7" aria-hidden="true" ></i></a></td></tr>'); //add input box /*} else { alert("Please upload a valid file."); }*/ } else { alert("Please fill all fields first."); } var str='<script>$("#browse-df'+x7+'").click(function(){$(this).closest(".form-group").find("#cfile'+x7+'").click();});'; str+="<"; str+="/script>"; $("body").append(str); //} $('.input-group.date').datepicker({ calendarWeeks: true, todayHighlight: true, autoclose: true , format:"dd/mm/yyyy" }); }); $(wrapper7).on("click",".remove_field7", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove();x7--; }); //var max_fields = ; //maximum input boxes allowed var wrapper8 = $(".input_fields_wrap8"); //Fields wrapper var add_button8 = $(".addBtn8"); //Add button ID var x8 = '<?php echo $bcMFIDetailsCount; ?>'; //initlal text box count $(add_button8).click(function(e) { /*date = document.getElementById('date'+x8); address = document.getElementById('address'+x8); state = document.getElementById('state'+x8); district = document.getElementById('mfiDistrict'+x8); taluk = document.getElementById('taluk'+x8); totalActiveGroups = document.getElementById('totalActiveGroups'+x8); mfiTotalLoan = document.getElementById('mfiTotalLoan'+x8); outstanding = document.getElementById('outstanding'+x8); outstandingGroups = document.getElementById('outstandingGroups'+x8); creditRating = document.getElementById('creditRating'+x8); creditRatingName = document.getElementById('creditRatingName'+x8); ratingAwarded = document.getElementById('ratingAwarded'+x8); mfiTotalExpenditure = document.getElementById('mfiTotalExpenditure'+x8); //portfolio = document.getElementById('portfolio'+x8); npaAmout30 = document.getElementById('npaAmout30'+x8); npaAmout60 = document.getElementById('npaAmout60'+x8); npaAmout90 = document.getElementById('npaAmout90'+x8); repaymentRate = document.getElementById('repaymentRate'+x8); totalGroups = document.getElementById('totalGroups'+x8);*/ date = document.getElementById('date1'); address = document.getElementById('address1'); state = document.getElementById('state1'); district = document.getElementById('mfiDistrict1'); taluk = document.getElementById('taluk1'); totalActiveGroups = document.getElementById('totalActiveGroups1'); mfiTotalLoan = document.getElementById('mfiTotalLoan1'); outstanding = document.getElementById('outstanding1'); outstandingGroups = document.getElementById('outstandingGroups1'); creditRating = document.getElementById('creditRating1'); creditRatingName = document.getElementById('creditRatingName1'); ratingAwarded = document.getElementById('ratingAwarded1'); mfiTotalExpenditure = document.getElementById('mfiTotalExpenditure1'); //portfolio = document.getElementById('portfolio'+x8); npaAmout30 = document.getElementById('npaAmout301'); npaAmout60 = document.getElementById('npaAmout601'); npaAmout90 = document.getElementById('npaAmout901'); repaymentRate = document.getElementById('repaymentRate1'); totalGroups = document.getElementById('totalGroups1'); if(date.value.trim() != "" && address.value.trim() != "" && totalActiveGroups.value.trim() != "" && mfiTotalLoan.value.trim() != "" && outstanding.value.trim() != "" && creditRatingName.value.trim() != "" && ratingAwarded.value.trim() != "" && /*&& portfolio.value != 0*/ repaymentRate.value.trim() != "" && totalGroups.value.trim() != "" && state.value != 0 && district.value != 0 && taluk.value != "" && outstandingGroups.value != "" && npaAmout30.value != "" && npaAmout60.value != "" && npaAmout90.value != "") { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x8++; //text box increment $(wrapper8).append('<div style="border:1px solid #ccc;margin: 20px;"></div><div class="tr"><a class="action2"><i class="fa fa-trash pull-right remove_field4" aria-hidden="true" style="float:right;"></i></a><div class="form-group"><label class="col-md-3" for="details" >Date of commencement of operation :</label><input type="hidden" name="mfiID[]" id="mfiID'+x8+'" value=""><div class="input-group date col-md-3" ><input type="text" class="form-control" name="date[]" id="date'+x8+'" placeholder="Date of commencement of operation" readonly /><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div> </div><div class="form-group"><label class="col-md-3" for="details" >H.O Address</label><div class=""><textarea name="address[]" id="address'+x8+'" class="col-md-3" rows="3"></textarea></div></div><div class="form-group"><label class="col-md-3" for="state" >State</label><div class=""><select name="state[]" id="state'+x8+'" class="col-md-4" onchange="getMFIDistricts(this.value,'+x8+')"><option value="0">Select State</option><?php echo $newStates; ?></select></div></div><div class="form-group"><label class="col-md-3" for="district">District</label><div class=""><select name="district[]" id="mfiDistrict'+x8+'" class="col-md-4"><option value="0">Select District</option></select></div></div> \ <div class="form-group"> \ <label class="col-md-3" for="taluk" >Taluk</label> \ <div class=""> \ <input type="text" name="taluk[]" id="taluk'+x8+'" value="" placeholder="Taluk" class="col-md-4" > \ </div> \ </div> \ <div class="form-group"><label class="col-md-3" for="activeGroups" >No. of active groups</label><div class=""><input type="text" name="totalActiveGroups[]" id="totalActiveGroups'+x8+'" placeholder="" class="col-md-4" onkeypress="return number(event)"></div></div><div class="form-group"><label class="col-md-3" for="totalLoanDisbursed" >Total loan amount disbursed (Rs in Lakhs)</label><div class=""><input type="text" name="mfiTotalLoan[]" id="mfiTotalLoan'+x8+'" placeholder="" class="col-md-4" onkeypress="return number2(event)"></div></div><div class="form-group"><label class="col-md-3" for="outStanding" >Outstanding amount (Rs in Lakhs)</label><div class=""><input type="text" name="outstanding[]" id="outstanding'+x8+'" placeholder="" class="col-md-4"></div></div> \ <div class="form-group"> \ <label class="col-md-3" for="outstandingGroups" >Outstanding no of groups </label> \ <div class=""> \ <input type="text" name="outstandingGroups[]" id="outstandingGroups'+x8+'" value="" placeholder="" class="col-md-4" > \ </div> \ </div>\ <h3 class="col-md-12 removePadding" for="MFIRating" >Credit Rating of MFI, If any</h3>\ <div class="table-responsive col-md-12 removePadding"><table class="table table-bordered cs-table table-responsive"><thead><tr><th>Name of Credit Rating Agency groups</th><th>Rating Awarded </th></tr></thead><tbody class="input_fields_wrap33"><tr><td><input type="text" name="creditRatingName[]" id="creditRatingName'+x8+'" placeholder=""></td><td><input type="text" name="ratingAwarded[]" id="ratingAwarded'+x8+'" placeholder=""></td></tr></tbody></table></div><div class="form-group"><label class="col-md-3" for="district">Portfolio at Risk : </label></div>\ <div class="table-responsive col-md-12 removePadding"> \ <table class="table table-bordered cs-table table-responsive"><thead>\ <tr><th>PAR(30-60)</th><th>PAR(60-90)</th><th>PAR(>90)</th></tr></thead>\ <tbody class="input_fields_wrap34"> \ <tr><td><input type="text" name="npaAmout30[]" id="npaAmout30'+x8+'" placeholder=" " ></td> \ <td><input type="text" name="npaAmout60[]" id="npaAmout60'+x8+'" placeholder="" ></td> \ <td><input type="text" name="npaAmout90[]" id="npaAmout90'+x8+'" placeholder="" ></td> \ </tr></tbody></table></div> \ <div class="form-group"><label class="col-md-3" for="repaymentRate">Repayment % against demand </label><div class=""><input type="text" name="repaymentRate[]" id="repaymentRate'+x8+'" placeholder="" class="col-md-4" onkeypress="return number2(event)"></div></div> \ <div class="form-group"> \ <label class="col-md-3" for="totalGroups" >No of groups</label> \ <div class=""> \ <input type="text" name="totalGroups[]" id="totalGroups'+x8+'" placeholder="" class="col-md-4" onkeypress="return number(event)" > \ </div> \ </div> \ </div></div>'); //add input box //} /*<div class="table-responsive col-md-12 removePadding"><table class="table table-bordered cs-table table-responsive"><thead><tr><th>No of groups</th><th>Amount of PAR (Rs. lakh)</th></tr></thead><tbody class="input_fields_wrap34"><tr><td><input type="text" name="totalGroups[]" id="totalGroups'+x8+'" placeholder=" " onkeypress="return number(event)"></td><td><input type="text" name="amount[]" id="amount'+x8+'" placeholder="" onkeypress="return number2(event)"></td></tr></tbody></table></div>*/ } else { alert("Please fill all fields first."); } $('.input-group.date').datepicker( { calendarWeeks: true, todayHighlight: true, autoclose: true, format:"dd/mm/yyyy" }); }); $(wrapper8).on("click",".remove_field4", function(e){ //user click on remove text e.preventDefault(); $(this).closest('.tr').remove();x8-- ; }); //var max_fields = ; //maximum input boxes allowed var wrapper12 = $(".input_fields_wrap12"); //Fields wrapper var add_button12 = $(".addFieldsBtn12"); //Add button ID var x12 = '<?php echo $partnerDetailsCount; ?>'; //initlal text box count $(add_button12).click(function(e) { /*address = document.getElementById('partnerAddress'+x12).value; state = document.getElementById('partnerState'+x12).value; district = document.getElementById('partnerDistrict'+x12).value;*/ address = document.getElementById('partnerAddress1').value; state = document.getElementById('partnerState1').value; district = document.getElementById('partnerDistrict1').value; if(address.trim() != "" && state != 0 && district != 0) { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x12++; //text box increment $(wrapper12).append('<div class="tr"><hr style="border-top: 1px solid #c0bdbd;" /><div class="form-group"> \ <label class="col-md-3" for="address" >Address</label>\ <div >\ <input type="hidden" name="partnerID[]" value="">\ <textarea name="partnerAddress[]" id="partnerAddress'+x12+'" class="col-md-3" rows="3"></textarea>\ </div>\ <a class="action2 pull-right"><i class="fa fa-trash remove_field12" aria-hidden="true" ></i></a>\ </div>\ <div class="form-group">\ <label class="col-md-3" for="state" >State</label>\ <div class="">\ <select name="partnerState[]" id="partnerState'+x12+'" class="col-md-4" onchange=\'getDistricts4(this.value,"partnerDistrict'+x12+'")\'> \ <option value="0">Select State</option> \ <?php echo $newStates; ?> \ </select> \ </div> \ </div> \ <div class="form-group"> \ <label class="col-md-3" for="district">District</label> \ <div class=""> \ <select name="partnerDistrict[]" id="partnerDistrict'+x12+'" class="col-md-4"> \ <option value="0">Select District</option> \ </select> \ </div>\ </div></div>'); //add input box//} } else { alert("Please fill all the fields.") } }); $(wrapper12).on("click",".remove_field12", function(e){ //user click on remove text e.preventDefault(); $(this).closest('.tr').remove();x12--; }); var wrapper13 = $(".inputWrapper"); //Fields wrapper var add_button13 = $(".addNewBtn"); //Add button ID var x13 = '<?php echo $proposedDetailsCount; ?>'; //initlal text box count $(add_button13).click(function(e) { /*taluk = document.getElementById('proposedTaluk'+x13).value; state = document.getElementById('proposedState'+x13).value; district = document.getElementById('proposedDistrict'+x13).value;*/ proposedTalukLength = document.getElementsByName('proposedTaluk[]').length; for(i=0;i<proposedTalukLength;i++) { proposedTaluk = document.getElementsByName('proposedTaluk[]'); proposedState = document.getElementsByName('proposedState[]'); proposedDistrict = document.getElementsByName('proposedDistrict[]'); if(proposedTaluk[i].value.trim() != "" && proposedState[i].value.trim() != "" && proposedDistrict[i].value.trim() != "" ) { flag1 = 1; } else { flag1 = 0; break; } } if(flag1 == 1) { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x13++; //text box increment $(wrapper13).append(' <div class="tr"> <hr>\ <div class="form-group">\ <div class="col-md-1 pull-right"><a class="action2 "><i class="fa fa-trash remove_field13" aria-hidden="true" ></i></a></div> \ <label class="col-md-3" for="state" >State</label>\ <div class="">\ <input type="hidden" value="" name="proposedID[]">\ <select name="proposedState[]" id="proposedState'+x13+'" class="col-md-4" onchange=\'getDistricts4(this.value,"proposedDistrict'+x13+'")\'> \ <option value="0">Select State</option>\ <?php echo $newStates; ?>\ </select>\ </div>\ \ </div>\ <div class="form-group">\ <label class="col-md-3" for="district">District</label>\ <div class="">\ <select name="proposedDistrict[]" id="proposedDistrict'+x13+'" class="col-md-4">\ </select>\ </div>\ </div>\ <div class="form-group">\ <label class="col-md-3" for="district">Taluk</label>\ <div class="">\ <input type="text" name="proposedTaluk[]" value="" id="proposedTaluk'+x13+'" class="col-md-4">\ </div>\ </div>\ </div>'); //add input box//} } else { alert("Please fill all the fields.") } }); $(wrapper13).on("click",".remove_field13", function(e){ //user click on remove text e.preventDefault(); $(this).closest('.tr').remove();x13--; }); function getDistricts(stateID) { if(stateID == 0) { document.getElementById('appDistrict').innerHTML = ""; document.getElementById('appDistrict').innerHTML = '<option value="0">Select District</option>'; } else { $.post("app/ajax.php",{type:2,stateID:stateID},function(data) { document.getElementById('appDistrict').innerHTML = '<option value="0">Select District</option>'+data; }); } } function getDistricts4(stateID,district) { if(stateID == 0) { document.getElementById(district).innerHTML = ""; document.getElementById(district).innerHTML = '<option value="0">Select District</option>'; } else { $.post("app/ajax.php",{type:2,stateID:stateID},function(data) { document.getElementById(district).innerHTML = '<option value="0">Select District</option>'+data; }); } } function number3(e) { //if(e.keyCode == 13 || e.keyCode == 43 || (e.keyCode >= 48 && e.keyCode <= 57)) var key = e.keyCode || e.charCode; if(key == 13 || key == 43 || (key >= 48 && key <= 57) || key == 8 || key == 46) { return true; } else { return false; } } function getDistricts2(stateID,i) { if(stateID == 0) { document.getElementById('district'+i).innerHTML = ""; document.getElementById('district'+i).innerHTML = '<option value="0">Select District</option>'; } else { $.post("app/ajax.php",{type:2,stateID:stateID},function(data) { document.getElementById('district'+i).innerHTML = '<option value="0">Select District</option>'+data; alert(document.getElementById('district'+i).innerHTML) }); } } function getMFIDistricts(stateID,i) { if(stateID == 0) { document.getElementById('mfiDistrict'+i).innerHTML = ""; document.getElementById('mfiDistrict'+i).innerHTML = '<option value="0">Select District</option>'; } else { $.post("app/ajax.php",{type:2,stateID:stateID},function(data) { document.getElementById('mfiDistrict'+i).innerHTML = '<option value="0">Select District</option>'+data; }); } } function getDistricts3(stateID,i) { if(stateID == 0) { document.getElementById('opDistrict'+i).innerHTML = ""; document.getElementById('opDistrict'+i).innerHTML = '<option value="0">Select District</option>'; } else { $.post("app/ajax.php",{type:2,stateID:stateID},function(data) { document.getElementById('opDistrict'+i).innerHTML = '<option value="0">Select District</option>'+data; }); } } function number(e) { //if(e.keyCode == 13 || (e.keyCode >= 48 && e.keyCode <= 57)) var key = e.keyCode || e.charCode; if(key == 13 || key == 43 || (key >= 48 && key <= 57) || key == 8 || key == 46) { return true; } else { return false; } } function ValidateFileUpload(fileID,fileStatusID) { pdfFlag = 0; var fuData = document.getElementById(fileID); var fileStatus = document.getElementById(fileStatusID); var FileUploadPath = fuData.value; //To check if user upload any file if (FileUploadPath == '') { alert("Please upload a pdf/image file."); $('#'+fileID).parents(".form-group").find('.divSuccess').html('<span class="fail"></span>'); fileStatus.value = 0; pdfFlag = 0; } else { var Extension = FileUploadPath.substring( FileUploadPath.lastIndexOf('.') + 1).toLowerCase(); //The file uploaded is an pdf if (Extension == "pdf" || Extension == "jpeg" || Extension == "jpg" || Extension == "png" ) { var size=5242880; var file_size=fuData.files[0].size; if(file_size>=size) { $(fuData).closest('.divSuccess').html('Hello World'); alert('File too large'); fileStatus.value = 0; $('#'+fileID).parents(".form-group").find('.divSuccess').html('<span class="fail"></span>'); pdfFlag = 0; } else { $(fuData).closest('.divSuccess').html('Hello World'); pdfFlag = 1; $('#'+fileID).parents(".form-group").find('.divSuccess').html('<span class="success"></span>'); fileStatus.value = 1; } } //The file upload is NOT an pdf else { $(fuData).closest('.divSuccess').html('Hello World'); alert("Please upload a pdf/image file."); $('#'+fileID).parents(".form-group").find('.divSuccess').html('<span class="fail"></span>'); fileStatus.value = 0; } } } function ValidateFileUpload2(fileID,fileStatusID) { pdfFlag = 0; var fuData = document.getElementById(fileID); var fileStatus = document.getElementById(fileStatusID); var FileUploadPath = fuData.value; //To check if user upload any file if (FileUploadPath == '') { alert("Please upload a jpeg or jpg or png file."); $('#'+fileID).parents(".form-group").find('.divSuccess').html('<span class="fail"></span>'); fileStatus.value = 0; pdfFlag = 0; } else { var Extension = FileUploadPath.substring( FileUploadPath.lastIndexOf('.') + 1).toLowerCase(); //The file uploaded is an pdf if (Extension == "jpeg" || Extension == "jpg" || Extension == "png" || Extension == "pdf") { var size=1048576; var file_size=fuData.files[0].size; if(file_size>=size) { alert('File too large'); fileStatus.value = 0; pdfFlag = 0; $('#'+fileID).parents(".form-group").find('.divSuccess').html('<span class="fail"></span>'); } else { pdfFlag = 1; fileStatus.value = 1; $('#'+fileID).parents(".form-group").find('.divSuccess').html('<span class="success"></span>'); } } //The file upload is NOT an pdf else { alert("Please upload a jpeg or jpg or png file."); fileStatus.value = 0; $('#'+fileID).parents(".form-group").find('.divSuccess').html('<span class="fail"></span>'); } } } function number2(e) { //if(e.keyCode == 13 || e.keyCode == 46 || (e.keyCode >= 48 && e.keyCode <= 57)) var key = e.keyCode || e.charCode; if(key == 13 || key == 43 || (key >= 48 && key <= 57) || key == 8 || key == 46) { return true; } else { return false; } } function displayMFI(i) { if(i==0) { document.getElementById('mfiActivity').style.display = 'none'; /*document.getElementById('date'+x).value = ""; document.getElementById('address'+x).value = ""; document.getElementById('state'+x).value = 0; document.getElementById('district'+x).value = 0; document.getElementById('totalActiveGroups'+x).value = ""; document.getElementById('mfiTotalLoan'+x).value = ""; document.getElementById('outstanding'+x).value = ""; document.getElementById('creditRating'+x).value = ""; document.getElementById('creditRatingName'+x).value = ""; document.getElementById('ratingAwarded'+x).value = ""; document.getElementById('mfiTotalExpenditure'+x).value = ""; document.getElementById('portfolio'+x).value = 0; document.getElementById('repaymentRate'+x).value = ""; document.getElementById('totalGroups'+x).value = ""; document.getElementById('amount'+x).value = "";*/ } else { document.getElementById('mfiActivity').style.display = 'block'; } } function saveIsAuthorized(val,i,managementID) { if(val == 0) { document.getElementById('file'+i).disabled = true; $('#browse-dd'+i).addClass("disabledClass"); document.getElementById('managementFileStatus'+i).value = 1; } else { document.getElementById('file'+i).disabled = false; $('#browse-dd'+i).removeClass("disabledClass"); document.getElementById('managementFileStatus'+i).value = 0; } document.getElementById('isAuthorized'+i).value = val; if(managementID != 0) { //updating authorised signatures when no is checked $.post("app/ajax.php",{type:5,managementID:managementID,status:val}); } } function displayFacilitator(i) { if(i == 0) { document.getElementById('facilitatorDiv').style.display = "none"; } else { document.getElementById('facilitatorDiv').style.display = "block"; } } function validatePDF3(type,fileID) { if(pdfFlag2 == 0) { alert('Please upload a valid file'); } else { var fuData = document.getElementById(fileID); var txtStructureUpload = document.getElementById('txtResolutionUpload'); var staffUploadStatus = document.getElementById('uploadStatus'); var fd = new FormData(); fd.append('userFile',$('#'+fileID)[0].files[0]); fd.append('type',type); $.ajax({ url: 'app/ajax.php', data: fd, processData: false, contentType: false, type: 'POST', success: function(data) { if(data == -4) { alert('Unable to upload deeds declarion file.'); staffUploadStatus.innerHTML = '<span class="fail"></span>'; } else if(data == -3) { alert('Error!!! Unable to save deed details. Internal server error.'); staffUploadStatus.innerHTML = '<span class="fail"></span>'; } else { alert('Data saved successfully.'); staffUploadStatus.innerHTML = '<span class="success"></span>'; txtStructureUpload.value = 1; //location.reload(); } } }); } } function ValidateStructuralFileUpload(fileID,i,uploadStatus) { pdfFlag2 = 0; var fuData = document.getElementById(fileID); var staffUploadStatus = document.getElementById('uploadStatus'+i); var FileUploadPath = fuData.value; //To check if user upload any file if (FileUploadPath == '') { alert("Please upload a pdf/image file."); document.getElementById(uploadStatus).value = 0; pdfFlag2 = 0; } else { var Extension = FileUploadPath.substring( FileUploadPath.lastIndexOf('.') + 1).toLowerCase(); //The file uploaded is an pdf if (Extension == "pdf" || Extension == "jpeg" || Extension == "jpg" || Extension == "png" ) { var size=5242880; var file_size=fuData.files[0].size; if(file_size>=size) { alert('File too large'); staffUploadStatus.innerHTML = '<span class="fail"></span>'; document.getElementById(uploadStatus).value = 0; pdfFlag2 = 0; } else { pdfFlag2 = 1; document.getElementById(uploadStatus).value = 1; staffUploadStatus.innerHTML = '<span class="success"></span>'; } } //The file upload is NOT an pdf else { alert("Please upload a pdf/image file."); staffUploadStatus.innerHTML = '<span class="fail"></span>'; } } } function validateForm() { var kyc = document.getElementsByName("kyc[]"); var kycFile = document.getElementsByName("kycFile[]"); //var structureUploadStatus = document.getElementById('txtStructureUpload').value; var resolutionUploadStatus = document.getElementById('txtResolutionUpload').value; excelUploadStatus = document.getElementById('excelUploadStatus'); managementFileStatus = document.getElementsByName('managementFileStatus[]'); for(i=0;i<managementFileStatus.length;i++) { if(managementFileStatus[i].value == 0) { alert("Please enter valid management file."); return false; } } j = 1; for(i=0;i<kyc.length;i++) { if(kycFile[i].value != "") { if(document.getElementById('kycFileStatus'+j).value == 0) { alert("Please upload a valid kyc file.") return false; } } else if(kyc[i].value != "") { if(document.getElementById('kycFileStatus'+j).value == 0) { alert("Please upload a valid kyc file.") return false; } } j++; } /*if(structureUploadStatus == 0) { alert("Please upload a valid structure file.") return false; }*/ if(resolutionUploadStatus == 0) { alert("Please upload a valid resolution file.") return false; } if(excelUploadStatus.value != 1) { alert("Please upload a valid excel file."); return false; } return true; } function saveIsAuthorized(val,i,managementID) { if(val == 0) { document.getElementById('file'+i).disabled = true; $('#browse-dd'+i).addClass("disabledClass"); document.getElementById('managementFileStatus'+i).value = 1; } else { document.getElementById('file'+i).disabled = false; $('#browse-dd'+i).removeClass("disabledClass"); document.getElementById('managementFileStatus'+i).value = 0; } document.getElementById('isAuthorized'+i).value = val; if(managementID != 0) { $.post("app/ajax.php",{type:6,managementID:managementID,status:val}); } } function saveRelationShipStatus(val,i) { document.getElementById('isRelationshipStatus'+i).value = val; } function profitLoss(i) { totalIncome = document.getElementById('totalIncome'+i).value; totalExpenditure = document.getElementById('totalExpenditure'+i).value; if(totalIncome != "" && totalExpenditure != "") { document.getElementById('excess'+i).value = totalIncome - totalExpenditure; } document.getElementById('excess'+i).readonly = true; } function ValidateExcelFileUpload() { excelFlag = 0; var fuData = document.getElementById('excelFile'); var fileStatus = document.getElementById('excelUploadStatus'); var FileUploadPath = fuData.value; var excelFileStatus = document.getElementById('excelFileStatus'); //To check if user upload any file if (FileUploadPath == '') { alert("Please upload a excel file."); fileStatus.value = 0; excelFileStatus.innerHTML = '<span class="fail"></span>'; excelFlag = 0; } else { var Extension = FileUploadPath.substring( FileUploadPath.lastIndexOf('.') + 1).toLowerCase(); //The file uploaded is an pdf if (Extension == "xls" || Extension == "xlsx") { var size=1048576; var file_size=fuData.files[0].size; if(file_size>=size) { alert('File too large'); fileStatus.value = 0; excelFlag = 0; } else { excelFlag = 1; excelFileStatus.innerHTML = '<span class="success"></span>'; fileStatus.value = 1; } } //The file upload is NOT an pdf else { alert("Please upload a excel file."); excelFileStatus.innerHTML = '<span class="fail"></span>'; fileStatus.value = 0; excelFlag = 0; } } } function showValidityText(i) { if(i == 2) { document.getElementById('validityText').style.display = 'block'; } else { document.getElementById('validityText').style.display = 'none'; } } function calculateAttributionRate(i) { var totalStaff = parseInt(document.getElementById('totalFinancialStaff'+i).value); var staffLeft = parseInt(document.getElementById('staffLeft'+i).value); if(totalStaff != "" && staffLeft != "") { if(totalStaff != 0) { attributionRate = (staffLeft/totalStaff).toFixed(2); if(isNaN(attributionRate)) { attributionRate = ""; } else { attributionRate += ' %'; } } else { attributionRate = ""; } } document.getElementById('attributionRate'+i).value = attributionRate; } var k = <?php echo $partnerDetailsCount ?>; //initlal text box count var p = 1; //initlal text box count var max_fields = 7; //maximum input boxes allowed var agenciesWrapper = $(".agenciesWrapper"); //Fields wrapper var addAgenciesBtn = $(".addAgenciesBtn"); //Add button ID $(addAgenciesBtn).click(function(e) { l = 1; //on add input button click e.preventDefault(); if(k < max_fields) { //max input box allowed k++; //text box increment $(agenciesWrapper).append(' <div class="tr " style="border:0px solid red;padding: 15px;" > \ <div class=" pull-right">\ <a class="action2 "><i class="fa fa-trash removeAgencies" aria-hidden="true" ></i></a>\ </div> \ <div class="form-group">\ <input type="hidden" name="partnerAgencyID[]" value="">\ <label class="col-md-3" for="nameOfThePartnerAgencies" >Name of the Partner Agencies</label>\ <div class="">\ <input type="text" name="partnerAgencies[]" value="" placeholder="" class="col-md-4">\ </div>\ </div>\ <div class="form-group">\ <label class="col-md-3" for="details" >Duration</label>\ <div class="col-md-2">\ <label>From:</label>\ <div class="input-group date" >\ <input type="text" class="form-control" name="duration[]" value="" placeholder="" readonly />\ <span class="input-group-addon">\ <span class="glyphicon glyphicon-calendar"></span>\ </span>\ </div>\ </div>\ <div class="col-md-2">\ <label>To:</label>\ <div class="input-group date">\ <input type="text" class="form-control" name="durationTo[]" value="" placeholder="" readonly />\ <span class="input-group-addon">\ <span class="glyphicon glyphicon-calendar"></span>\ </span>\ </div> \ </div>\ </div>\ <div class="col-md-12 removePadding">\ <h3 class="removePadding col-md-8">Area of operations</h3>\ <input type="button" class="col-md-1 btn btn-default pBtn'+k+'" value="Add New" onclick=\'partnerBlockfun('+k+')\'> \ </div> \ <div class="pContainer">\ <div class="pBlock partnerBlock'+k+'">\ <div class="tr1"><hr style="border-top: 1px solid #c0bdbd;" />\ <div >\ </div>\ <div class="form-group">\ <label class="col-md-3" for="state" >State</label>\ <div class="">\ <input type="hidden" name="partnerOperationsID['+k+'][]" value="">\ <select name="partnerState['+k+'][]" id="partnerState'+k+l+'" class="col-md-4" onchange=\'getDistricts(this.value,"partnerDistrict'+k+l+'")\'> \ <option value="0">Select State</option> \ <?php echo $partnerStatesNew; ?> \ </select> \ </div> \ </div> \ <div class="form-group"> \ <label class="col-md-3" for="district">District</label> \ <div class=""> \ <select name="partnerDistrict['+k+'][]" id="partnerDistrict'+k+l+'" class="col-md-4 partnerDistrict'+k+'"> \ <option value="0">Select District</option> \ </select> \ </div>\ </div>\ </div>\ </div>\ </div>\ </div>'); //add input box//} } $('.input-group.date').datepicker({ calendarWeeks: true, todayHighlight: true, autoclose: true , format:"dd/mm/yyyy" }); }); $(agenciesWrapper).on("click",".removeAgencies", function(e){ //user click on remove text e.preventDefault(); $(this).closest('.tr').remove(); k--; }); function partnerBlockfun(k) { l = document.getElementsByName('partnerState['+k+'][]').length; l++; $(".partnerBlock"+k).append('<div class="tr"><hr style="border-top: 1px solid #c0bdbd;" /> \ <div >\ <input type="hidden" name="partnerID['+k+'][]" value="">\ <input type="hidden" name="partnerOperationsID['+k+'][]" value="">\ </div>\ <a class="action2 pull-right"><i class="fa fa-trash removePartners" aria-hidden="true" ></i></a> \ <div class="form-group">\ <label class="col-md-3" for="state" >State</label>\ <div class="">\ <select name="partnerState['+k+'][]" id="partnerState'+k+l+'" class="col-md-4" onchange=\'getDistricts(this.value,"partnerDistrict'+k+l+'")\'> \ <option value="0">Select State</option> \ <?php echo $newStates; ?> \ </select> \ </div> \ </div> \ <div class="form-group"> \ <label class="col-md-3" for="district">District</label> \ <div class=""> \ <select name="partnerDistrict['+k+'][]" id="partnerDistrict'+k+l+'" class="col-md-4"> \ <option value="0">Select District</option> \ </select> \ </div>\ </div>\ </div>'); } $(document).on("click",".removePartners", function(e){ //user click on remove text e.preventDefault(); $(this).closest('.tr').remove(); }); //Repeat address in MFI var addressBlock = $(".addressBlock"); //Fields wrapper var addAddressBtn = $(".addAddressBtn"); //Add button ID var z = '<?php echo $bcMFIStatesCount; ?>'; $(addAddressBtn).click(function(e) { mfiTalukLength = document.getElementsByName('mfiTaluk[]').length; for(i=0;i<mfiTalukLength;i++) { mfiState = document.getElementsByName('mfiState[]'); mfiDistrict = document.getElementsByName('mfiDistrict[]'); mfiTaluk = document.getElementsByName('mfiTaluk[]'); if(mfiState[i].value.trim() != "" && mfiDistrict[i].value.trim() != "" && mfiTaluk[i].value.trim() != "") { flag1 = 1; } else { flag1 = 0; break; } } if(flag1 == 1) { //alert(); e.preventDefault(); // if(x < max_fields){ //max input box allowed z++; //text box increment $(addressBlock).append('<div class="col-md-12 tr">\ <div class="form-group">\ <label class="col-md-3" for="state" >State</label>\ <div class="">\ <input type="hidden" name="mfiStateID[]" value="">\ <select name="mfiState[]" id="mfiState'+z+'" class="col-md-4" onchange="getMFIDistricts(this.value,'+z+')"> \ <option value="0">Select State</option>\ <?php echo $mfiStatesNew; ?>\ </select>\ </div>\ <a class="action2"><i class="fa fa-trash removeAddressBlock" aria-hidden="true" ></i></a>\ </div>\ <div class="form-group">\ <label class="col-md-3" for="district">District</label>\ <div class="">\ <select name="mfiDistrict[]" id="mfiDistrict'+z+'" class="col-md-4">\ <option value="0">Select District</option>\ </select>\ </div>\ </div>\ <div class="form-group">\ <label class="col-md-3" for="taluk" >Talukas</label>\ <div class="">\ <input type="text" name="mfiTaluk[]" id="mfiTaluk'+z+'" value="" placeholder="Taluk" class="col-md-4" >\ </div>\ </div>\ <hr></div>'); //add input box } else { alert("Please fill all fields first."); } }); $(addressBlock).on("click",".removeAddressBlock", function(e){ //user click on remove text e.preventDefault(); $(this).closest('.tr').remove();z--; }); //Any othe field adding $(document).ready(function() { var max_fields = 5 ; //maximum input boxes allowed var wrapper35 = $(".input_fields_wrap35"); //Fields wrapper var add_button35 = $(".newField"); //Add button ID var other = '<?php echo $otherDetailsCount; ?>'; //initlal text box count $(add_button35).click(function(e) { if(other == 4) { $(".newField").css("display","none"); } //on add input button click e.preventDefault(); if(other < max_fields) { //max input box allowed other++; //text box increment $(wrapper35).append('<tr><td> \ <input type="hidden" name="otherID[]" value="">\ <input type="text" name="otherName[]" id="otherName" value="" placeholder="Any other" > \ </td> \ <td> \ <textarea name="otherDescription[]" id="otherDescription" placeholder=""></textarea> \ </td> \ <td> \ <textarea type="text" name="otherRemarks[]" id="otherRemarks" placeholder=""></textarea> \ <a class="action2 pull-right"><i class="fa fa-trash removeBlock" aria-hidden="true" ></i></a> \ </td></tr>'); //add input box } else { alert("Maximum 5 fields allow"); } }); $(wrapper35).on("click",".removeBlock", function(e){ //user click on remove text if(other <= 5) { $(".newField").css("display","block"); } e.preventDefault(); $(this).closest('tr').remove();other--; }) }); </script> </body> </html>