Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html /
webedi.bdcloud.fr /
iForm /
js /
Delete
Unzip
Name
Size
Permission
Date
Action
script.js
22.43
KB
-rw-r--r--
2022-11-21 13:16
Save
Rename
$(window).on('load', function() { var preloaderFadeOutTime = 1000; function hidePreloader() { var preloader = $('.spinner-wrapper'); setTimeout(function() { preloader.fadeOut(preloaderFadeOutTime); }, 1000); } hidePreloader(); }); function Survey(survey) { if (!survey) { throw new Error("No Survey Form found!"); } // select the elements const progressbar = survey.querySelector(".progressbar"); const surveyPanels = survey.querySelectorAll(".survey__panel"); /*const question1Radios = survey.querySelectorAll("[name='question_1']"); const question2Radios = survey.querySelectorAll("[name='question_2']"); const question3CheckBoxes = survey.querySelectorAll("[name='question_3']"); const question4Radios = survey.querySelectorAll("[name='question_4']"); const question4Textarea = survey.querySelector("[name='recommendText']"); const question5Name = survey.querySelector("[name='name']"); const question5Email = survey.querySelector("[name='email']"); const question5Country = survey.querySelector("[name='country']"); const question5Age = document.querySelector("[name='age']");*/ const allPanels = Array.from(survey.querySelectorAll(".survey__panel")); //------------------------ here const rs = survey.querySelector("[name='rs']"); const fj = survey.querySelector("[name='fj']"); const adresse = survey.querySelector("[name='adresse']"); const telephone = survey.querySelector("[name='telephone']"); const email = survey.querySelector("[name='email']"); const gln1 = survey.querySelector("[name='gln1']"); const gln2 = survey.querySelector("[name='gln2']"); const gln3 = survey.querySelector("[name='gln3']"); const contact1_nom = survey.querySelector("[name='contact1_nom']"); const contact1_fc = survey.querySelector("[name='contact1_fc']"); const contact1_tel = survey.querySelector("[name='contact1_tel']"); const contact1_email = survey.querySelector("[name='contact1_email']"); const contact2_nom = survey.querySelector("[name='contact2_nom']"); const contact2_fc = survey.querySelector("[name='contact2_fc']"); const contact2_tel = survey.querySelector("[name='contact2_tel']"); const contact2_email = survey.querySelector("[name='contact2_email']"); const contact3_nom = survey.querySelector("[name='contact3_nom']"); const contact3_fc = survey.querySelector("[name='contact3_fc']"); const contact3_tel = survey.querySelector("[name='contact3_tel']"); const contact3_email = survey.querySelector("[name='contact3_email']"); const presta_company = survey.querySelector("[name='presta_company']"); const presta_nom = survey.querySelector("[name='presta_nom']"); const presta_fc = survey.querySelector("[name='presta_fc']"); const presta_tel = survey.querySelector("[name='presta_tel']"); const presta_email = survey.querySelector("[name='presta_email']"); const gitn = survey.querySelector("[name='gitn']"); const sscc = survey.querySelector("[name='sscc']"); const redi = survey.querySelector("[name='redi']"); const startdate = survey.querySelector("[name='startdate']"); const eligibility = survey.querySelector("[name='eligibility']"); const eligibility_orders = survey.querySelector("[name='eligibility_orders']"); const eligibility_orders_sent = survey.querySelector("[name='eligibility_orders_sent']"); const commentaire = survey.querySelector("[name='commentaire']"); var Data = []; //------------------------ let progressbarStep = Array.from( progressbar.querySelectorAll(".progressbar__step ") ); const mainElement = document.querySelector("main"); const nextButton = survey.querySelector("[name='next']"); const prevButton = survey.querySelector("[name='prev']"); const submitButton = survey.querySelector("[name='submit']"); let currentPanel = Array.from(surveyPanels).filter((panel) => panel.classList.contains("survey__panel--current") )[0]; const formData = {}; const options = { /*question1Radios, question2Radios, question3CheckBoxes, question4Radios, question4Textarea, question5Name, question5Email, question5Country, question5Age,*/ //------------------------ here rs, fj, adresse, telephone, email, gln1, gln2, gln3, contact1_nom, contact1_fc, contact1_tel, contact1_email, contact2_nom, contact2_fc, contact2_tel, contact2_email, contact3_nom, contact3_fc, contact3_tel, contact3_email, presta_company, presta_nom, presta_fc, presta_tel, presta_email, gitn, sscc, startdate, eligibility, redi, eligibility_orders, eligibility_orders_sent, commentaire //------------------------ }; let dontSubmit = false; function storeInitialData() { allPanels.map((panel) => { let index = panel.dataset.index; let panelName = panel.dataset.panel; let question = panel .querySelector(".survey__panel__question") .textContent.trim(); formData[index] = { panelName: panelName, question: question }; }); } function updateProgressbar() { let index = currentPanel.dataset.index; let currentQuestion = formData[`${parseFloat(index)}`].question; progressbar.setAttribute("aria-valuenow", index); progressbar.setAttribute("aria-valuetext", currentQuestion); progressbarStep[index - 1].classList.add("active"); } function updateFormData({ target }) { const index = +currentPanel.dataset.index; const { name, type, value } = target; if (type === "checkbox") { if (formData[index].answer === undefined) { formData[index].answer = { [name]: [value] }; return; } if (formData[index]["answer"][`${name}`].includes(value)) { const position = formData[index]["answer"][`${name}`].findIndex( (elem) => elem === value ); formData[index]["answer"][`${name}`].splice(position, 1); } else { formData[index]["answer"][`${name}`].push(value); } return; } if (index === 4 || index === 5) { let copy; const original = formData[index].answer; if (original === undefined) { formData[index].answer = { [name]: value }; copy = { ...formData[index].answer }; } else { formData[index].answer = { ...original, [name]: value }; } return; } formData[index].answer = { [name]: value }; } function showError(input, text) { const formControl = input.parentElement; const errorElement = formControl.querySelector(".error-message"); errorElement.innerText = text; errorElement.setAttribute("role", "alert"); if (survey.classList.contains("form-error")) return; survey.classList.add("form-error"); } function noErrors(input) { if (!input) { const errorElement = currentPanel.querySelector(".error-message"); errorElement.textContent = ""; errorElement.removeAttribute("role"); survey.classList.remove("form-error"); return; } const formControl = input.parentElement; const errorElement = formControl.querySelector(".error-message"); errorElement.innerText = ""; errorElement.removeAttribute("role"); } function getName(input) { if (input.name === "age") return "Age"; if (input.name === "country") return "Country"; return `${input.id.charAt(0).toUpperCase()}${input.id.slice(1)}`; } function checkEmail(input) { if (input.value.trim() === "") { showError(input, `${getName(input)} is required`); } else { const pattern = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if (pattern.test(input.value.trim())) { noErrors(input); return true; } else { showError(input, "Email is not valid"); return false; } } } function checkRequired(input) { if (input.value.trim() === "") { showError(input, `${getName(input)} is required`); } else { noErrors(input); } } function checkSelection(input) { if (input.selectedIndex === 0) { showError(input, `${getName(input)} is required`); } else { noErrors(input); } } function checkAge(age) { if (age.value === "") { showError(age, `${getName(age)} is required`); return; } if (+age.value > 0) { noErrors(age); } } function updateProgressbarBar() { const index = currentPanel.dataset.index; let currentQuestion = formData[`${parseFloat(index)}`].question; progressbar.setAttribute("aria-valuenow", index); progressbar.setAttribute("aria-valuetext", currentQuestion); progressbarStep[index].classList.remove("active"); } function displayNextPanel() { currentPanel.classList.remove("survey__panel--current"); currentPanel.setAttribute("aria-hidden", true); currentPanel = currentPanel.nextElementSibling; currentPanel.classList.add("survey__panel--current"); currentPanel.setAttribute("aria-hidden", false); updateProgressbar(); if (+currentPanel.dataset.index > 1) { prevButton.disabled = false; prevButton.setAttribute("aria-hidden", false); } if (+currentPanel.dataset.index === 5) { nextButton.disabled = true; nextButton.setAttribute("aria-hidden", true); submitButton.disabled = false; submitButton.setAttribute("aria-hidden", false); } } function displayPrevPanel() { currentPanel.classList.remove("survey__panel--current"); currentPanel.setAttribute("aria-hidden", true); currentPanel = currentPanel.previousElementSibling; currentPanel.classList.add("survey__panel--current"); currentPanel.setAttribute("aria-hidden", false); updateProgressbarBar(); if (+currentPanel.dataset.index === 1) { prevButton.disabled = true; prevButton.setAttribute("aria-hidden", true); } if (+currentPanel.dataset.index < 5) { nextButton.disabled = false; nextButton.setAttribute("aria-hidden", false); submitButton.disabled = true; submitButton.setAttribute("aria-hidden", true); } } function handleprevButton() { displayPrevPanel(); } function handleNextButton() { const Emailpattern = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; const Phonepattern = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im; const index = currentPanel.dataset.index; const errorElement = currentPanel.querySelector(".error-message"); const errorElementEmail = currentPanel.querySelector(".error-message-email"); const errorElementTel = currentPanel.querySelector(".error-message-tel"); const errorElementGLN = currentPanel.querySelector(".error-message-gln"); const errorElementcontact1_email = currentPanel.querySelector(".error-message-contact1_email"); const errorElementcontact1_tel = currentPanel.querySelector(".error-message-contact1_tel"); const errorElementpresta_tel = currentPanel.querySelector(".error-message-presta_tel"); const errorElementpresta_email = currentPanel.querySelector(".error-message-presta_email"); const errorElementEligibility = currentPanel.querySelector(".error-message-eligibility"); const errorElementstartdate = currentPanel.querySelector(".error-message-startdate"); if (index == 1){ if(rs.value && adresse.value && telephone.value && email.value && gln1.value){ var SuccessCounter = 0; if (!Emailpattern.test(email.value.trim())) { errorElementEmail.textContent = `Email incorrect`; }else{ errorElementEmail.textContent = ``; SuccessCounter++; } /*if (!Phonepattern.test(telephone.value.trim())) { errorElementTel.textContent = `Numéro de téléphone incorrect`; }else{ errorElementTel.textContent = ``; SuccessCounter++; }*/ if (gln1.value.length < 12) { errorElementGLN.textContent = 'GLN incorrect'; }else{ errorElementGLN.textContent = ''; SuccessCounter++; } if(SuccessCounter == 2){ console.log('Step 1 '); noErrors(); displayNextPanel(); SuccessCounter = 0; } }else{ errorElement.textContent = `Veuillez remplir tous les champs obligatoires`; } } if (index == 2){ if(contact1_nom.value && contact1_tel.value && contact1_email.value){ var SuccessCounter = 0; if (!Emailpattern.test(contact1_email.value.trim())) { errorElementcontact1_email.textContent = `Email incorrect`; }else{ errorElementcontact1_email.textContent = ``; SuccessCounter++; } if (!Phonepattern.test(contact1_tel.value.trim())) { errorElementcontact1_tel.textContent = `Numéro de téléphone incorrect`; }else{ errorElementcontact1_tel.textContent = ``; SuccessCounter++; } if(SuccessCounter == 2){ console.log('Step 2 '); noErrors(); displayNextPanel(); SuccessCounter = 0; } }else{ errorElement.textContent = `Veuillez remplir tous les champs obligatoires`; } } if (index == 3){ var ErrorCounter = 0; if(presta_email.value.length > 0){ if (!Emailpattern.test(presta_email.value.trim())) { errorElementpresta_email.textContent = `Email incorrect`; ErrorCounter++; }else{ errorElementpresta_email.textContent = ``; } } if(presta_tel.value.length > 0){ if (!Phonepattern.test(presta_tel.value.trim())) { errorElementpresta_tel.textContent = `Numéro de téléphone incorrect`; ErrorCounter++; }else{ errorElementpresta_tel.textContent = ``; } } if(ErrorCounter > 0){ errorElement.textContent = `Veuillez corriger les champs`; }else{ console.log('Step 3 '); noErrors(); displayNextPanel(); } } if (index == 4){ var CheckCounter = 0; console.log('Step 4 '); console.log(eligibility.value); console.log(startdate.value); if(startdate.value.length <= 0){ errorElementstartdate.textContent = 'Veuillez selectionner une date de debut'; }else{ errorElementstartdate.textContent = ''; CheckCounter++; } if (eligibility.value.length <=0) { errorElementEligibility.textContent = 'Veuillez faire un choix'; }else{ errorElementEligibility.textContent = ''; CheckCounter++; } if(CheckCounter == 2){ noErrors(); displayNextPanel(); } } if (index == 5){ handleFormSubmit(); } } // submitting the form function handleFormSubmit(e) { //checkRequirements(); //if (!dontSubmit) { // e.preventDefault(); //} else { //console.log(formData); console.log('end'); var captcha = grecaptcha.getResponse(); Data = { "captcha": captcha,"RaisonSociale" :rs.value, "FormJuridique":fj.value, "Adresse":adresse.value, "Telephone":telephone.value,"Email":email.value,"GLN1":gln1.value,"GLN2":gln2.value,"GLN3":gln3.value, "contact1_nom":contact1_nom.value,"contact1_fc":contact1_fc.value,"contact1_tel":contact1_tel.value,"contact1_email":contact1_email.value, "contact2_nom":contact2_nom.value,"contact2_fc":contact2_fc.value,"contact2_tel":contact2_tel.value,"contact2_email":contact2_email.value, "contact3_nom":contact3_nom.value,"contact3_fc":contact3_fc.value,"contact3_tel":contact3_tel.value,"contact3_email":contact3_email.value, "presta_company":presta_company.value,"presta_nom":presta_nom.value,"presta_fc":presta_fc.value,"presta_tel":presta_tel.value,"presta_email":presta_email.value, "GITN":gitn.checked,"SSCC":sscc.checked,"redi":redi.checked,"startdate":startdate.value,"eligibility":eligibility.value,"eligibility_orders":eligibility_orders.value,"eligibility_orders_sent":eligibility_orders_sent.value,"commentaire":commentaire.value }; $.ajax({ type: "GET", url: "controllers/DataForm.php", data: { 'data' : JSON.stringify(Data)}, contentType: "application/json", success: function (result) { if(!captcha){ $('#message_captcha').css("color", "red"); $('#message_captcha').html('Veuillez valider le captcha'); }else{ mainElement.classList.add("submission"); mainElement.setAttribute("role", "alert"); mainElement.innerHTML = `<center><svg width="126" height="118" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 126 118" aria-hidden="true"><path d="M52.5 118c28.995 0 52.5-23.729 52.5-53S81.495 12 52.5 12 0 35.729 0 65s23.505 53 52.5 53z" fill="#197A7F"/><path d="M45.726 87L23 56.877l8.186-6.105 15.647 20.74L118.766 0 126 7.192 45.726 87z" fill="#1DD1AC"/></svg> <h2 class="submission">Nous vous remercions.</h2> <h4>Le formulaire à bien été envoyé.</h4></center>`; } }, error: function (result, status) { console.log(result); mainElement.classList.add("submission"); mainElement.setAttribute("role", "alert"); mainElement.innerHTML = `<center><svg width="126" height="118" style="overflow:visible;enable-background:new 0 0 32 32" viewBox="0 0 32 32" width="32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><g id="Incorrect_Symbol_1_"><g id="Incorrect_Symbol"><circle cx="16" cy="16" id="BG" r="16" style="fill:#FF3939;"/><polygon id="Cross_x5F_Symbol" points="24,10.1 21.9,8 16,13.9 10.1,8 8,10.1 13.9,16 8,21.9 10.1,24 16,18.1 21.9,24 24,21.9 18.1,16 " style="fill:#E6E6E6;"/></g></g></g></svg> <h2 class="submission">Erreur d'envoi</h2> <h4>Veuillez vérifier les données et réessayer ultérieurement.</h4></center>`; } }); return false; } storeInitialData(); // Add event listeners function addListenersTo({ /*question1Radios, question2Radios, question3CheckBoxes, question4Radios,*/ ...inputs }) { /*question1Radios.forEach((elem) => elem.addEventListener("change", updateFormData) ); question2Radios.forEach((elem) => elem.addEventListener("change", updateFormData) ); question3CheckBoxes.forEach((elem) => elem.addEventListener("change", updateFormData) ); question4Radios.forEach((elem) => elem.addEventListener("change", updateFormData) );*/ let { /*question4Textarea, question5Name, question5Email, question5Country, question5Age,*/ //------------------ here rs, fj, adresse, telephone, email, gln1, gln2, gln3, contact1_nom, contact1_fc, contact1_tel, contact1_email, contact2_nom, contact2_fc, contact2_tel, contact2_email, contact3_nom, contact3_fc, contact3_tel, contact3_email, presta_company, presta_nom, presta_fc, presta_tel, presta_email, gitn, sscc, redi, startdate, eligibility, eligibility_orders, eligibility_orders_sent, commentaire //------------------ } = inputs; /*question4Textarea.addEventListener("change", updateFormData); question5Name.addEventListener("change", updateFormData); question5Email.addEventListener("change", updateFormData); question5Country.addEventListener("change", updateFormData); question5Age.addEventListener("change", updateFormData);*/ //--------------------- here rs.addEventListener("change", updateFormData); fj.addEventListener("change", updateFormData); adresse.addEventListener("change", updateFormData); telephone.addEventListener("change", updateFormData); email.addEventListener("change", updateFormData); gln1.addEventListener("change", updateFormData); gln2.addEventListener("change", updateFormData); gln3.addEventListener("change", updateFormData); contact1_nom.addEventListener("change", updateFormData); contact1_fc.addEventListener("change", updateFormData); contact1_tel.addEventListener("change", updateFormData); contact1_email.addEventListener("change", updateFormData); contact2_nom.addEventListener("change", updateFormData); contact2_fc.addEventListener("change", updateFormData); contact2_tel.addEventListener("change", updateFormData); contact2_email.addEventListener("change", updateFormData); contact3_nom.addEventListener("change", updateFormData); contact3_fc.addEventListener("change", updateFormData); contact3_tel.addEventListener("change", updateFormData); contact3_email.addEventListener("change", updateFormData); presta_company.addEventListener("change", updateFormData); presta_nom.addEventListener("change", updateFormData); presta_fc.addEventListener("change", updateFormData); presta_tel.addEventListener("change", updateFormData); presta_email.addEventListener("change", updateFormData); gitn.addEventListener("change", updateFormData); sscc.addEventListener("change", updateFormData); redi.addEventListener("change", updateFormData); startdate.addEventListener("change", updateFormData); eligibility.addEventListener("change", updateFormData); eligibility_orders.addEventListener("change", updateFormData); eligibility_orders_sent.addEventListener("change", updateFormData); commentaire.addEventListener("change", updateFormData); //--------------------- } nextButton.addEventListener("click", handleNextButton); prevButton.addEventListener("click", handleprevButton); addListenersTo(options); survey.addEventListener("submit", handleFormSubmit); } const survey = Survey(document.querySelector(".survey"));