AlaK4X
Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64



Your IP : 3.144.242.149


Current Path : /var/www/lhjmq-records.qc.ca/public_html/xsl/records/booknew/js/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/xsl/records/booknew/js/ajax_records_form.js.php

<?php

include_once('../lang/'.$_REQUEST['lang'].'.php');

?>

function ajax_records() {
	var xmlHttp = initXmlHttpRequest();

	if (xmlHttp == null) {
		return;
	}

	var url = 'ajax_records_form.php?';
	var parameters = '';

	parameters += 'info_lname=' + escape(document.getElementById('info_lname').value);
	parameters += '&info_fname=' + escape(document.getElementById('info_fname').value);
	parameters += '&info_datenais_year=' + escape(document.getElementById('info_datenais_year').value);
	parameters += '&info_datenais_month=' + escape(document.getElementById('info_datenais_month').value);
	parameters += '&info_datenais_day=' + escape(document.getElementById('info_datenais_day').value);
	parameters += '&courriel=' + escape(document.getElementById('courriel').value);
	parameters += '&tel_1=' + escape(document.getElementById('tel_1').value);
	parameters += '&tel_2=' + escape(document.getElementById('tel_2').value);
	parameters += '&tel_3=' + escape(document.getElementById('tel_3').value);

	// Kill the cache problem in IE
	parameters += '&upid=' + new Date().getTime();

	xmlHttp.open('POST', url + parameters, true);
	xmlHttp.setRequestHeader("content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("content-length", parameters.length);
	xmlHttp.setRequestHeader("connection", "close");
	xmlHttp.send(parameters);

	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			var response = xmlHttp.responseText;

			if (response != '') {
				document.getElementById('no_profile').innerHTML = '&nbsp;';
				document.getElementById('fiche').value = '<?= $lhjmq_btn_visualiser ?>';

				/*
				document.getElementById('info_lname').readOnly = true;
				document.getElementById('info_fname').readOnly = true;
				document.getElementById('info_datenais_day').readOnly = true;
				document.getElementById('info_datenais_month').readOnly = true;
				document.getElementById('info_datenais_year').readOnly = true;
				*/

				document.getElementById('fiche').onclick = function() {
					response_array = response.split('|');

					if (response_array[1] == '6' || response_array[1] == '4')
					{
						this_win_lhjmq = window.open('../../../lang_<?= $_REQUEST['lang'] ?>/index.php?page=2147483647&id_register=' + response_array[0] + '&status_type=1', 'win_lhjmq', 'toolbar=yes,location=yes,directories=yes,resizable=yes,scrollbars=yes');
						this_win_lhjmq.focus()
					}
					else if (response_array[1] == '1' || response_array[1] == '2' || response_array[1] == '79' || response_array[1] == '80' || response_array[1] == '81' || response_array[1] == '86' || response_array[1] == '99' || response_array[1] == '100' || response_array[1] == '102' || response_array[1] == '147' )
					{
						this_win_lhjmq = window.open('../../../lang_<?= $_REQUEST['lang'] ?>/index.php?page=2147483648&id_register=' + response_array[0] + '&status_type=3', 'win_lhjmq', 'toolbar=yes,location=yes,directories=yes,resizable=yes,scrollbars=yes');
						this_win_lhjmq.focus()
					}
					else
					{
						this_win_lhjmq = window.open('../../../lang_<?= $_REQUEST['lang'] ?>/index.php?page=2147483648&id_register=' + response_array[0] + '&status_type=2', 'win_lhjmq', 'toolbar=yes,location=yes,directories=yes,resizable=yes,scrollbars=yes');
						this_win_lhjmq.focus()
					}
				}

				document.getElementById('extended_info').style.display = 'block';
				//document.getElementById('debug').innerHTML = parameters;
				window.location.hash = "#formulaires";
			}
			else {
				document.getElementById('no_profile').innerHTML = '<?= $lhjmq_btn_valider_message ?>';
				document.getElementById('fiche').value = '<?= $lhjmq_btn_valider ?>';

				/*
				document.getElementById('info_lname').readOnly = false;
				document.getElementById('info_fname').readOnly = false;
				document.getElementById('info_datenais_day').readOnly = false;
				document.getElementById('info_datenais_month').readOnly = false;
				document.getElementById('info_datenais_year').readOnly = false;
				*/

				document.getElementById('extended_info').style.display = 'block';
				//document.getElementById('debug').innerHTML = '';
			}

			return false;
		}
	}

	return false;
}


function initXmlHttpRequest() {
	var xmlHttp = null;

	if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		try {
			xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (e) {
			try {
				xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
			}
			catch (e) {
				alert('Your browser does not support AJAX.');
				return false;
			}
		}
	}

	return xmlHttp;
}

function reset_form() {
	/*
	document.getElementById('info_lname').readOnly = false;
	document.getElementById('info_fname').readOnly = false;
	document.getElementById('info_datenais_day').readOnly = false;
	document.getElementById('info_datenais_month').readOnly = false;
	document.getElementById('info_datenais_year').readOnly = false;
	*/

	document.getElementById('info_lname').value = '';
	document.getElementById('info_fname').value = '';
	document.getElementById('info_datenais_day').value = '';
	document.getElementById('info_datenais_month').value = '';
	document.getElementById('info_datenais_year').value = '';
	document.getElementById('courriel').value = '';
	document.getElementById('tel_1').value = '';
	document.getElementById('tel_2').value = '';
	document.getElementById('tel_3').value = '';
	document.getElementById('anecdote').value = '';
	document.getElementById('commentaires').value = '';
	document.getElementById('photo_legende').value = '';
	document.getElementById('bulletin').checked = false;

	document.getElementById('no_profile').innerHTML = '&nbsp;';
	document.getElementById('fiche').value = '<?= $lhjmq_btn_valider ?>';

	document.getElementById('fiche').onclick = function() {
		ajax_records();
	}

	document.getElementById('extended_info').style.display = 'block';
	//document.getElementById('debug').innerHTML = '';
}