JezK
Edit File: page2.php
<?php include("header.php"); $_SESSION['sliFormPage'] = 'page2.php'; if(isset($_SESSION['constitution'])) { $constitutionValue= $_SESSION['constitution']; } if(!isset($_SESSION['userID'])) { echo "<script>location.replace('page1.php');</script>"; } if(isset($_SESSION['saveSuccess'])) { echo "<script>alert('Data saved successfully.');</script>"; unset($_SESSION['saveSuccess']); } if(isset($_SESSION['managementSaveFailed'])) { echo "<script>alert('Error!!! Unable to save management details. Internal server error.');</script>"; unset($_SESSION['managementSaveFailed']); } if(isset($_SESSION['managementUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update management details. Internal server error.');</script>"; unset($_SESSION['managementUpdateFailed']); } if(isset($_SESSION['boardMeetingSaveFailed'])) { echo "<script>alert('Error!!! Unable to save board meeting details. Internal server error.');</script>"; unset($_SESSION['boardMeetingSaveFailed']); } if(isset($_SESSION['boardMeetingUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update board meeting details. Internal server error.');</script>"; unset($_SESSION['boardMeetingUpdateFailed']); } if(isset($_SESSION['ceoSaveFailed'])) { echo "<script>alert('Error!!! Unable to save CEO details. Internal server error.');</script>"; unset($_SESSION['ceoSaveFailed']); } if(isset($_SESSION['ceoUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update CEO details. Internal server error.');</script>"; unset($_SESSION['ceoUpdateFailed']); } if(isset($_SESSION['shareSaveFailed'])) { echo "<script>alert('Error!!! Unable to save shares details. Internal server error.');</script>"; unset($_SESSION['shareSaveFailed']); } if(isset($_SESSION['shareUpdateFailed'])) { echo "<script>alert('Error!!! Unable to update shares details. Internal server error.');</script>"; unset($_SESSION['shareUpdateFailed']); } 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['fileUploadFailed'])) { echo "<script>alert('Upload Error!!! Unable to upload management files. Internal server error.');</script>"; unset($_SESSION['fileUploadFailed']); } ?> <div class="container main"> <div class="row"> <form action = "app/page2App.php" enctype="multipart/form-data" class="form-horizontal" method="post" onsubmit="return validatePage2()"> <div class="col-md-12 col-md-offset-0 formContainer"> <h3>Management</h3> <section> <div class="col-md-12 removePadding"> <!--<h3 class="subHead col-md-11 removePadding">Details of the Board Meeting held in last 3 years/Board of trustees/Board of directors/Proprietors/Partners/Authorised Signatories/Principal Share Holders <span class="star">*</span></h3>--> <h3 class="subHead col-md-11 removePadding">Details of the Board of trustees/Board of directors/Proprietors/Partners/Authorised Signatories/Principal Share Holders <span class="star">*</span></h3> <input type="button" class="btn btn-default addBtn1 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;">KYC of Board Member<br> <small> (upload pdf/image only)</small></th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap1"> <?php echo $managementDetails; ?> </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> <input type="button" class="btn btn-default addBtn2 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>Count of Management members</th> --> <th> Count of Board Members</th> <th>No. of Board meetings held</th> <th>Average Attendance(Count)</th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap2"> <?php echo $boardMeeting1Details; ?> </tbody> </table> </div> </div> </section> <section> <div class="col-md-12 removePadding"> <h3 class="subHead col-md-11 removePadding ">Profile of the Key Functionary <span class="star">*</span></h3> <input type="button" class="btn btn-default addBtn3 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</th> <th>Date of appointment</th> <th>Details of association with any other institution</th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap3"> <?php echo $ceoDetails; ?> </tbody> </table> </div> </section> <section> <div id="<? echo $sharedBlockShow; ?>"> <div class="col-md-12 removePadding"> <h3 class="subHead col-md-11 removePadding">Share holding Pattern <span class="star">*</span></h3> <input type="button" class="btn btn-default addBtn4 pull-right" value="Add New" > </div> <div class="col-md-12 removePadding table-responsive"> <table class="table table-bordered cs-table"> <thead> <tr> <th>Name of the share holder</th> <th>No. of shares</th> <th>Face value</th> <th>Premium</th> <th>Percentage of share holding</th> <th>Action</th> </tr> </thead> <tbody class="input_fields_wrap4"> <?php echo $shareDetails; ?> </tbody> </table> </div> </div> </section> <div class="text-center col-md-12"> <a href="page1.php"><input type="button" value="Back" class="btn btn-cs"></a> <input type="submit" value="Next" class="btn btn-cs"> </div> <div class="col-md-12 text-right">2 of 6</div> </div><!--end formContainer--> </form> </div> </div> <?php include"footer.php"?> <script type='text/javascript'> $(document).ready(function() { $('body').on('click',".browse-d",function () { $(this).parents(".form-group").find('.browse-o').click(); }); //var max_fields = ; //maximum input boxes allowed var wrapper1 = $(".input_fields_wrap1"); //Fields wrapper var add_button1 = $(".addBtn1"); //Add button ID var x1 = '<?php echo $managementDetailsCount; ?>'; //initlal text box count $(add_button1).click(function(e) { /*designation = document.getElementById('designation'+x1); name1 = document.getElementById('name'+x1); address = document.getElementById('address'+x1); qualification = document.getElementById('qualification'+x1); experience = document.getElementById('experience'+x1); experienceDetails = document.getElementById('experienceDetails'+x1); otherInstitutionDetails = document.getElementById('otherInstitutionDetails'+x1); managementFileStatus = document.getElementById('managementFileStatus'+x1);*/ designationLength = document.getElementsByName('designation[]').length; for(i=0;i<designationLength;i++) { designation = document.getElementsByName('designation[]'); name1 = document.getElementsByName('name[]'); qualification = document.getElementsByName('qualification[]'); experience = document.getElementsByName('experience[]'); experienceDetails = document.getElementsByName('experienceDetails[]'); otherInstitutionDetails = document.getElementsByName('otherInstitutionDetails[]'); managementFileStatus = document.getElementsByName('managementFileStatus[]'); if(designation[i].value.trim() != "" && name1[i].value.trim() != "" && qualification[i].value.trim() != "" && experience[i].value.trim() != "" && experienceDetails[i].value.trim() != "" && otherInstitutionDetails[i].value.trim() != "" ) { flag = 1; } else { flag = 0; break; } if(managementFileStatus[i].value == 1) { statusFlag = 1; } else { statusFlag = 0; break; } } //if(act.value.trim() != "" && date.value.trim() != "" && place.value.trim() != "" && registrationNumber.value.trim() != "" ) if(flag == 1) { if(statusFlag == 1) { //on add input button click e.preventDefault(); // if(x < max_fields){ //max input box allowed x1++; //text box increment $(wrapper1).append('<tr> \ <td><input type="hidden" name="managementID[]" id="managementID'+x1+'" placeholder=" Name"><input type="text" name="name[]" id="name'+x1+'" placeholder=" Name"></td> \ <td><input type="text" name="designation[]" id="designation'+x1+'" placeholder="Designation"></td> \ <td> \ <div class="input-group date" > \ <input type="text" class="form-control" value="" name="managementDate[]" id="managementDate'+x1+'" placeholder="Date" /> \ <span class="input-group-addon"> \ <span class="glyphicon glyphicon-calendar"></span> \ </span> \ </div> \ </td> \ <td><input type="text" name="address[]" id="address'+x1+'" placeholder="Address"></td> \ <td><textarea type="text" name="qualification[]" id="qualification'+x1+'" placeholder="Qualification"></textarea></td> \ <td><input type="text" name="experience[]" id="experience'+x1+'" placeholder="Experience" onkeypress="return number(event)"></td> \ <td><textarea type="text" name="experienceDetails[]" id="experienceDetails'+x1+'" placeholder="Experience Details"></textarea></td>\ <td><textarea type="text" name="otherInstitutionDetails[]" id="otherInstitutionDetails'+x1+'" placeholder="Details of association"></textarea></td> \ <td> \ <input type="hidden" name="relationshipStatus[]" value="0" id="isRelationshipStatus'+x1+'">\ <input type="radio" name="relationshipStatus'+x1+'[]" id="relationshipStatus'+x1+'" value="1" onclick="saveRelationShipStatus(this.value,'+x1+')"> Yes<br> \ <input type="radio" name="relationshipStatus'+x1+'[]" id="relationshipStatus'+x1+'" value="0" checked onclick="saveRelationShipStatus(this.value,'+x1+')"> No </td> \ <td class="tdWidht"><input type="hidden" name="isAuthorized[]" value="1" id="isAuthorized'+x1+'"><input type="radio" name="authorized'+x1+'[]" id="authorized'+x1+'" value="1" checked onclick="saveIsAuthorized(this.value,'+x1+',0)"> Yes<br><input type="radio" name="authorized'+x1+'[]" id="authorized'+x1+'" value="0" onclick="saveIsAuthorized(this.value,'+x1+',0)">No</td> \ <td><div class="form-group" style="margin:0px;min-widht:120px;"><input type="hidden" name="managementFile[]" value="" id="managementFile'+x1+'"><input type="hidden" value="0" name="managementFileStatus[]" id="managementFileStatus'+x1+'"><input type="file" name="file[]" id="file'+x1+'" value="" class="browse-o" onchange=\'ValidateFileUpload("file'+x1+'","managementFileStatus'+x1+'",'+x1+')\'><button type="button" class="browse-d" id="browse-dd'+x1+'">Browse</button><div id="managementFileUploadStatus'+x1+'" class="divSuccess"></div></div></td> \ <td><a class="action2"><i class="fa fa-trash remove_field1" 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'+x1+'").click(function(){$(this).closest(".form-group").find("#file'+x1+'").click();});'; str+="<"; str+="/script>"; $("body").append(str); }); $(wrapper1).on("click",".remove_field1", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove(); x1--; }); var wrapper2 = $(".input_fields_wrap2"); var add_button2 = $(".addBtn2"); var x2 = '<?php echo $boardMeeting1Count; ?>'; $(add_button2).click(function(e) { year = document.getElementById('year'+x2); boardMeetings = document.getElementById('boardMeetings'+x2); avgAttendance = document.getElementById('avgAttendance'+x2); if(year.value.trim() != "" && boardMeetings.value.trim() != "" && avgAttendance.value.trim() != "") { e.preventDefault(); //if(x < max_fields){ //max input box allowed x2++; //text box increment $(wrapper2).append('<tr>\ <td><input type="hidden" name="boardMeeting1ID[]" value="" id="boardMeeting1ID'+x2+'" placeholder=" Name"><input type="text" name="year[]" id="year'+x2+'" placeholder=" Year" onkeypress="return number3(event)"></td>\ <td><input type="text" name="managementMembersCount[]" id="managementMembersCount'+x2+'" placeholder="Count of Management members" onkeypress="return number(event)"/></td>\ <td><input type="text" name="boardMeetings[]" id="boardMeetings'+x2+'" placeholder="No. of Board meeting held" onkeypress="return number(event)"/></td>\ <td><input type="text" name="avgAttendance[]" id="avgAttendance'+x2+'" placeholder="Average Attendance"></td><td><a class="action2"><i class="fa fa-trash remove_field2" aria-hidden="true" ></i></a></td>\ </tr>'); //add input box //} } 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(); x2--; }) $('.input-group.date').datepicker({ calendarWeeks: true, todayHighlight: true, autoclose: true, format: 'dd/mm/yyyy', "endDate":new Date() }); //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 $ceoDetailsCount; ?>'; //initlal text box count $(add_button3).click(function(e) { /*ceoName = document.getElementById('ceoName'+x3); ceoDesignation = document.getElementById('ceoDesignation'+x3); ceoQualification = document.getElementById('ceoQualification'+x3); ceo_experience = document.getElementById('ceo_experience'+x3); dateOfAppointment = document.getElementById('dateOfAppointment'+x3); ceoAssociationDetails = document.getElementById('ceoAssociationDetails'+x3); alert(ceo_experience.value); if(ceoName.value.trim() != "" && ceoDesignation.value.trim() != "" && ceoQualification.value.trim() != "" && ceo_experience.value.trim() != "" && dateOfAppointment.value.trim() != "" && ceoAssociationDetails.value.trim() != "") {*/ ceoNameLength = document.getElementsByName('ceoName[]').length; for(i=0;i<ceoNameLength;i++) { ceoName = document.getElementsByName('ceoName[]'); ceoDesignation = document.getElementsByName('ceoDesignation[]'); ceoQualification = document.getElementsByName('ceoQualification[]'); ceo_experience = document.getElementsByName('ceo_experience[]'); ceoAssociationDetails = document.getElementsByName('ceoAssociationDetails[]'); dateOfAppointment = document.getElementsByName('dateOfAppointment[]'); if(ceoName[i].value.trim() != "" && ceoDesignation[i].value.trim() != "" && ceoQualification[i].value.trim() != "" && ceo_experience[i].value.trim() != "" && dateOfAppointment[i].value.trim() != "" && ceoAssociationDetails[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 x3++; //text box increment $(wrapper3).append('<tr><td><input type="hidden" name="ceoID[]" value="" id="ceoID'+x3+'" placeholder=" Name"><input type="text" name="ceoName[]" id="ceoName'+x3+'" placeholder=" Name"></td><td><input type="text" name="ceoDesignation[]" id="ceoDesignation'+x3+'" placeholder="Designation" /></td><td><input type="text" name="ceoQualification[]" id="ceoQualification'+x3+'" placeholder="Qualification"></td><td><input type="text" name="ceo_experience[]" id="experience'+x3+'" placeholder="Experience "></td><td><div class="input-group date" ><input type="text" class="form-control" name="dateOfAppointment[]" id="dateOfAppointment'+x3+'" placeholder="Date of appointment" /><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div></td><td class="td4"><textarea name="ceoAssociationDetails[]" id="ceoAssociationDetails'+x3+'" placeholder="Details of association with any other institution" /></textarea></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', "endDate":new Date() }); } else { alert("Please fill all fields first."); } }); $(wrapper3).on("click",".remove_field3", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove(); x3--; }); var wrapper4 = $(".input_fields_wrap4"); var add_button4 = $(".addBtn4"); var x = '<?php echo $shareDetailsCount; ?>'; $(add_button4).click(function(e) { shareHolderName = document.getElementById('shareHolderName'+x); numberOfShares = document.getElementById('numberOfShares'+x); faceValue = document.getElementById('faceValue'+x); premium = document.getElementById('premium'+x); shareHoldingPercentage = document.getElementById('shareHoldingPercentage'+x); if(shareHolderName.value.trim() != "" && numberOfShares.value.trim() != "" && faceValue.value.trim() != "" && premium.value.trim() != "" && shareHoldingPercentage.value.trim() != "") { e.preventDefault(); // if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper4).append('<tr><td><input type="hidden" name="shareID[]" value="" id="shareID'+x+'" placeholder=" Name"><input type="text" name="shareHolderName[]" id="shareHolderName'+x+'" placeholder=" Name of the share holder"></td><td><input type="text" name="numberOfShares[]" id="numberOfShares'+x+'" placeholder="No. of shares" onkeypress="return number(event)" /></td>\ <td><input type="text" name="faceValue[]" id="faceValue'+x+'" class="faceValue" placeholder="Face value" value="" readonly></td>\ <td><input type="text" name="premium[]" id="premium'+x+'" class="premium" placeholder="Premium" value="" " readonly /></td>\ <td><input type="text" name="shareHoldingPercentage[]" id="shareHoldingPercentage'+x+'" placeholder="Percentage of share holding" value=""></td>\ <td><a class="action2"><i class="fa fa-trash remove_field4" aria-hidden="true" ></i></a></td></tr>'); //add input box //} faceValue1 = document.getElementById('faceValue1').value; premium1 = document.getElementById('premium1').value; document.getElementById('faceValue'+x).value=faceValue1; document.getElementById('premium'+x).value=premium1; } else { alert("Please fill all fields first."); } }); $(wrapper4).on("click",".remove_field4", function(e){ //user click on remove text e.preventDefault(); $(this).closest('tr').remove(); x--; }) }); function number(e) { 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) { 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 number3(e) { var key = e.keyCode || e.charCode; if(key == 13 || key == 43 || (key >= 48 && key <= 57) || key == 8 || key == 46 || key==45) { return true; } else { return false; } } function validatePage2() { var shareDetails = '<?php echo $shareDetailsCount; ?>'; name1 = document.getElementById('name1'); designation = document.getElementById('designation1').value; bcManagementDate = document.getElementById('managementDate1'); address = document.getElementById('address1'); qualification = document.getElementById('qualification1'); experience = document.getElementById('experience1'); experienceDetails = document.getElementById('experienceDetails1'); otherInstitutionDetails = document.getElementById('otherInstitutionDetails1'); managementFileStatus = document.getElementById('managementFileStatus1'); year = document.getElementById('year1'); boardMeetings = document.getElementById('boardMeetings1'); avgAttendance = document.getElementById('avgAttendance1'); boardMeetings2 = document.getElementById('boardMeetings2'); avgAttendance2 = document.getElementById('avgAttendance2'); boardMeetings3 = document.getElementById('boardMeetings3'); avgAttendance3 = document.getElementById('avgAttendance3'); ceoName = document.getElementById('ceoName1'); ceoDesignation = document.getElementById('ceoDesignation1'); ceoQualification = document.getElementById('ceoQualification1'); ceo_experience = document.getElementById('ceo_experience1'); dateOfAppointment = document.getElementById('dateOfAppointment1'); ceoAssociationDetails = document.getElementById('ceoAssociationDetails1'); if(shareDetails != '') { shareHolderName = document.getElementById('shareHolderName1'); numberOfShares = document.getElementById('numberOfShares1'); faceValue = document.getElementById('faceValue1'); premium = document.getElementById('premium1'); shareHoldingPercentage = document.getElementById('shareHoldingPercentage1'); } if(name1.value.trim() == '') { alert("Please enter management name."); return false; } if(designation == 0) { alert("Please enter designation."); return false; } if(bcManagementDate.value.trim() == '') { alert("Please select management date."); bcManagementDate.focus(); return false; } if(address.value.trim() == '') { alert("Please enter address."); return false; } if(qualification.value.trim() == '') { alert("Please enter qualification."); return false; } if(experience.value.trim() == '') { alert("Please enter experience."); return false; } if(experienceDetails.value.trim() == '') { alert("Please enter experience details."); return false; } if(otherInstitutionDetails.value.trim() == '') { alert("Please enter other institution details."); return false; } //alert(managementFileStatus.value); if(managementFileStatus.value == 0) { alert("Please upload a valid management file."); return false; } /*if(year.value.trim() == '') { alert("Please enter year."); year.value = ""; year.focus(); return false; } if(boardMeetings.value.trim() == '') { alert("Please enter no. of board meetings."); boardMeetings.value = ""; boardMeetings.focus(); return false; } if(avgAttendance.value.trim() == '') { alert("Please enter average attendance."); avgAttendance.value = ""; avgAttendance.focus(); return false; }*/ if(ceoName.value.trim() == '') { //alert(managementFileStatus.value); alert("Please enter key functionary name."); ceoName.value = ""; ceoName.focus(); return false; } if(ceoDesignation.value.trim() == '') { alert("Please enter designation."); ceoDesignation.value = ""; ceoDesignation.focus(); return false; } if(ceoQualification.value.trim() == '') { alert("Please enter qualification."); ceoQualification.value = ""; ceoQualification.focus(); return false; } if(ceo_experience.value.trim() == '') { alert("Please enter experience."); ceo_experience.value = ""; ceo_experience.focus(); return false; } if(dateOfAppointment.value.trim() == '') { alert("Please enter date of appointment."); dateOfAppointment.value = ""; dateOfAppointment.focus(); return false; } if(ceoAssociationDetails.value.trim() == '') { alert("Please enter association details."); ceoAssociationDetails.value = ""; ceoAssociationDetails.focus(); return false; } if(shareDetails != '') { if(shareHolderName.value.trim() == '') { alert("Please enter share holder name."); shareHolderName.value = ""; shareHolderName.focus(); return false; } if(numberOfShares.value.trim() == '') { alert("Please enter number of shares."); numberOfShares.value = ""; numberOfShares.focus(); return false; } if(faceValue.value.trim() == '') { alert("Please enter face value."); faceValue.value = ""; faceValue.focus(); return false; } if(premium.value.trim() == '') { alert("Please enter premium."); premium.value = ""; premium.focus(); return false; } if(shareHoldingPercentage.value.trim() == '') { alert("Please enter share holding percentage."); shareHoldingPercentage.value = ""; shareHoldingPercentage.focus(); return false; } } return true; } function ValidateFileUpload(fileID,fileStatusID,ID) { pdfFlag = 0; var fuData = document.getElementById(fileID); var fileStatus = document.getElementById(fileStatusID); var managementFileUploadStatus= document.getElementById('managementFileUploadStatus'+ID); var FileUploadPath = fuData.value; //To check if user upload any file if (FileUploadPath == '') { alert("Please upload a pdf/image file."); managementFileUploadStatus.innerHTML ='<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 == "jpg" || Extension == "jpeg" || Extension == "png") { //var size=1048576; var size=5242880; var file_size=fuData.files[0].size; if(file_size>=size) { alert('File too large'); managementFileUploadStatus.innerHTML ='<span class="fail"></span>'; fileStatus.value = 0; pdfFlag = 0; } else { pdfFlag = 1; managementFileUploadStatus.innerHTML = '<span class="success"></span>'; fileStatus.value = 1; } } //The file upload is NOT an pdf else { alert("Please upload a pdf/image file."); managementFileUploadStatus.innerHTML = '<span class="fail"></span>'; fileStatus.value = 0; } } } 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; //~ document.getElementById('managementFileStatus'+i).value = 0; //~ } //~ 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; } $(document).ready(function(){ $("#faceValue1").keyup(function(){ var faceValue1=$("#faceValue1").val(); $('.faceValue').val(faceValue1); }); $("#premium1").keyup(function(){ var premium1=$("#premium1").val(); $('.premium').val(premium1); }); }); </script>