JezK
Edit File: page6old.php
<?php include("header.php"); $_SESSION['bcFormPage'] = "page6.php"; if(!isset($_SESSION['bcFormUserID'])) { echo "<script>location.replace('page1.php');</script>"; } if(isset($_SESSION['saveSuccess'])) { echo "<script>alert('Data saved successfully.');</script>"; unset($_SESSION['saveSuccess']); } 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['bankSaveFailed'])) { echo "<script>alert('Error!!! Unable to save bank details. Internal server error.');</script>"; unset($_SESSION['bankSaveFailed']); } if(isset($_SESSION['bankUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update bank details. Internal server error.');</script>"; unset($_SESSION['bankUpdateFailed']); } 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['authorisedSaveFailed'])) { echo "<script>alert('Error!!! Unable to save authorised details. Internal server error.');</script>"; unset($_SESSION['authorisedSaveFailed']); } if(isset($_SESSION['authorisedUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update authorised details. Internal server error.');</script>"; unset($_SESSION['authorisedUpdateFailed']); } 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['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']); } //echo "<pre>";print_r($details["bcManagementDetails"]);exit; ?> <div class="container main"> <div class="row"> <form action = "app/page6App.php" class="form-horizontal" enctype="multipart/form-data" method="post" onsubmit="return validatePage6()"> <div class="col-md-12 text-cneter formContainer"> <section> <div class="col-md-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> <div class="agenciesWrapper"> <input type="button" class="col-md-1 btn btn-default addAgenciesBtn pull-right " value="Add New" > <div class="form-group"> <label class="col-md-3" for="nameOfThePartnerAgencies" >Name of the Partner Agencies</label> <div class=""> <input type="text" name="partnerAgencies" id="partnerAgencies" value="<?php echo $partnerAgencies; ?>" 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" id="duration" value="<?php echo $duration; ?>" 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" id="durationTo" value="<?php echo $durationTo; ?>" 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-11">Area of operations</h3> <input type="button" class="col-md-1 btn btn-default addFieldsBtn12 pull-right " value="Add New" > </div> <?php echo $partnerDetails; ?> </div> </div> </div> <div class="form-group"> <label class="col-md-10" for="dateOfResolution" >Date & Reference of resolution passed by the governing body for applying for empanelment as Business Correspondent / Business Facilitator of NABFINS <span class="star">*</span></label> <div class='input-group date col-md-2' > <input type='text' class="form-control" name="facilitatorDate" id="facilitatorDate" value="<?php echo $facilitatorDate; ?>" placeholder="" readonly /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> <div class="form-group"> <label class="col-md-3 labelPadding" >Upload resolution:<small> (upload pdf only)</small></label> <input type="file" name="resolutionFile" id="resolutionFile" value="" class="browse-o" onchange="ValidateFileUpload2('resolutionFile')"> <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="validatePDF2(6,'resolutionFile')">--> <div id="uploadStatus" class="divSuccess"><?php echo $resolutionFileUploadStatus; ?></div> </div> <h3 class="col-md-11 removePadding">Proposed Area/ Villages proposed to be covered <span class="star">*</span></h3> <div class="col-md-1"><input type="button" class="btn btn-default addNewBtn text-right" value="Add New" ></div> <!--<div> <div class="form-group"> <label class="col-md-3" for="address" >Address</label> <textarea name="proposedAddress" id="proposedAddress" class="col-md-3" rows="3"></textarea> </div> </div>--> <?php echo $proposedDetails; ?> <div class="form-group"> <label class="col-md-3" for="proposedActivities">Details of services / activities proposed to be rendered to NABFINS <span class="star">*</span></label> <!--<div class=""> <select name="proposedActivities" id="proposedActivities" class="col-md-4"> <option value="0" <?php echo $proposedActivities0; ?>>Select Activity</option> <option value="1" <?php echo $proposedActivities1; ?>>B&DC SHG and JLG</option> <option value="2" <?php echo $proposedActivities2; ?>>B&DF SHG and JLG</option> </select> </div>--> <div class="col-md-0"> <input type="text" value="<?php echo $proposedActivity; ?>" id="proposedActivities" name="proposedActivities" class="col-md-4" readonly> </div> </div> </section> <section> <?php echo $authorisedDetails; ?> </section> <section> <div class="col-md-12 removePadding" style="padding-top:10px;"> <h3 class="subHead col-md-11 removePadding" >Details of the Bank Accounts: <span class="star">*</span></h3> <input type="button" class="col-md-1 btn btn-default addFieldsBtn 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 of the Bank</th> <th>Branch Name</th> <th>Account Number</th> <th>IFSC Code</th> <th>Upload Passbook <br><small> (upload pdf only)</small></th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap11"> <?php echo $bcBankAccountsDetails; ?> </tbody> </table> </div> </section> <div class="text-center"> <a href="page5.php"><input type="button" value="Back" class="btn btn-cs"></a> <input type="submit" value="Submit" class="btn-cs btn"> </div> <div class="col-md-12 text-right">6 of 6</div> </div><!--end formContainer--> </form> </div> </div> <?php include"footer.php"?> <script> pdfFlag = 0; pdfFlag2 = 0; $(document).ready(function() { var isFacilitator = '<?php echo $isFacilitator; ?>'; if(isFacilitator == '' || isFacilitator == 0) { document.getElementById('facilitatorDiv').style.display = 'none'; document.getElementById('partnerAddress1').value = ''; document.getElementById('partnerState1').value = 0; document.getElementById('partnerDistrict1').value = 0; } $('.input-group.date').datepicker({ calendarWeeks: true, todayHighlight: true, autoclose: true , format: "dd/mm/yyyy" }); $(".browse-d").click(function(){ $(this).closest(".form-group").find('.browse-o').click(); }); //var max_fields = ; //maximum input boxes allowed var wrapper = $(".input_fields_wrap11"); //Fields wrapper var add_button = $(".addFieldsBtn"); //Add button ID var x = '<?php echo $bcBankAccountsCount; ?>'; //initlal text box count $(add_button).click(function(e) { /*bankName = document.getElementById('bankName'+x); branch = document.getElementById('branch'+x); accountNumber = document.getElementById('accountNumber'+x); ifsc = document.getElementById('ifsc'+x); bankFileStatus = document.getElementById('bankFileStatus'+x);*/ bankName = document.getElementById('bankName1'); branch = document.getElementById('branch1'); accountNumber = document.getElementById('accountNumber1'); ifsc = document.getElementById('ifsc1'); bankFileStatus = document.getElementById('bankFileStatus1'); if(bankName.value.trim() != "" && branch.value.trim() != "" && accountNumber.value.trim() != "" && ifsc.value.trim() != "") { if(bankFileStatus.value == 1) { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper).append('<tr><td><input type="hidden" name="bankID[]" id="bankID'+x+'" value=""><input type="text" name="bankName[]" id="bankName'+x+'" placeholder="Bank Name"></td><td><input type="text" name="branch[]" id="branch'+x+'" placeholder="Branch"></td><td><input type="text" name="accountNumber[]" id="accountNumber'+x+'" placeholder="Account Number" /></td><td><input type="text" name="ifsc[]" id="ifsc'+x+'" maxlength="11" placeholder="IFSC Code" /></td><td><div class="form-group" style="margin:0px;display: inline-block;"><input type="hidden" name="bankFile[]" id="bankFile'+x+'" value=""><input type="hidden" value="0" id="bankFileStatus'+x+'"><input type="file" name="file[]" id="file'+x+'" value="" class="browse-o" id="browse-o'+x+'" name="browse[]" onchange=\'ValidateFileUpload("file'+x+'",'+x+')\'><button type="button" class="browse-d" id="browse-d'+x+'">Browse</button><div id="fileUploadStatus'+x+'" class="divSuccess"></div></div></td><td><a class="action2"><i class="fa fa-trash remove_field" 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'+x+'").click(function(){$(this).closest(".form-group").find("#file'+x+'").click();});'; str+="<"; str+="/script>"; $("body").append(str); }); $(wrapper).on("click",".remove_field", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove(); }); //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=\'getDistricts(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(); }); //var max_fields = ; //maximum input boxes allowed 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;*/ taluk = document.getElementById('proposedTaluk1').value; state = document.getElementById('proposedState1').value; district = document.getElementById('proposedDistrict1').value; if(taluk.trim() != "" && state != 0 && district != 0) { //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=\'getDistricts(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(); }); var max_fields = 7; //maximum input boxes allowed var agenciesWrapper = $(".agenciesWrapper"); //Fields wrapper var addAgenciesBtn = $(".addAgenciesBtn"); //Add button ID var k = 1; //initlal text box count $(addAgenciesBtn).click(function(e) { //on add input button click e.preventDefault(); if(k < max_fields) { //max input box allowed k++; //text box increment $(agenciesWrapper).append(' <div class="tr" > \ <div class="col-md-1 pull-right">\ <a class="action2 "><i class="fa fa-trash removeAgencies" aria-hidden="true" ></i></a>\ </div> \ <div class="form-group">\ <label class="col-md-3" for="nameOfThePartnerAgencies" >Name of the Partner Agencies</label>\ <div class="">\ <input type="text" name="partnerAgencies" id="partnerAgencies" value="<?php echo $partnerAgencies; ?>" 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" id="duration" value="<?php echo $duration; ?>" 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" id="durationTo" value="<?php echo $durationTo; ?>" 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-11">Area of operations</h3>\ <input type="button" class="col-md-1 btn btn-default addFieldsBtn12 pull-right " value="Add New" >\ </div> \ <?php echo $partnerDetailsNew; ?>\ </div>\ </div>\ </div>'); //add input box//} } }); $(agenciesWrapper).on("click",".removeAgencies", function(e){ //user click on remove text e.preventDefault(); $(this).closest('.tr').remove(); }); }); 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 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 getDistricts(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:1,stateID:stateID},function(data) { document.getElementById(district).innerHTML = '<option value="0">Select District</option>'+data; }); } } function ValidateFileUpload(fileID,i) { pdfFlag = 0; var fuData = document.getElementById(fileID); var bankFileStatus = document.getElementById('bankFileStatus'+i); var uploadStatus = document.getElementById('fileUploadStatus'+i); var FileUploadPath = fuData.value; //To check if user upload any file if (FileUploadPath == '') { alert("Please upload a pdf file."); uploadStatus.innerHTML = '<span class="fail"></span>'; bankFileStatus.value = 0; pdfFlag = 0; } else { var Extension = FileUploadPath.substring( FileUploadPath.lastIndexOf('.') + 1).toLowerCase(); //The file uploaded is an pdf if (Extension == "pdf") { var size=5242880; var file_size=fuData.files[0].size; if(file_size>=size) { alert('File too large'); bankFileStatus.value = 0; uploadStatus.innerHTML = '<span class="fail"></span>'; pdfFlag = 0; } else { pdfFlag = 1; bankFileStatus.value = 1; uploadStatus.innerHTML = '<span class="success"></span>'; } } //The file upload is NOT an pdf else { alert("Please upload a pdf file."); uploadStatus.innerHTML = '<span class="fail"></span>'; bankFileStatus.value = 0; } } } function ValidateFileUpload2(fileID) { pdfFlag2 = 0; var fuData = document.getElementById(fileID); var bankFileStatus = document.getElementById('txtResolutionUpload'); var uploadStatus = document.getElementById('uploadStatus'); var FileUploadPath = fuData.value; //To check if user upload any file if (FileUploadPath == '') { alert("Please upload a pdf file."); bankFileStatus.value = 0; uploadStatus.innerHTML = '<span class="fail"></span>'; pdfFlag2 = 0; } else { var Extension = FileUploadPath.substring( FileUploadPath.lastIndexOf('.') + 1).toLowerCase(); //The file uploaded is an pdf if (Extension == "pdf") { var size=5242880; var file_size=fuData.files[0].size; if(file_size>=size) { alert('File too large'); bankFileStatus.value = 0; uploadStatus.innerHTML = '<span class="fail"></span>'; pdfFlag2 = 0; } else { pdfFlag2 = 1; bankFileStatus.value = 1; uploadStatus.innerHTML = '<span class="success"></span>'; } } //The file upload is NOT an pdf else { alert("Please upload a pdf file."); bankFileStatus.value = 0; uploadStatus.innerHTML = '<span class="fail"></span>'; } } } function validatePage6() { facilitatorYes = document.getElementById('facilitatorYes'); txtResolutionUpload = document.getElementById('txtResolutionUpload'); if(facilitatorYes.checked == true) { bcBfDescription = document.getElementById('bcBfDescription'); partnerAgencies = document.getElementById('partnerAgencies'); duration = document.getElementById('duration'); durationTo = document.getElementById('durationTo'); partnerAddress = document.getElementById('partnerAddress1'); partnerState = document.getElementById('partnerState1'); partnerDistrict = document.getElementById('partnerDistrict1'); //facilitatorDate = document.getElementById('facilitatorDate'); //txtResolutionUpload = document.getElementById('txtResolutionUpload'); if(bcBfDescription.value.trim() == '') { alert("Please enter bcBfDescription."); bcBfDescription.value = ""; bcBfDescription.focus(); return false; } if(partnerAgencies.value.trim() == '') { alert("Please enter partner agencies."); partnerAgencies.value = ""; partnerAgencies.focus(); return false; } if(duration.value.trim() == '') { alert("Please enter duration."); duration.value = ""; duration.focus(); return false; } if(durationTo.value.trim() == '') { alert("Please enter duration to date."); durationTo.value = ""; durationTo.focus(); return false; } if(partnerAddress.value.trim() == '') { alert("Please enter partner address."); partnerAddress.value = ""; partnerAddress.focus(); return false; } if(partnerState.value == 0) { alert("Please select state."); partnerState.focus(); return false; } if(partnerDistrict.value == 0) { alert("Please select district."); partnerDistrict.focus(); return false; } /*if(facilitatorDate.value.trim() == '') { alert("Please enter facilitator date."); facilitatorDate.value = ""; facilitatorDate.focus(); return false; } if(txtResolutionUpload.value == 0) { alert("Please upload a valid resolution file."); return false; }*/ } /*if(txtResolutionUpload.value == 0) { alert("Please upload a valid resolution file."); return false; }*/ FileUploadPath = document.getElementById('resolutionFile').value; //To check if user upload any file if (FileUploadPath != '') { if(txtResolutionUpload.value == 0) { alert("Please upload a valid resolution file."); return false; } } //proposedAddress = document.getElementById('proposedAddress'); proposedState = document.getElementById('proposedState1'); proposedDistrict = document.getElementById('proposedDistrict1'); proposedTaluk = document.getElementById('proposedTaluk1'); proposedActivities = document.getElementById('proposedActivities'); /*if(proposedAddress.value.trim() == '') { alert("Please enter proposed address."); proposedAddress.value = ""; proposedAddress.focus(); return false; }*/ if(proposedState.value == 0) { alert("Please select state."); proposedState.focus(); return false; } if(proposedDistrict.value == 0) { alert("Please select district."); proposedDistrict.focus(); return false; } if(proposedTaluk.value.trim() == '') { alert("Please enter proposed taluk."); proposedTaluk.value = ""; proposedTaluk.focus(); return false; } if(proposedActivities.value == 0) { alert("Please select proposed activity."); proposedActivities.focus(); return false; } authorisedSignatures = '<?php echo count($authorisedSignatures); ?>'; if(authorisedSignatures > 0) { authorisedName = document.getElementsByName('authorisedName[]'); authorizedFathersName = document.getElementsByName('authorizedFathersName[]'); authorisedDesignation = document.getElementsByName('authorisedDesignation[]'); authorisedAge = document.getElementsByName('authorisedAge[]'); authorisedQualification = document.getElementsByName('authorisedQualification[]'); authorisedExperience = document.getElementsByName('authorisedExperience[]'); authorisedLanguages = document.getElementsByName('authorisedLanguages[]'); authorisedAddress = document.getElementsByName('authorisedAddress[]'); authorisedContact = document.getElementsByName('authorisedContact[]'); for(i=0;i<authorisedSignatures;i++) { if(authorisedName[i].value.trim() == '') { alert("Please enter authorised name."); authorisedName[i].value = ""; authorisedName[i].focus(); return false; } if(authorizedFathersName[i].value.trim() == "") { alert("Please enter fathers name."); authorizedFathersName[i].value = ""; authorizedFathersName[i].focus(); return false; } if(authorisedDesignation[i].value.trim() == "") { alert("Please enter designation."); authorisedDesignation[i].value = ""; authorisedDesignation[i].focus(); return false; } if(authorisedAge[i].value.trim() == '') { alert("Please enter age."); authorisedAge[i].value = ""; authorisedAge[i].focus(); return false; } if(authorisedQualification[i].value.trim() == '') { alert("Please enter qualification."); authorisedQualification[i].value = ""; authorisedQualification[i].focus(); return false; } if(authorisedExperience[i].value.trim() == "") { alert("Please enter experience."); authorisedExperience[i].value = ""; authorisedExperience[i].focus(); return false; } if(authorisedLanguages[i].value.trim() == '') { alert("Please enter language."); authorisedLanguages[i].focus(); return false; } if(authorisedAddress[i].value.trim() == '') { alert("Please enter address."); authorisedAddress[i].value = ""; authorisedAddress[i].focus(); return false; } if(authorisedContact[i].value.trim() == '') { alert("Please enter contact."); authorisedContact[i].value = ""; authorisedContact[i].focus(); return false; } } } bankName = document.getElementById('bankName1'); branch = document.getElementById('branch1'); accountNumber = document.getElementById('accountNumber1'); ifsc = document.getElementById('ifsc1'); ifscCodeReg = /^[A-Z|a-z]{4}[0][\d|A-Z|a-z]{6}$/; bankFileStatus = document.getElementById('bankFileStatus1'); if(bankName.value.trim() == "") { alert("Please enter bank name."); bankName.value = ""; bankName.focus(); return false; } if(branch.value.trim() == '') { alert("Please enter branch."); branch.value = ""; branch.focus(); return false; } if(accountNumber.value.trim() == '') { alert("Please enter account number."); accountNumber.value = ""; accountNumber.focus(); return false; } if(ifsc.value.trim() == "") { alert("Please enter ifsc."); ifsc.value = ""; ifsc.focus(); return false; } if (!ifscCodeReg.test(ifsc.value.trim())) { alert('Please enter valid ifscCode.'); return false; } if(bankFileStatus.value == 0) { alert("Please upload a valid file."); return false; } return true; } function validatePDF2(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 displayFacilitator(i) { if(i == 0) { document.getElementById('facilitatorDiv').style.display = "none"; } else { document.getElementById('facilitatorDiv').style.display = "block"; } } </script>