123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- function validateOption()
- {
- document.getElementById("fsync_option_proformaserie_error").style.display = "none";
- document.getElementById("fsync_option_avizeserie_error").style.display = "none";
- document.getElementById("fsync_option_expfacturaserie_error").style.display = "none";
- document.getElementById("fsync_option_daysago_error").style.display = "none";
- var days = document.getElementById("fsync_option_daysago").value;
- $error = false;
- if(days == '' || !days.match(/^\d+$/))
- {
- document.getElementById("fsync_option_daysago_error").style.display = "block";
- $error = true;
- }
- var radios = document.getElementsByClassName("fsync_option_syncordersas");
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- if(radios[i].value == 'proforma' && document.getElementById("fsync_option_proformaserie").value == '')
- {
- document.getElementById("fsync_option_proformaserie_error").style.display = "block";
- $error = true;
- }
- if(radios[i].value == 'avize' && document.getElementById("fsync_option_avizeserie").value == '')
- {
- document.getElementById("fsync_option_avizeserie_error").style.display = "block";
- $error = true;
- }
- if(radios[i].value == 'expfactura' && document.getElementById("fsync_option_expfacturaserie").value == '')
- {
- document.getElementById("fsync_option_expfacturaserie_error").style.display = "block";
- $error = true;
- }
- }
- }
- if($error)
- {
- return false;
- }
- else
- {
- return true;
- }
-
- }
- function submitOrderOptionForm()
- {
- if(validateOption()) {
- document.getElementById('save-oo-btn').classList.remove('btn-green');
- document.getElementById('save-oo-btn').innerHTML = '<img src="View/img/loader.gif" />';
- document.getElementById('order_option_form').submit();
- }
- }
- function showOrHideProformaSerie()
- {
- var radios = document.getElementsByClassName("fsync_option_syncordersas");
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- if(radios[i].value == 'proforma')
- {
- document.getElementById("fsync_option_proformaserie").parentElement.parentElement.style.display = 'block';
- document.getElementById("fsync_option_avizeserie").parentElement.parentElement.style.display = 'none';
- document.getElementById("fsync_option_expfacturaserie").parentElement.parentElement.style.display = 'none';
- }
- else if(radios[i].value == 'avize')
- {
- document.getElementById("fsync_option_avizeserie").parentElement.parentElement.style.display = 'block';
- document.getElementById("fsync_option_proformaserie").parentElement.parentElement.style.display = 'none';
- document.getElementById("fsync_option_expfacturaserie").parentElement.parentElement.style.display = 'none';
- }
- else if(radios[i].value == 'expfactura')
- {
- document.getElementById("fsync_option_expfacturaserie").parentElement.parentElement.style.display = 'block';
- document.getElementById("fsync_option_avizeserie").parentElement.parentElement.style.display = 'none';
- document.getElementById("fsync_option_proformaserie").parentElement.parentElement.style.display = 'none';
- }
- else
- {
- document.getElementById("fsync_option_proformaserie").parentElement.parentElement.style.display = 'none';
- document.getElementById("fsync_option_avizeserie").parentElement.parentElement.style.display = 'none';
- document.getElementById("fsync_option_expfacturaserie").parentElement.parentElement.style.display = 'none';
- }
- break;
- }
- }
- }
- function showOrHideProformaSerie2()
- {
- var radios = document.getElementsByClassName("fsync_option_addproforma");
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- var element = document.getElementById("fsync_option_proformaserie2");
- if(radios[i].value == 'activ')
- {
- element.parentElement.parentElement.parentElement.style.display = 'block';
- }
- else
- {
- element.parentElement.parentElement.parentElement.style.display = 'none';
- }
- break;
- }
- }
- }
- function showOrHideAvizeSerie()
- {
- var radios = document.getElementsByClassName("fsync_option_syncordersas");
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- if(radios[i].value == 'avize')
- {
- document.getElementById("fsync_option_avizeserie").parentElement.parentElement.style.display = 'block';
- }
- else
- {
- document.getElementById("fsync_option_avizeserie").parentElement.parentElement.style.display = 'none';
- }
- break;
- }
- }
- }
- function showOrHideExpfacturaSerie()
- {
- var radios = document.getElementsByClassName("fsync_option_syncordersas");
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- if(radios[i].value == 'expfactura')
- {
- document.getElementById("fsync_option_expfacturaserie").parentElement.parentElement.style.display = 'block';
- }
- else
- {
- document.getElementById("fsync_option_expfacturaserie").parentElement.parentElement.style.display = 'none';
- }
- break;
- }
- }
- }
- function showOrHideAvizeSerie2()
- {
- var radios = document.getElementsByClassName("fsync_option_addavize");
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- var element = document.getElementById("fsync_option_avizeserie2");
- if(radios[i].value == 'activ')
- {
- element.parentElement.parentElement.parentElement.style.display = 'block';
- }
- else
- {
- element.parentElement.parentElement.parentElement.style.display = 'none';
- }
- break;
- }
- }
- }
- function showOrHideExpfacturaSerie2()
- {
- var radios = document.getElementsByClassName("fsync_option_addexpfactura");
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- var element = document.getElementById("fsync_option_expfacturaserie2");
- if(radios[i].value == 'activ')
- {
- element.parentElement.parentElement.parentElement.style.display = 'block';
- }
- else
- {
- element.parentElement.parentElement.parentElement.style.display = 'none';
- }
- break;
- }
- }
- }
- function showOrHideInvoiceSerie()
- {
- var radios = document.getElementsByClassName("fsync_option_addinvoice");
- for (var i = 0, length = radios.length; i < length; i++) {
- if (radios[i].checked) {
- var element = document.getElementById("fsync_option_invoiceserie");
- if(radios[i].value == 'activ')
- {
- element.parentElement.parentElement.parentElement.style.display = 'block';
- }
- else
- {
- element.parentElement.parentElement.parentElement.style.display = 'none';
- }
- break;
- }
- }
- }
- function getPdls()
- {
- var params = '';
- params += '&fsync_option_pdls=' + document.getElementById("fsync_option_pdls_hidden").value;
- params += '&shop=' + document.getElementById("fsync_shop_hidden").value;
- params = encodeURI(params);
- var xhttp;
- xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- if( this.responseText != '')
- {
- document.getElementById("fsync_option_pdls").innerHTML = this.responseText;
- }
- }
- };
- xhttp.open("GET","ajax.php?random=" + Math.random() + "&action=getPdls" + params,true);
- xhttp.send();
- }
|