﻿function odeme_(fn,str)
{
	if (fn.length==0)
  	{
  		document.getElementById('kredi').innerHTML="";
  		return;
  	}
	
	if (str != 2)
  	{
  		document.getElementById('kredi').innerHTML="";
  		return;
  	}
	
	if (window.XMLHttpRequest) http2 = new XMLHttpRequest();
	else http2 = new ActiveXObject("Microsoft.XMLHTTP");
  
	var params2 = 'fn='+fn+'&str='+str;
	http2.open('POST', 'inc/getir.php', true);
	
	http2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http2.setRequestHeader("Content-length", params2.length);
	http2.setRequestHeader("Connection", "close");

	http2.onreadystatechange = function()
	{
		if(http2.readyState == 4 && http2.status == 200)  document.getElementById('kredi').innerHTML = http2.responseText;
	}
	http2.send(params2);
}

function siparis(fn,str,str1,str2,str3,str4,sehir,str5,str6,str7,adet,str9,str10,str11,str12,str13,str14,str15)
{
//alert(fn+'--'+str+'--'+str1+'--'+str2+'--'+str3+'--'+str4+'\n'+sehir+'--'+str5+'--'+str6+'--'+str7+'--'+str9+'--'+str10+'\n'+str11+'--'+str12+'--'+str13+'--'+str14+'--'+str15);return;
	if (str2 == '' ){ alert('Ad Soyad bilgisini girmek zorundasınız...'); return; }
	//if (str3 == '' ){ alert('E-mail bilgisini girmek zorundasınız...'); return; }
	if (str4 == '' ){ alert('Telefon bilgisini girmek zorundasınız...Örn(05554443322)'); return; }
	if (sehir == '' ){ alert('Şehir bilgisini girmek zorundasınız...'); return; }
	if (str5 == '' ){ alert('Adres bilgisini girmek zorundasınız...'); return; }
	if (str7 == '' ){ alert('Ürün bilgisini girmek zorundasınız...'); return; }
	if (adet == '' ){ alert('Adet bilgisini girmek zorundasınız...'); return; }
	if (str == '' ){ alert('Ödeme bilgisini girmek zorundasınız...'); return; }
	if(str == '1' )
	{
		if (str1 == '' ){ alert('Taksit bilgisini girmek zorundasınız...'); return; }
		if (str9 == '' || str9.length < 4 ){ alert('Kredi Kartı Numarası bilgisini girmek zorundasınız...'); return; }
		if (str10 == '' || str10.length < 4 ){ alert('Kredi Kartı Numarası bilgisini girmek zorundasınız...'); return; }
		if (str11 == '' || str11.length < 4 ){ alert('Kredi Kartı Numarası bilgisini girmek zorundasınız...'); return; }
		if (str12 == '' || str12.length < 4 ){ alert('Kredi Kartı Numarası bilgisini girmek zorundasınız...'); return; }
		if (str13 == '' || str13.length < 3 ){ alert('CVV Kodu bilgisini girmek zorundasınız...'); return; }
		if (str14 == '' ){ alert('Son Kullanma Tarihi Ay bilgisini girmek zorundasınız...'); return; }
		if (str15 == '' ){ alert('Son Kullanma Tarihi Yil bilgisini girmek zorundasınız...'); return; }
	}
	
	if (window.XMLHttpRequest) http1 = new XMLHttpRequest();
	else http1 = new ActiveXObject("Microsoft.XMLHTTP");
  
	var params1 = 'fn='+fn+'&odeme='+str+'&taksit='+str1+'&adsoyad='+str2+'&email='+str3+'&telefon='+str4+'&sehir='+sehir+'&adres='+str5+'&nott='+str6+'&urun='+str7+'&adet='+adet+'&cc1='+str9+'&cc2='+str10+'&cc3='+str11+'&cc4='+str12+'&cvv='+str13+'&ay='+str14+'&yil='+str15;
	
	http1.open('POST', 'inc/getir.php', true);
	http1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http1.setRequestHeader("Content-length", params1.length);
	http1.setRequestHeader("Connection", "close");

	http1.onreadystatechange = function()
	{
		if(http1.readyState == 4 && http1.status == 200) alert(http1.responseText);
	}
	http1.send(params1);
}

