0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.118.166.45


Current Path : /var/www/html/oums/js/
Upload File :
Current File : /var/www/html/oums/js/index.js

function load_index_page() {
	if (getCookie("userid")) {
		document.getElementById("txtuserid").value = getCookie("userid");
	}
	document.getElementById("txtuserid").focus();
}

function getCookie(c_name) {
	if (document.cookie.length > 0) {
		c_start = document.cookie.indexOf(c_name + "=");
		if (c_start != -1) {
			c_start = c_start + c_name.length + 1;
			c_end = document.cookie.indexOf(";", c_start);
			if (c_end == -1) c_end = document.cookie.length;
			return unescape(document.cookie.substring(c_start, c_end));
		}
	}
	return "";
}

function dologin(event) {
	if (event.keyCode == 13) {
		login();
	}
}

function login() {
	if (document.getElementById("txtuserid").value == "") {
		alert("Please enter Login ID!");
		txtuserid.focus();
		return false;
	}

	if (document.getElementById("txtpasswd").value == "") {
		alert("Please enter Password!");
		txtpasswd.focus();
		return false;
	}

	$.ajax({
		url: "src/login.php",
		type: "POST",
		dataType: "json",
		data: {
			user_name: document.getElementById("txtuserid").value,
			user_pswd: document.getElementById("txtpasswd").value,
		},
		beforeSend: function () {
			show_process();
		},
		success: function (data) {
			hide_process();
			if (data.stat == "F") {
				alert(data.mesg);
			} else {
				// alert(data.mesg);
				window.location.href = data.file;
			}
		},
		error: function (data) {
			hide_process();
			$("#index_content_login").html("Error: " + data);
		},
	});
}

function check_user() {
	$.ajax({
		url: "src/user_validate.php",
		type: "POST",
		dataType: "json",
		data: {
			user_name: document.getElementById("txtuserid").value,
			user_pswd: document.getElementById("txtpasswd").value,
		},
		beforeSend: function () {
			show_process();
		},
		success: function (data) {
			hide_process();
			if (data.stat == "F") {
				window.location.href = "user_password.php";
			} else {
				window.location.href = "mainpage.php";
			}
		},
		error: function (data) {
			hide_process();
			$("#index_content_login").html("Error: " + data);
		},
	});
}

function password_request_show() {
	$("#user-password-request").load("user_password_request.php", function () {
		// $('#home-page-modal-title').html("Password Request");
		// $('#myModal').modal({show:true});
		$("#user-password-request").css("visibility", "visible");
		$("#user-password-request").height($(document).height());
		$("#user-password-request").fadeIn("fast");

		password_request_code();
		$("#txtusercode").focus();
		document.getElementById("txtusercode").value = "";
		document.getElementById("txtusercode").value = "";
		document.getElementById("txtentrcode").value = "";
	});
}

function password_request_process() {
	if (document.getElementById("txtusercode").value == "") {
		alert("Please enter valid mobile no.!");
		txtusercode.focus();
		return false;
	}

	if (document.getElementById("txtentrcode").value == "") {
		alert("Please enter security code!");
		txtentrcode.focus();
		return false;
	}

	entr_code = document.getElementById("txtentrcode").value;
	entr_code = entr_code.toUpperCase();
	veri_code = document.getElementById("txtvericode").value;
	veri_code = veri_code.toUpperCase();

	if (entr_code != veri_code) {
		alert("Invalid security code!");
		txtentrcode.focus();
		return false;
	}

	$.ajax({
		type: "POST",
		url: "src/user_password_request.php",
		dataType: "json",
		data: {
			load_data: "chck_user",
			user_code: document.getElementById("txtusercode").value,
		},
		cache: false,
		beforeSend: function () {
			show_process();
		},
		success: function (data) {
			hide_process();
			alert(data.mesg);
			$("#user-password-request").fadeOut("fast");
			//$("#user-password-request-body").html("success: "+data);
		},
		error: function (data) {
			hide_process();
			//$("#user-password-request-body").html("error: "+data);
		},
	});
}

function password_request_cancel() {
	$("#user-password-request").fadeOut("fast");
}

function password_request_code() {
	$.ajax({
		type: "POST",
		url: "src/user_password_request.php",
		dataType: "json",
		data: {
			load_data: "veri_code",
			user_code: document.getElementById("txtusercode").value,
		},
		cache: false,
		beforeSend: function () {
			show_process();
		},
		success: function (data) {
			hide_process();
			document.getElementById("txtvericode").value = data.mesg;
		},
		error: function (data) {
			hide_process();
			//$("#user-password-request-body").html("error: "+data);
		},
	});
}

function show_process() {
	$("#page-process").css("visibility", "visible");
	$("#page-process").height($(document).height());
	$("#page-process").fadeIn("fast");
}

function hide_process() {
	$("#page-process").css("visibility", "hidden");
	$("#page-process").height(0);
	$("#page-process").fadeOut("fast");
}