<?php
header('Content-Type: application/javascript');
if (!defined("root")) {
	define("root", $_SERVER['DOCUMENT_ROOT']);
}
require(root."/___simple_config.php");
?>
var adminFolder = "<?php echo adminFolder; ?>";
function doAction(parSection, parAction, parPageName, parKdMaster, parKd) {
	var adata = "a=do_action&action="+ parAction +"&kddata="+ parKdMaster +"&kd="+ parKd +"&formodule="+ parPageName +"";
	if ($("#image_title").attr("id")!="undefined") { adata += "&image_title="+ $("#image_title").val() +""; }
	if ($("#image_alt").attr("id")!="undefined") { adata += "&image_alt="+ $("#image_alt").val() +""; }
	if ($(".image_title"+ parKd +"").attr("id")!="undefined") { adata += "&image_title_id="+ $(".image_title"+ parKd +"").val() +""; }
	if ($(".image_alt"+ parKd +"").attr("id")!="undefined") { adata += "&image_alt_id="+ $(".image_alt"+ parKd +"").val() +""; }
	
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/ajax_files.php",
		data: adata,
		success: function(resp){
			$(".ajax_resp").html(resp);
		}
	});
}
function loadUploadedImage(parPageName, parKd) {
	var adata = "a=loadfiles&kd="+ parKd +"&formodule="+ parPageName +"";
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/ajax_files.php",
		data: adata,
		success: function(resp){
			$(".ajax_resp").html(resp);
		}
	});
}
function loadFormUploadImage(parPageName, parKd, parTipeForm, parTipeData) {
	var adata = "a=readyform&tipeform"+ parTipeForm +"&tipedata="+ parTipeData +"&kd="+ parKd +"&formodule="+ parPageName +"";
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/ajax_files.php",
		data: adata,
		success: function(resp){
			$(".ajax_resp").html(resp);
		}
	});
}
function filterReload(parPageName, parCP) {
	var adata = "a=section_main&cp="+ parCP +"";
	var ajaxURL = "index.php";
	if (parPageName=="results") {
		var fil_stgl = $("#fil_stgl").val();
		var fil_etgl = $("#fil_etgl").val();
		var fil_kdpasar = $("#fil_kdpasar").val();
		var fil_nomor = $("#fil_nomor").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_stgl!=undefined) { adata += "&fil_stgl="+ fil_stgl +""; }
		if (fil_etgl!=undefined) { adata += "&fil_etgl="+ fil_etgl +""; }
		if (fil_kdpasar!=undefined) { adata += "&fil_kdpasar="+ fil_kdpasar +""; }
		if (fil_nomor!=undefined) { adata += "&fil_nomor="+ fil_nomor +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="mimpi") {
		var fil_noxd = $("#fil_noxd").val();
		var fil_mimpi = $("#fil_mimpi").val();
		if (fil_noxd!=undefined) { adata += "&fil_noxd="+ fil_noxd +""; }
		if (fil_mimpi!=undefined) { adata += "&fil_mimpi="+ fil_mimpi +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="website") {
		var fil_seksi = $("#fil_seksi").val();
		var fil_isi = $("#fil_isi").val();
		if (fil_seksi!=undefined) { adata += "&fil_seksi="+ fil_seksi +""; }
		if (fil_isi!=undefined) { adata += "&fil_isi="+ fil_isi +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="cara-bermain" || parPageName=="news" || parPageName=="announcements" || parPageName=="promo") {
		var fil_judul = $("#fil_judul").val();
		var fil_isi = $("#fil_isi").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_judul!=undefined) { adata += "&fil_judul="+ fil_judul +""; }
		if (fil_isi!=undefined) { adata += "&fil_isi="+ fil_isi +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="prediksi-bola") {
		var fil_tim1 = $("#fil_tim1").val();
		var fil_tim2 = $("#fil_tim2").val();
		var fil_prediksi = $("#fil_prediksi").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_tim1!=undefined) { adata += "&fil_tim1="+ fil_tim1 +""; }
		if (fil_tim2!=undefined) { adata += "&fil_tim2="+ fil_tim2 +""; }
		if (fil_prediksi!=undefined) { adata += "&fil_prediksi="+ fil_prediksi +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="accounts") {
		var fil_username = $("#fil_username").val();
		var fil_kdgame = $("#fil_kdgame").val();
		var fil_password = $("#fil_password").val();
		var fil_assigned = $("#fil_assigned").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_username!=undefined) { adata += "&fil_username="+ fil_username +""; }
		if (fil_kdgame!=undefined) { adata += "&fil_kdgame="+ fil_kdgame +""; }
		if (fil_password!=undefined) { adata += "&fil_password="+ fil_password +""; }
		if (fil_assigned!=undefined) { adata += "&fil_assigned="+ fil_assigned +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="members") {
		var fil_kdbank = $("#fil_kdbank").val();
		var fil_kdgame = $("#fil_kdgame").val();
		var fil_username = $("#fil_username").val();
		var fil_norek = $("#fil_norek").val();
		var fil_namarek = $("#fil_namarek").val();
		var fil_email = $("#fil_email").val();
		var fil_telp = $("#fil_telp").val();
		var fil_assign = $("#fil_assign").val();
		var fil_isactive = $("#fil_isactive").val();
		var fil_sort = $("#fil_sort").val();
		if (fil_username!=undefined) { adata += "&fil_username="+ fil_username +""; }
		if (fil_norek!=undefined) { adata += "&fil_norek="+ fil_norek +""; }
		if (fil_namarek!=undefined) { adata += "&fil_namarek="+ fil_namarek +""; }
		if (fil_email!=undefined) { adata += "&fil_email="+ fil_email +""; }
		if (fil_telp!=undefined) { adata += "&fil_telp="+ fil_telp +""; }
		if (fil_kdbank!=undefined) { adata += "&fil_kdbank="+ fil_kdbank +""; }
		if (fil_kdgame!=undefined) { adata += "&fil_kdgame="+ fil_kdgame +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		if (fil_assign!=undefined) { adata += "&fil_assign="+ fil_assign +""; }
		if (fil_sort!=undefined) { adata += "&fil_sort="+ fil_sort +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="terms-and-conditions" || parPageName=="privacy-policy" || parPageName=="about" || parPageName=="slides" || parPageName=="fakes") {
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="laporan") {
		var fil_stgl = $("#fil_stgl").val();
		var fil_etgl = $("#fil_etgl").val();
		var fil_kdbank = $("#fil_kdbank").val();
		var fil_kdgame = $("#fil_kdgame").val();
		var fil_username = $("#fil_username").val();
		var fil_norek = $("#fil_norek").val();
		var fil_namarek = $("#fil_namarek").val();
		var fil_status = $("#fil_status").val();
		if (fil_stgl!=undefined) { adata += "&fil_stgl="+ fil_stgl +""; }
		if (fil_etgl!=undefined) { adata += "&fil_etgl="+ fil_etgl +""; }
		if (fil_kdbank!=undefined) { adata += "&fil_kdbank="+ fil_kdbank +""; }
		if (fil_kdgame!=undefined) { adata += "&fil_kdgame="+ fil_kdgame +""; }
		if (fil_username!=undefined) { adata += "&fil_username="+ fil_username +""; }
		if (fil_norek!=undefined) { adata += "&fil_norek="+ fil_norek +""; }
		if (fil_namarek!=undefined) { adata += "&fil_namarek="+ fil_namarek +""; }
		if (fil_status!=undefined) { adata += "&fil_status="+ fil_status +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="deposits" || parPageName=="withdraws") {
		var fil_stgl = $("#fil_stgl").val();
		var fil_etgl = $("#fil_etgl").val();
		var fil_kdbank = $("#fil_kdbank").val();
		var fil_kdgame = $("#fil_kdgame").val();
		var fil_username = $("#fil_username").val();
		var fil_norek = $("#fil_norek").val();
		var fil_namarek = $("#fil_namarek").val();
		var fil_status = $("#fil_status").val();
		var fil_sort = $("#fil_sort").val();
		if (fil_stgl!=undefined) { adata += "&fil_stgl="+ fil_stgl +""; }
		if (fil_etgl!=undefined) { adata += "&fil_etgl="+ fil_etgl +""; }
		if (fil_kdbank!=undefined) { adata += "&fil_kdbank="+ fil_kdbank +""; }
		if (fil_kdgame!=undefined) { adata += "&fil_kdgame="+ fil_kdgame +""; }
		if (fil_username!=undefined) { adata += "&fil_username="+ fil_username +""; }
		if (fil_norek!=undefined) { adata += "&fil_norek="+ fil_norek +""; }
		if (fil_namarek!=undefined) { adata += "&fil_namarek="+ fil_namarek +""; }
		if (fil_status!=undefined) { adata += "&fil_status="+ fil_status +""; }
		if (fil_sort!=undefined) { adata += "&fil_sort="+ fil_sort +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="report_members") {
		var fil_stgl = $("#fil_stgl").val();
		var fil_etgl = $("#fil_etgl").val();
		var fil_kdbank = $("#fil_kdbank").val();
		var fil_kdgame = $("#fil_kdgame").val();
		var fil_username = $("#fil_username").val();
		var fil_norek = $("#fil_norek").val();
		var fil_namarek = $("#fil_namarek").val();
		var fil_telp = $("#fil_telp").val();
		var fil_email = $("#fil_email").val();
		if (fil_stgl!=undefined) { adata += "&fil_stgl="+ fil_stgl +""; }
		if (fil_etgl!=undefined) { adata += "&fil_etgl="+ fil_etgl +""; }
		if (fil_kdbank!=undefined) { adata += "&fil_kdbank="+ fil_kdbank +""; }
		if (fil_kdgame!=undefined) { adata += "&fil_kdgame="+ fil_kdgame +""; }
		if (fil_username!=undefined) { adata += "&fil_username="+ fil_username +""; }
		if (fil_norek!=undefined) { adata += "&fil_norek="+ fil_norek +""; }
		if (fil_namarek!=undefined) { adata += "&fil_namarek="+ fil_namarek +""; }
		if (fil_telp!=undefined) { adata += "&fil_telp="+ fil_telp +""; }
		if (fil_email!=undefined) { adata += "&fil_email="+ fil_email +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="report_deposits" || parPageName=="report_withdraws") {
		var fil_stgl = $("#fil_stgl").val();
		var fil_etgl = $("#fil_etgl").val();
		var fil_kdbank = $("#fil_kdbank").val();
		var fil_kdgame = $("#fil_kdgame").val();
		var fil_username = $("#fil_username").val();
		var fil_norek = $("#fil_norek").val();
		var fil_namarek = $("#fil_namarek").val();
		var fil_sort = $("#fil_sort").val();
		if (fil_stgl!=undefined) { adata += "&fil_stgl="+ fil_stgl +""; }
		if (fil_etgl!=undefined) { adata += "&fil_etgl="+ fil_etgl +""; }
		if (fil_kdbank!=undefined) { adata += "&fil_kdbank="+ fil_kdbank +""; }
		if (fil_kdgame!=undefined) { adata += "&fil_kdgame="+ fil_kdgame +""; }
		if (fil_username!=undefined) { adata += "&fil_username="+ fil_username +""; }
		if (fil_norek!=undefined) { adata += "&fil_norek="+ fil_norek +""; }
		if (fil_namarek!=undefined) { adata += "&fil_namarek="+ fil_namarek +""; }
		if (fil_sort!=undefined) { adata += "&fil_sort="+ fil_sort +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="banks") {
		var fil_namabank = $("#fil_namabank").val();
		var fil_inisial = $("#fil_inisial").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_namabank!=undefined) { adata += "&fil_namabank="+ fil_namabank +""; }
		if (fil_inisial!=undefined) { adata += "&fil_inisial="+ fil_inisial +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="togel-market") {
		var fil_namapasar = $("#fil_namapasar").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_namapasar!=undefined) { adata += "&fil_namapasar="+ fil_namapasar +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="bank-accounts") {
		var fil_kdbank = $("#fil_kdbank").val();
		var fil_norek = $("#fil_norek").val();
		var fil_namarek = $("#fil_namarek").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_kdbank!=undefined) { adata += "&fil_kdbank="+ fil_kdbank +""; }
		if (fil_norek!=undefined) { adata += "&fil_norek="+ fil_norek +""; }
		if (fil_namarek!=undefined) { adata += "&fil_namarek="+ fil_namarek +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="contact-categories" || parPageName=="social-media-categories" || parPageName=="sosmed-categories") {
		var fil_nama = $("#fil_nama").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_nama!=undefined) { adata += "&fil_nama="+ fil_nama +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
		if (parPageName=="social-media-categories" || parPageName=="sosmed-categories") {
			ajaxURL = "ajax_sosmed-categories.php";
		}
	}
	if (parPageName=="contacts" || parPageName=="social-media") {
		var fil_info = $("#fil_info").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_info!=undefined) { adata += "&fil_info="+ fil_info +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
		if (parPageName=="social-media") {
			ajaxURL = "ajax_sosmeds.php";
		}
	}
	if (parPageName=="user_activities") {
		var fil_stgl = $("#fil_stgl").val();
		var fil_etgl = $("#fil_etgl").val();
		var fil_kduser = $("#fil_kduser").val();
		var fil_limit = $("#fil_limit").val();
		if (fil_stgl!=undefined) { adata += "&fil_stgl="+ fil_stgl +""; }
		if (fil_etgl!=undefined) { adata += "&fil_etgl="+ fil_etgl +""; }
		if (fil_kduser!=undefined) { adata += "&fil_kduser="+ fil_kduser +""; }
		if (fil_limit!=undefined) { adata += "&fil_limit="+ fil_limit +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="user_visitors") {
		var fil_stgl = $("#fil_stgl").val();
		var fil_etgl = $("#fil_etgl").val();
		var fil_limit = $("#fil_limit").val();
		if (fil_stgl!=undefined) { adata += "&fil_stgl="+ fil_stgl +""; }
		if (fil_etgl!=undefined) { adata += "&fil_etgl="+ fil_etgl +""; }
		if (fil_limit!=undefined) { adata += "&fil_limit="+ fil_limit +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="languages") {
		var fil_kodelang = $("#fil_kodelang").val();
		var fil_namalang = $("#fil_namalang").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_kodelang!=undefined) { adata += "&fil_kodelang="+ fil_kodelang +""; }
		if (fil_namalang!=undefined) { adata += "&fil_namalang="+ fil_namalang +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="countries") {
		var fil_kodenegara = $("#fil_kodenegara").val();
		var fil_namanegara = $("#fil_namanegara").val();
		var fil_isactive = $("#fil_isactive").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_kodenegara!=undefined) { adata += "&fil_kodenegara="+ fil_kodenegara +""; }
		if (fil_namanegara!=undefined) { adata += "&fil_namanegara="+ fil_namanegara +""; }
		if (fil_kdlang!=undefined) { adata += "&fil_kdlang="+ fil_kdlang +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="game-categories") {
		var fil_nama = $("#fil_nama").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_nama!=undefined) { adata += "&fil_nama="+ fil_nama +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="games") {
		var fil_nama = $("#fil_nama").val();
		var fil_ket = $("#fil_ket").val();
		var fil_isactive = $("#fil_isactive").val();
		var fil_kdgame_cat = $("#fil_kdgame_cat").val();
		if (fil_nama!=undefined) { adata += "&fil_nama="+ fil_nama +""; }
		if (fil_ket!=undefined) { adata += "&fil_ket="+ fil_ket +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		if (fil_kdgame_cat!=undefined) { adata += "&fil_kdgame_cat="+ fil_kdgame_cat +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	if (parPageName=="user_authorization") {
		var fil_username = $("#fil_username").val();
		var fil_inisial = $("#fil_inisial").val();
		var fil_isactive = $("#fil_isactive").val();
		if (fil_username!=undefined) { adata += "&fil_username="+ fil_username +""; }
		if (fil_inisial!=undefined) { adata += "&fil_inisial="+ fil_inisial +""; }
		if (fil_isactive!=undefined) { adata += "&fil_isactive="+ fil_isactive +""; }
		ajaxURL = "ajax_"+ parPageName +".php";
	}
	/*
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/"+ ajaxURL +"",
		data: adata,
		success: function(resp){
			$(".ajax_resp").html(resp);
			$("[data-toggle=\"tooltip\"]").tooltip(); 
		}
	});
	*/
	$(".ajax_resp").html("<img src=\"/"+ adminFolder +"/img/ajax-loader.gif\" alt />");
	$.ajax({
		xhr: function() {
			var xhr = new window.XMLHttpRequest();
			//Upload progress
			xhr.upload.addEventListener("progress", function(evt){
				if (evt.lengthComputable) {
					var percentComplete = evt.loaded / evt.total;
					testProgressBar("upload", percentComplete);
					if ($(".progress-upload").length) { $("#progress-upload").html(percentComplete); }
					//Do something with upload progress
					//console.log(percentComplete);
				}
			}, false);
			//Download progress
			xhr.addEventListener("progress", function(evt){
				//alert(evt.lengthComputable);
				if (evt.lengthComputable) {
					//alert(evt.loaded+" / "+evt.total);
					var percentComplete = evt.loaded / evt.total;
					if ($(".progress-download").length) { testProgressBar("download", percentComplete); }
					//Do something with download progress
					//console.log(percentComplete);
				}
			}, false);
			return xhr;
		},
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/"+ ajaxURL +"",
		data: adata,
		success: function(resp){
			$(".ajax_resp").html(resp);
			$("[data-toggle=\"tooltip\"]").tooltip(); 
		}
	});
}
function testProgressBar(parJenis, parPerComplete) {
	var str = "";
	str = parPerComplete * 100 +"%";
	$(".progress-"+ parJenis +"").animate({ "width":str+"" }, function(){
		if (parPerComplete==1) {
			$(".progress-"+ parJenis +"").bind("click", function(){
				$(".progress-"+ parJenis +"").parent().hide();
			});
		}
	});
}
function quickReload(parPage) {
	//$(".ajax_resp").html("<img src=\"/"+ adminFolder +"/img/ajax-loader.gif\" alt />");
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/ajax_teachers.php",
		data: "a=section_main&cp="+ parPage +"",
		success: function(resp){
			$(".ajax_resp").html(resp);
		}
	});
}
function chActive(parPageName, parKd, parCurr) {
	if (parPageName=="social-media") {
		parPageName = "sosmeds";
	}
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/ajax_"+ parPageName +".php",
		data: "a=chactive&kd="+ parKd +"&ca="+ parCurr +"",
		success: function(resp){
			$(".isactive"+ parKd +"").html(resp);
		}
	});
}
function chBankOnOff(parPageName, parKd, parCurr) {
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/ajax_"+ parPageName +".php",
		data: "a=chbankonoff&kd="+ parKd +"&ca="+ parCurr +"",
		success: function(resp){
			$(".ison"+ parKd +"").html(resp);
		}
	});
}
function call_section(parPageName, parSection, parID) {
	//var aurl = "/"+ adminFolder +"/_ajax/index.php";
	var aurl = "/"+adminFolder+"/_ajax/ajax_"+ parPageName +".php";
	if (parPageName=="social-media") {
		aurl = "/"+adminFolder+"/_ajax/ajax_sosmeds.php";
	}
	if (parPageName=="social-media-categories") {
		aurl = "/"+adminFolder+"/_ajax/ajax_sosmed-categories.php";
	}
	var adata = "a="+ parSection +"&id="+ parID +"";
	//$(".ajax_resp").html('<img src"'+ adminFolder +'/img/ajax-loader.gif" alt />');
	$.ajax({
		type: "GET",
		url: aurl,
		data: adata,
		success: function(resp){
			$(".ajax_resp").html(resp);
		}
	});
}
function showError(parError) {
	$(".err").html(parError);
}
function bindDatePicker(parSelections) {
	$(parSelections).datepicker({
		inline: true,
		autosize: true,
		yearRange: "'.(date('Y', time())-5).':'.(date('Y', time())+1).'",
		changeMonth: true,
		changeYear: true,
		dateFormat: "dd-mm-yy"
	});
}
function formSubmit(parFormID) {
	$("#"+ parFormID +"").submit();
}
function checkSMS() {
	var aurl = "/"+adminFolder+"/_ajax/ajax_alerts.php";
	var adata = "a=check&b=sms&ttime=<?php echo time(); ?>";
	$(".notif-sms").html("loading...");
	$.ajax({
		type: "GET",
		url: aurl,
		data: adata,
		success: function(resp){
			//alert(resp);
			$(".notif-sms").html(resp);
			//$(".testingxx").html(resp);
		}
	});
}
function checkAlerts() {
	var aurl = "/"+adminFolder+"/_ajax/ajax_alerts.php";
	var adata = "a=check&b=all";
	//alert(aurl+"?"+adata);
	$.ajax({
		type: "GET",
		url: aurl,
		data: adata,
		success: function(resp){
			//alert(resp);
			var sresp = resp.split("$$");
			var noteDepo = 0;
			var noteWD = 0;
			var noteMem = 0;
			var notif = '';
			var zz = 0;
			for (var zz=0;zz<sresp.length;zz++) {
				notif = sresp[zz].split("$");
				if (notif[0]=="deposit") {
					noteDepo += parseInt(notif[1]);
					if (parseInt(notif[1]) > 0) {
						//$(".toplink-deposit").css({ "background":"#0f0" });
						//$(".toplink-deposit .notif").html(""+ notif[1] +"");
						//$(".toplink-deposit").attr("title", ""+ notif[1] +" Pending Deposits");
						$(".btn-deposits").addClass("btn-success").removeClass("btn-default");
						$(".notif-deposits").html(""+ notif[1] +"");
					} else {
						//$(".toplink-deposit").css({ "background":"#fff" });
						//$(".toplink-deposit .notif").html("");
						//$(".toplink-deposit").attr("title", ""+ notif[1] +" Pending Deposits");
						$(".btn-deposits").addClass("btn-default").removeClass("btn-success");
						$(".notif-deposits").html("");
					}
				} else
				if (notif[0]=="withdraw") {
					noteWD += parseInt(notif[1]);
					if (parseInt(notif[1]) > 0) {
						//$(".toplink-withdraw").css({ "background":"#0f0" });
						//$(".toplink-withdraw .notif").html(""+ notif[1] +"");
						//$(".toplink-withdraw").attr("title", ""+ notif[1] +" Pending Withdraws");
						$(".btn-withdraws").addClass("btn-success").removeClass("btn-default");
						$(".notif-withdraws").html(""+ notif[1] +"");
					} else {
						//$(".toplink-withdraw").css({ "background":"#fff" });
						//$(".toplink-withdraw .notif").html("");
						//$(".toplink-withdraw").attr("title", ""+ notif[1] +" Pending Withdraws");
						$(".btn-withdraws").addClass("btn-default").removeClass("btn-success");
						$(".notif-withdraws").html("");
					}
				} else
				if (notif[0]=="member") {
					noteMem += parseInt(notif[1]);
					if (parseInt(notif[1]) > 0) {
						//$(".toplink-member").css({ "background":"#0f0" });
						//$(".toplink-member .notif").html(""+ notif[1] +"");
						//$(".toplink-member").attr("title", ""+ notif[1] +" Pending Members");
						$(".btn-members").addClass("btn-success").removeClass("btn-default");
						$(".notif-members").html(""+ notif[1] +"");
					} else {
						//$(".toplink-member").css({ "background":"#fff" });
						//$(".toplink-member .notif").html("");
						//$(".toplink-member").attr("title", ""+ notif[1] +" Pending Members");
						$(".btn-members").addClass("btn-default").removeClass("btn-success");
						$(".notif-members").html("");
					}
				}
				
			}
			var soundTemple = document.getElementById("audio-temple");//$("#audio-temple");
			var soundNotif = document.getElementById("audio-notif");//$("#audio-notif");
			var soundBike = document.getElementById("audio-bike");//$("#audio-bike");
			var soundDaftar = document.getElementById("audio-daftar");
			var soundDeposit = document.getElementById("audio-deposit");
			var soundWithdraw = document.getElementById("audio-withdraw");
			if (noteMem>0) {
				soundDaftar.play();
			}
			if (noteDepo>0) {
				soundDeposit.play();
			}
			if (noteWD>0) {
				soundWithdraw.play();
			}
		}
	});
}
function loadUploadedImage(parPageName, parKd) {
	var adata = "a=loadfiles&kd="+ parKd +"&formodule="+ parPageName +"";
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/ajax_files.php",
		data: adata,
		success: function(resp){
			$(".ajax_resp").html(resp);
		}
	});
}
function loadFormUploadImage(parPageName, parKd, parTipeForm, parTipeData) {
	var adata = "a=readyform&tipeform"+ parTipeForm +"&tipedata="+ parTipeData +"&kd="+ parKd +"&formodule="+ parPageName +"";
	$.ajax({
		type: "GET",
		url: "/"+ adminFolder +"/_ajax/ajax_files.php",
		data: adata,
		success: function(resp){
			$(".ajax_resp").html(resp);
		}
	});
}