function btn(fn,str)
{
	if (fn.length==0)
  	{
  		document.getElementById('btn_').innerHTML="";
  		return;
  	}
	if (window.XMLHttpRequest) http1 = new XMLHttpRequest();
	else http1 = new ActiveXObject("Microsoft.XMLHTTP");
  
	var params1 = 'fn='+fn+'&drm='+str;
	http1.open('POST', 'inc/getir.php', true);
	http1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http1.setRequestHeader("Content-length", params1.length);
	http1.setRequestHeader("Connection", "close");

	http1.onreadystatechange = function()
	{
		if(http1.readyState == 4 && http1.status == 200)  document.getElementById('btn_').innerHTML = http1.responseText;
	}
	http1.send(params1);
}

function aranma(fn,str,str1,email,str2)
{
	if (str == '' ){ alert('Ad Soyad bilgisini girmek zorundasınız...'); return; }
	if (str1 == '' ){ alert('Telefon bilgisini girmek zorundasınız... Örn(05554443322)'); return; }
	//if (email == '' ){ alert('E-mail bilgisini girmek zorundasınız...'); return; }
	if (str2 == '' ){ alert('Konu bilgisini girmek zorundasınız...'); return; }
	
	if (window.XMLHttpRequest) http1 = new XMLHttpRequest();
	else http1 = new ActiveXObject("Microsoft.XMLHTTP");
  
	var params1 = 'fn='+fn+'&adsoyad='+str+'&telefon='+str1+'&email='+email+'&konu='+str2;
	http1.open('POST', 'inc/getir.php', true);
	http1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http1.setRequestHeader("Content-length", params1.length);
	http1.setRequestHeader("Connection", "close");

	http1.onreadystatechange = function()
	{
		if(http1.readyState == 4 && http1.status == 200)  alert(http1.responseText);
	}
	http1.send(params1);
}

function iletisim(fn,str,str1,str2,str3,str4)
{
	if (str == '' ){ alert('Ad Soyad bilgisini girmek zorundasınız...'); return; }
	if (str1 == '' ){ alert('Telefon bilgisini girmek zorundasınız... Örn(05554443322)'); return; }
	//if (str2 == '' ){ alert('E-mail bilgisini girmek zorundasınız...'); return; }
	if (str3 == '' ){ alert('Konu bilgisini girmek zorundasınız...'); return; }
	if (str4 == '' ){ alert('Mesaj bilgisini girmek zorundasınız...'); return; }
	
	if (window.XMLHttpRequest) http1 = new XMLHttpRequest();
	else http1 = new ActiveXObject("Microsoft.XMLHTTP");
  
	var params1 = 'fn='+fn+'&adsoyad='+str+'&telefon='+str1+'&email='+str2+'&konu='+str3+'&mesaj='+str4;
	http1.open('POST', 'inc/getir.php', true);
	http1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http1.setRequestHeader("Content-length", params1.length);
	http1.setRequestHeader("Connection", "close");

	http1.onreadystatechange = function()
	{
		if(http1.readyState == 4 && http1.status == 200)  alert(http1.responseText);
	}
	http1.send(params1);
}

function yorum(fn,str,str1,str2)
{
	if (str == '' ){ alert('Ad Soyad bilgisini girmek zorundasınız...'); return; }
	//if (str1 == '' ){ alert('E-mail bilgisini girmek zorundasınız...'); return; }
	if (str2 == '' ){ alert('Yorum bilgisini girmek zorundasınız...'); return; }
	
	if (window.XMLHttpRequest) http1 = new XMLHttpRequest();
	else http1 = new ActiveXObject("Microsoft.XMLHTTP");
  
	var params1 = 'fn='+fn+'&adsoyad='+str+'&email='+str1+'&mesaj='+str2;
	http1.open('POST', 'inc/getir.php', true);
	http1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http1.setRequestHeader("Content-length", params1.length);
	http1.setRequestHeader("Connection", "close");

	http1.onreadystatechange = function()
	{
		if(http1.readyState == 4 && http1.status == 200)  alert(http1.responseText);
	}
	http1.send(params1);
}
