From 02e4637ab66397895652f5c8c830a2dcfcb40ea9 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 18 Dec 2017 10:38:38 +0530 Subject: [PATCH] changes for sweetalert --- application/views/addRawMaterial.php | 8 +-- application/views/addconfig.php | 18 ++--- application/views/addemployee.php | 72 +++++++++---------- application/views/addstorerequisitionslip.php | 24 +++---- application/views/addsupplier.php | 42 +++++------ .../views/approvalstorerequisitionslip.php | 2 +- application/views/companyview.php | 42 +++++------ application/views/editrequisitionform.php | 32 ++++----- application/views/includes/header.php | 6 +- application/views/requisitionform.php | 42 +++++------ assets/dist/css/AdminLTE.min.css | 2 +- 11 files changed, 147 insertions(+), 143 deletions(-) diff --git a/application/views/addRawMaterial.php b/application/views/addRawMaterial.php index 93f9c14a..e3c48fb9 100644 --- a/application/views/addRawMaterial.php +++ b/application/views/addRawMaterial.php @@ -282,26 +282,26 @@ function Validate() { if($("#MaterialName").val().length < 1) { - alert('Please Enter MaterialName'); + swal('Please Enter MaterialName'); $("#MaterialName").focus(); return false; } if($("option:selected", $("#UOM")).val() == "") { - alert('Please Select UOM '); + swal('Please Select UOM '); $("#UOM").focus(); return false; } if($("option:selected", $("#MaterialCategory")).val() == "") { - alert('Please Select Material Category'); + swal('Please Select Material Category'); $("#MaterialCategory").focus(); return false; } if($("option:selected", $("#MaterialType")).val() == "") { - alert('Please Select Material Type'); + swal('Please Select Material Type'); $("#MaterialType").focus(); return false; } diff --git a/application/views/addconfig.php b/application/views/addconfig.php index a4ccde01..a82617ed 100644 --- a/application/views/addconfig.php +++ b/application/views/addconfig.php @@ -373,7 +373,7 @@ $("#Edit").on("shown.bs.modal", function(e) { } else { - alert('Please enter all the values'); + swal('Please enter all the values'); } @@ -426,7 +426,7 @@ $('.tempClickEdit').click(function(){ } else { - alert('Please enter all the values'); + swal('Please enter all the values'); } @@ -541,7 +541,7 @@ function CountRows() { tempText = ''; Selectedval = ''; } else { - alert("Before add please select any position."); + swal("Before add please select any position."); } }); @@ -559,7 +559,7 @@ function CountRows() { $("#distriList").val(tempSelect); tempSelect = ''; } else { - alert("Before remove please select any position."); + swal("Before remove please select any position."); } }); @@ -578,7 +578,7 @@ function CountRows() { if(data) { $('#content').loader('hide'); - alert(data); + swal(data); $('#txtSelectedDepartment').val(''); $('#txtRowCount').val(''); @@ -587,7 +587,7 @@ function CountRows() { } else { - alert("Error"); + swal("Error"); } } @@ -603,17 +603,17 @@ function validate() if($("#txtSelectedDepartment").val().length < 1) { - alert('Please Select Department'); + swal('Please Select Department'); return false; } else if($("#txtRowCount").val().length < 1) { - alert('Please Add Budget'); + swal('Please Add Budget'); return false; } else if($("option:selected", $("#ApprovedBy")).val() == '-1') { - alert('Please Select Approver Names'); + swal('Please Select Approver Names'); return false; } else diff --git a/application/views/addemployee.php b/application/views/addemployee.php index 21a02a5b..d3f9ee48 100644 --- a/application/views/addemployee.php +++ b/application/views/addemployee.php @@ -65,7 +65,7 @@ $(function(){ function blockKeyPress(evt) { var charCode = (evt.which) ? evt.which : evt.keyCode; - alert(charCode); + swal(charCode); if(charCode == 8 || charCode == 46 ) { @@ -103,7 +103,7 @@ var PAN = $('#panno').val(); { if (regpan.test(PAN) == false) { - alert('Please Enter Valid PAN Number'); + swal('Please Enter Valid PAN Number'); return (false); } else @@ -133,7 +133,7 @@ function ValidateAadhar(){ if(reg.test(aadhar)== false) { //alert('alskdjsakjf'); - alert('Please Enter Valid Aadhar Number'); + swal('Please Enter Valid Aadhar Number'); return (false); } else @@ -156,7 +156,7 @@ function getMobileValidation() { var contactNumber = $('#ContactNumber').val().length; if(contactNumber < 10) { - alert('Please Enter valid Contact Number'); + swal('Please Enter valid Contact Number'); return false; } else @@ -168,7 +168,7 @@ function getValidEmergencyNumber() { var contactNumber = $('#emergencycontactnumber').val().length; if(contactNumber < 10) { - alert('Please Enter valid Emergency Contact Number'); + swal('Please Enter valid Emergency Contact Number'); return false; } else @@ -180,7 +180,7 @@ function getValidReferNumber() { var contactNumber = $('#referrercontno').val().length; if(contactNumber > 0 && contactNumber < 10) { - alert('Please Enter valid Refernce Contact Number'); + swal('Please Enter valid Refernce Contact Number'); return false; } else @@ -197,7 +197,7 @@ function validateEmail() { { if (reg.test(email) == false) { - alert('Please Enter Valid Personal Email Address'); + swal('Please Enter Valid Personal Email Address'); return (false); } else @@ -207,7 +207,7 @@ function validateEmail() { } else { - alert('Please Enter email id'); + swal('Please Enter email id'); } } @@ -220,7 +220,7 @@ function validatecomEmail() { { if (reg.test(email) == false) { - alert('Please Enter Valid Company Email Address'); + swal('Please Enter Valid Company Email Address'); return (false); } else @@ -230,7 +230,7 @@ function validatecomEmail() { } else { - alert('Please Enter email id'); + swal('Please Enter email id'); } } @@ -244,7 +244,7 @@ function validateDriverLicense() { { if (reg.test(VehicleNo) == false) { - alert('Please Enter Valid Driver License Number'); + swal('Please Enter Valid Driver License Number'); return (false); } else @@ -339,7 +339,7 @@ function ValidatePassport() //alert(passport); if(regsaid.test(passport) == false) { - alert('You have entered invalid Passport.'); + swal('You have entered invalid Passport.'); return (false); } else @@ -377,7 +377,7 @@ function validatePF() { { if (regpf.test(PF) == false) { - alert('Please Enter Valid PF Number'); + swal('Please Enter Valid PF Number'); return (false); } else @@ -397,7 +397,7 @@ function validateESI() { { if (reg.test(ESI) == false) { - alert('Please Enter Valid ESI Number'); + swal('Please Enter Valid ESI Number'); return (false); } else @@ -846,28 +846,28 @@ function Validate() { if($("#FirstName").val().length < 1) { - alert('Please Enter FirstName'); + swal('Please Enter FirstName'); $("#FirstName").focus(); return false; } if($("#LastName").val().length < 1) { - alert('Please Enter LastName'); + swal('Please Enter LastName'); return false; } if($("#FatherName").val().length < 1) { - alert('Please Enter FatherName'); + swal('Please Enter FatherName'); return false; } if($("#DateofBirth").val().length < 1) { - alert('Please Enter Date of Birth'); + swal('Please Enter Date of Birth'); return false; } if ( $('#ContactNumber').val().length < 1 ) { - alert('Please Enter Contact Number'); + swal('Please Enter Contact Number'); return false; } else if(!getMobileValidation()) @@ -878,7 +878,7 @@ function Validate() if($("#emailid").val().length < 1) { - alert('Please Enter Personal Email ID'); + swal('Please Enter Personal Email ID'); return false; } else if(!validateEmail()) @@ -888,7 +888,7 @@ function Validate() if($("#mail").val().length < 1) { - alert('Please Enter Company Email ID'); + swal('Please Enter Company Email ID'); return false; } else if(!validatecomEmail()) @@ -898,42 +898,42 @@ function Validate() if($("option:selected", $("#gender")).val() == '-1') { - alert('Please Select Gender'); + swal('Please Select Gender'); $('#gender').focus(); return false; } if($("option:selected", $("#MartialStatus")).val() == "-1") { - alert('Please Select Martial Status'); + swal('Please Select Martial Status'); $('#MartialStatus').focus(); return false; } if($("option:selected", $("#bloodgroup")).val() == "-1") { - alert('Please Select Blood group '); + swal('Please Select Blood group '); $("#bloodgroup").focus(); return false; } if($("#currentaddress").val().length < 1) { - alert('Please Enter Current Address'); + swal('Please Enter Current Address'); return false; } if($("#permanentaddress").val().length < 1) { - alert('Please Enter Permanent Address'); + swal('Please Enter Permanent Address'); return false; } if($("#emergencycontactname").val().length < 1) { - alert('Please Enter Emergency Contact Name'); + swal('Please Enter Emergency Contact Name'); return false; } if($("#emergencycontactnumber").val().length < 1) { - alert('Please Enter Emergency Contact Number'); + swal('Please Enter Emergency Contact Number'); return false; } else if(!getValidEmergencyNumber()) @@ -942,19 +942,19 @@ function Validate() if($("option:selected", $("#desigination")).val() == "-1") { - alert('Please Select Desigination '); + swal('Please Select Desigination '); $("#desigination").focus(); return false; } if($("option:selected", $("#departmentname")).val() == "-1") { - alert('Please Select Department name'); + swal('Please Select Department name'); $("#departmentname").focus(); return false; } if($("option:selected", $("#eduqualifaction")).val() == "-1") { - alert('Please Select Qualification'); + swal('Please Select Qualification'); $("#eduqualifaction").focus(); return false; } @@ -996,7 +996,7 @@ function Validate() } else { - alert('please edit the emailid in the edit employee screen'); + swal('please edit the emailid in the edit employee screen'); window.location = 'employeedetails/employeeListing'; } @@ -1035,7 +1035,7 @@ function Validate() } else { - alert('please edit the PAN number in the Edit employee screen'); + swal('please edit the PAN number in the Edit employee screen'); window.location = 'employeedetails/employeeListing'; } @@ -1047,7 +1047,7 @@ function Validate() else { //alert(); - alert('Please enter the PAN Number'); + swal('Please enter the PAN Number'); $('#panno').focus(); return false; } @@ -1080,7 +1080,7 @@ function Validate() } else { - alert('please edit the aadhar number in the edit employee screen'); + swal('please edit the aadhar number in the edit employee screen'); window.location = 'employeedetails/employeeListing'; } @@ -1092,7 +1092,7 @@ function Validate() else { //alert(); - alert('Please enter the Aadhar Number'); + swal('Please enter the Aadhar Number'); $('#aadharno').focus(); return false; } diff --git a/application/views/addstorerequisitionslip.php b/application/views/addstorerequisitionslip.php index 1b23b456..e49148d9 100644 --- a/application/views/addstorerequisitionslip.php +++ b/application/views/addstorerequisitionslip.php @@ -437,14 +437,14 @@ function openmodal() { if($("option:selected", $("#CostCenter")).val() == '-1') { - alert('Please select the CostCenter '); + swal('Please select the CostCenter '); $("#CostCenter").focus(); return false; } else if($('#Date').val() == '') { - alert('Please Enter the Requested Date '); + swal('Please Enter the Requested Date '); $("#Date").focus(); return false; } @@ -462,13 +462,13 @@ function openmodal() if ($("#MaterialCode option:selected").val() =='-1' ) { - alert('Please Select the MaterialCode '); + swal('Please Select the MaterialCode '); return false; } if(document.getElementById('Quantity').value == '' ) { - alert('Please Enter the Quantity'); + swal('Please Enter the Quantity'); return false; } @@ -613,7 +613,7 @@ function validateBeforeAdd() if ($("#CostCenter option:selected").val() =='-1' ) { - alert('Please Select the CostCenterCode '); + swal('Please Select the CostCenterCode '); $("#CostCenter").focus(); return false; } @@ -622,7 +622,7 @@ function validateBeforeAdd() else if( isExceed == '1') { - alert('You dont have available Budget Amount. You cant raise new StoreRequisition'); + swal('You dont have available Budget Amount. You cant raise new StoreRequisition'); return false; } else @@ -665,7 +665,7 @@ else { if(document.getElementById('mytable').rows.length < 0) { - alert('Please Select Line item to Store Requisition'); + swal('Please Select Line item to Store Requisition'); $('#Deliverydt').focus(); return false; } @@ -684,7 +684,7 @@ else if(data) { $('#content').loader('hide'); - alert(data); + swal(data); $('#txtRowCount').val(''); $('#txtDeletedRow').val(''); @@ -693,7 +693,7 @@ else } else { - alert("Error"); + swal("Error"); } } @@ -708,7 +708,7 @@ function validate() if($("option:selected", $("#CostCenter")).val() == '-1') { - alert('Please Select CostCenter'); + swal('Please Select CostCenter'); return false; } @@ -716,12 +716,12 @@ function validate() else if($("#txtRowCount").val().length < 1) { - alert('Please Add Line Item'); + swal('Please Add Line Item'); return false; } else if(isExceed == 1) { - alert('You dont have Budget and You cant Raise New StoreRequisition'); + swal('You dont have Budget and You cant Raise New StoreRequisition'); return false; } else diff --git a/application/views/addsupplier.php b/application/views/addsupplier.php index 270148e4..23e8e693 100644 --- a/application/views/addsupplier.php +++ b/application/views/addsupplier.php @@ -10,7 +10,7 @@ function validateEmail() { { if (reg.test(email) == false) { - alert('Please Enter Valid Email Address'); + swal('Please Enter Valid Email Address'); return (false); } else @@ -29,7 +29,7 @@ function alpha(e) { function blockKeyPress(evt) { var charCode = (evt.which) ? evt.which : evt.keyCode; - alert(charCode); + swal(charCode); if(charCode == 8 || charCode == 46 ) { @@ -61,7 +61,7 @@ var reg = /^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$/; { if (reg.test(PAN) == false) { - alert('Please Enter Valid PAN Number'); + swal('Please Enter Valid PAN Number'); return (false); } else @@ -71,7 +71,7 @@ var reg = /^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$/; } else { - alert('Please Enter PAN Number'); + swal('Please Enter PAN Number'); return (false); } @@ -86,7 +86,7 @@ function validateUA() { { if (reguano.test(UA) == false) { - alert('Please Enter Valid UA Number'); + swal('Please Enter Valid UA Number'); return (false); } else @@ -108,7 +108,7 @@ function validateGST() { { if (reg.test(GST) == false) { - alert('Please Enter Valid GST Number Format should be 12ABCDE1234A1Z1 or 12ABCDE1234A1ZA'); + swal('Please Enter Valid GST Number Format should be 12ABCDE1234A1Z1 or 12ABCDE1234A1ZA'); return (false); } else @@ -118,7 +118,7 @@ function validateGST() { } else { - alert('Please Enter GST Number'); + swal('Please Enter GST Number'); return (false); } @@ -135,7 +135,7 @@ function validateECCNumber() { { if (reg.test(ECC) == false) { - alert('Please Enter Valid Excise Control Code Number'); + swal('Please Enter Valid Excise Control Code Number'); return (false); } else @@ -175,13 +175,13 @@ function getContactNumberValidation(){ } else{ - alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210');//alert('need to change:'+contactNumber); + swal('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210');//alert('need to change:'+contactNumber); return false; } } else{ - alert('please correct format of contact number'); + swal('please correct format of contact number'); //alert('invalid'+contactNumber); return false; } @@ -214,13 +214,13 @@ function getValidAlternateNumber() { } else{ - alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210');//alert('need to change:'+contactNumber); + swal('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210');//alert('need to change:'+contactNumber); return false; } } else{ - alert('please correct format of contact number'); + swal('please correct format of contact number'); //alert('invalid'+contactNumber); return false; } @@ -235,7 +235,7 @@ function validateEmail() { { if (reg.test(email) == false) { - alert('Please Enter Valid Email Address'); + swal('Please Enter Valid Email Address'); return (false); } else @@ -245,7 +245,7 @@ function validateEmail() { } else { - alert('Please Enter email id'); + swal('Please Enter email id'); } } @@ -581,7 +581,7 @@ function Validate() if($("#supplierName").val().length < 1) { - alert('Please Enter Supplier Name'); + swal('Please Enter Supplier Name'); $("#supplierName").focus(); return false; } @@ -598,14 +598,14 @@ if(!getContactNumberValidation) if($("#Address").val().length < 1) { - alert('Please Enter Address'); + swal('Please Enter Address'); $("#Address").focus(); return false; } if($("#TIN").val().length < 1) { - alert('Please Enter TIN number'); + swal('Please Enter TIN number'); $("#TIN").focus(); return false; } @@ -646,7 +646,7 @@ if(!validateEmail()) } else { - alert('Please edit the supplier details in the Edit screen and change the supplier status to Active'); + swal('Please edit the supplier details in the Edit screen and change the supplier status to Active'); window.location = 'supplier/supplierListing'; } @@ -657,7 +657,7 @@ if(!validateEmail()) } else { - alert('Please enter the PAN Number'); + swal('Please enter the PAN Number'); $('#panno').focus(); return false; } @@ -686,7 +686,7 @@ if(!validateEmail()) } else { - alert('Please edit the supplier details in the Edit screen and change the supplier status to Active'); + swal('Please edit the supplier details in the Edit screen and change the supplier status to Active'); window.location = 'supplier/supplierListing'; } @@ -697,7 +697,7 @@ if(!validateEmail()) } else { - alert('Please enter the GST Number'); + swal('Please enter the GST Number'); $('#GSTNo').focus(); return false; } diff --git a/application/views/approvalstorerequisitionslip.php b/application/views/approvalstorerequisitionslip.php index 81e47788..035ecd33 100644 --- a/application/views/approvalstorerequisitionslip.php +++ b/application/views/approvalstorerequisitionslip.php @@ -25,7 +25,7 @@