<?php
if(is_dir("deppo")){$path="";}elseif(is_dir("../deppo")){$path="../";}elseif(is_dir("../../deppo")){$path="../../";}else{$path="../../../";}
include("".$path."deppo/tools/script/cevir.php");
$path2="config/"; include("".$path."config/map.php");
include("".$path."deppo/tools/script/fonksiyon".$ver.".php");
?>
<style type="text/css">
	.banka ul {list-style:none}
	.bank0 {background-repeat: no-repeat; background-position: -219px -271px;} /*Diğer*/
	.bank16 {background-repeat: no-repeat; background-position: 0px 0px;}/*Garanti*/
	.bank41 {background-repeat: no-repeat; background-position: 0px -165px;} /*Axess*/
	.bank28 {background-repeat: no-repeat; background-position: 0px -55px}/*Maximum*/
	.bank32 {background-repeat: no-repeat; background-position: -219px -55px;}/*Teb*/
	.bank39 {background-repeat: no-repeat; background-position: 0px -110px; color:white;} /*Word*/
	.bank27 {background-repeat: no-repeat; background-position: -215px 0px;} /*Halk Bank*/
	.bank14 {background-repeat: no-repeat; background-position: 0px -217px; color:white;} /*Finans Bank*/
	.bank40 { background-repeat: no-repeat; background-position: 0px -385px; } /*Ziraat*/
	.bank38 {background-repeat: no-repeat; background-position: 0px -435px; } /*Vakıfbank*/
	.ttbl tr td {border-top: 0px !important;}
	.ttbl {margin-bottom:0px;}
	.active{cursor:pointer;}
	.passive{cursor: not-allowed;}
</style>
<?php
if($_SESSION["cno"]<>"" and strlen($_GET["kno"])<6){
	$_SESSION["cno"]="";
	$_SESSION["card_info"]="";
}
if(strlen($_GET["kno"]) > 5){
	$card_info = file_get_contents("https://cdn.hizliode.com.tr/bin/?kno=".substr($_GET["kno"],0,6)."");
	$_SESSION["cno"]=$_GET["kno"];
	$_SESSION["card_info"]=$card_info;
}
$result = json_decode($_SESSION["card_info"], true);
$card_family=$result["card_family"]; //bonus
$bin=$result["bin"];
$lbins = explode(',',$result["like_bins"]);
$rs0 = mysqli_query($conn, "select * FROM genel where ne='banka' and s2>0 and s1<>0 ".$ps4." and s13=1"); $rss0=mysqli_num_rows($rs0);
$sqlb=mysqli_query($conn, "select * from genel where ne='banka' and s2>0 ".$ps4." and s13=1 order by s10 asc"); $banka_say = mysqli_num_rows($sqlb); while($banka=mysqli_fetch_assoc($sqlb)){
	$sqlt = mysqli_query($conn, "select * FROM genel where ne='taksit' and s1=".$banka["id"]." order by s2 asc"); $rst=mysqli_num_rows($sqlt); $scount = mysqli_num_rows($sqlt);
	$prenk="#".$banka["t3"]."";
	if($rss0==1){
		$colmd="12";
	}elseif($rss0==2){
		$colmd="6";
	}elseif($rss0==3 or $rss0>3){
		$colmd="4";
	}
	?>
	<div class="v3-col-md-<?php echo $colmd;?> banka bank<?php echo $banka["s1"]?>" style="<?php if($rss0==1 and $scount==1){echo "display:none;";}?>">
		<ul class="v3-list-group">
			<li title="<?php echo $banka["t1"]?> > <?php echo $banka["t2"]?>" style="background-color:<?php echo $prenk?>; width:100%; height:60px; margin:0px; padding:1px; text-align:center; color:#fff; border-radius:5px;"><?php if($banka["s1"]<>0){?><div style="margin-left: auto; margin-right: auto; height: 65px; width: 210px;" class="banks bank<?php echo $banka["s1"]?>"></div><?php }else{?><span style="font-size:20px; font-weight:bold;">Diğer Banka Kartları (Tek Çekim)</span><br>Anlaşmalı bankalar haricindeki tek çekimleri lütfen buradan yapınız. ( paraf kart ,citibank gibi, amerikan express vb. )<?php }?></li>
			<li style="font-size:11px; font-family:Arial; color:#fff; background-color:#ccc; margin:0px; padding:0px; vertical-align:middle; border-top:solid 1px #fff;">
				<table class="v3-table ttbl">
					<tr>
						<td style="text-align:center; width:10%; background-color: #ccc !important;"><?php echo translate('Seç','Select')?></td>
						<td style="text-align:center; width:10%; background-color: #ccc !important;"><?php echo translate('Taksit','Installment')?></td>
						<td style="text-align:right; width:40%;background-color: #ccc !important;"><?php echo translate('Taksit','Installment')?> <?php echo translate('Tutar','Amount')?></td>
						<td style="text-align:right; width:40%; background-color: #ccc !important;"><?php echo translate('Toplam','Total')?></td>
					</tr>
				</table>
			</li>
			<?php
			if($module["pos_taksit_limit"]<>""){ $taksit_limit=$module["pos_taksit_limit"]; }else{ $taksit_limit=99999999999; }
			if($_SESSION["s6"]<>""){
				$esorgu=" and s4='".$_SESSION["s6"]."'";
			}else{
				$esorgu=" and s4=0";
			}
			
			if(mysqli_num_rows($sqlt)==0){echo "<li style=\"font-size:11px; font-family:Arial; color:#999; height:35px; margin:0px; padding:10px 0px; vertical-align:middle; border-top:solid 1px #fff;\"><?php echo translate('Ödeme seçeneği bulunamadı.','Payment option not found.')?></li>";}
			 $q=0;while($taksit=mysqli_fetch_assoc($sqlt)){$s++;$q++;
				if (($t%2)==0){
					$trenk="".$prenk."d6";
				}else{
					$trenk="".$prenk."6d";
				}
				$vade=(100+$taksit["pb1"])/100;
				if($_GET["tutar"]=="" or $_GET["tutar"] < $taksit_limit){$dn="dn";} if($q==1){$dn="";}
				?>
				<?php if(($banka["s4"]==$lbins[0] or $banka["s4"]==$lbins[1] or $banka["s4"]==$lbins[2] or $banka["s4"]==$lbins[3] or $banka["s4"]==$lbins[4] or $banka["s4"]==$lbins[5]) or substr($_GET["kno"],0,4)=="0000"){$card_family="1"; $t++;}else{$card_family="0";}?>
					<?php if(($card_family==1 and $t==1) or ($card_family==0 and $s==1)){$tID=$taksit["id"];}?>
					<li style="margin:0px; vertical-align:middle;" id="c<?php echo $taksit["id"]?>a" title="<?php echo $t?>" class="<?php echo $dn;?>">
						<table class="v3-table ttbl" id="<?php echo $tID?>" style="">
							<tr id="c<?php echo $taksit["id"]?>tr" class="<?php if($card_family==1 or ($card_family==0 and $taksit["s2"]==0)){echo "active";}else{echo "passive";}?>">
								<td style="text-align:center; width:10%;background-color:<?php echo $trenk?> !important;">
									<input <?php if($card_family==1 or ($card_family==0 and $taksit["s2"]==0)){}else{echo "disabled";}?> class="icontrol" type="radio" name="tx" id="c<?php echo $taksit["id"]?>" t1="<?php echo $banka["t1"]?>" s1="<?php echo $banka["s1"]?>" s4="<?php echo $banka["s4"]?>" ts2="<?php echo $taksit["s2"]?>" ttutar="<?php echo sprice(($_GET["tutar"]*$vade)/$taksit["s2"])?>" tutar="<?php echo sprice(($_GET["tutar"]*$vade))?>" vadef="<?php echo sprice((($_GET["tutar"]*$vade)-$_GET["tutar"]))?>" bs2="<?php echo $banka["s2"]?>" s3="<?php echo $banka["s3"]?>" t2="<?php echo $banka["t2"]?>" pb="<?php echo $kpb?>" tvf="<?php echo $taksit["pb1"]?>">
								</td>
								<td style="text-align:center; width:10%;background-color:<?php echo $trenk?> !important;">
									<?php if($taksit["s2"]>1){?><?php echo $taksit["s2"]?><?php }else{?>-<?php }?>
								</td>
								<td style="text-align:right; width:40%;background-color:<?php echo $trenk?> !important;">
									<?php if($taksit["s2"]>1){?><?php echo number_format((($_GET["tutar"]*$vade)/$taksit["s2"]),2)?> <span style="font-size:10px;">x <?php echo $taksit["s2"]?></span><?php }else{?><?php echo number_format(($_GET["tutar"]),2)?><?php }?>
								</td>
								<td style="text-align:right; width:40%;background-color:<?php echo $trenk?> !important;">
									<?php echo number_format(($_GET["tutar"]*$vade),2)?>
								</td>
							</tr>
						</table>
					</li>
<?php }?>
</ul>
</div>
<?php }?>
<script>
<?php if(strlen($_GET["kno"])>5){?>
	jQuery(document).ready(function(){
		jQuery("#c<?php echo $tID?>").prop("checked", true);
		jQuery("#c<?php echo $tID?>a").addClass("actived");
		var t1 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('t1');//0
		var s1 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('s1');//1
		var ts2 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('ts2');//2
		var ttut = jQuery(document.querySelector('input[name="tx"]:checked')).attr('ttutar');//3
		var gtop = jQuery(document.querySelector('input[name="tx"]:checked')).attr('tutar');//4
		var bs2 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('bs2');//5
		var bs3 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('bs3');//6
		var t2 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('t2');//7
		var pb = jQuery(document.querySelector('input[name="tx"]:checked')).attr('pb');//8
		var vf = jQuery(document.querySelector('input[name="tx"]:checked')).attr('vadef');//9
		var tvf = jQuery(document.querySelector('input[name="tx"]:checked')).attr('tvf');//10
		var posDiv = document.getElementById("posislem");
		<?php if(strlen($_GET["kno"])>5){?>
			if(posDiv) {
				if(ts2==0 || ts2==1){
					jQuery("#Installment").val('1');
					show("posislem");
					posDiv.innerHTML = "<b>"+t1+"</b>&nbsp;<?php echo translate('Tek Çekim','No Installment')?>&nbsp;<b>"+gtop+"</b>&nbsp;<?php echo $kpb?>";
				} else {
					jQuery("#Installment").val(ts2);
					show("posislem");
					posDiv.innerHTML = "<b>"+t1+"</b>&nbsp;&nbsp;"+ts2+"x"+ttut+"&nbsp;=&nbsp;<b>"+gtop+"</b>&nbsp;<?php echo $kpb?>";
				}
			}
		<?php } else { ?>
			var posDiv = document.getElementById("posislem");
			if(posDiv) {
				jQuery("#Installment").val(ts2);
				show("posislem");
				posDiv.innerHTML = "<?php echo translate('Lütfen Kart Bilgisi Giriniz','Please Insert Card Number')?>";
			}
		<?php } ?>

//		var gtop = gtop.replace(/[^\w\s]|_/g, "");
//		var htutar = gtop.substring(0, gtop.length - 2);
		var htutar = gtop;
		jQuery("#Bank").val(t1);
		jQuery("#Bank_Id").val(s1);
		jQuery("#Total").val(htutar);
		jQuery("#Interest").val(vf);
		jQuery("#Interest_Percent").val(tvf);
		if (jQuery(".payment_total_price")[0]){
			jQuery(".payment_total_price").html(''+htutar+' <?php echo $ikpb?>');
		}else{
			jQuery(".order_total_price").html(htutar);
			if(vf>0){
				jQuery('#order_sum_item').html('<div class="v3-row" style="padding: 10px 0px; border-bottom: 1px solid #cccccc38;"><div class="v3-col-md-6 v3-col-xs-6" style="text-align:left;color:#999">Komisyon</div><div class="v3-col-md-6 v3-col-xs-6" style=" text-align:right; font-weight: bold;color:#999">'+vf+' <?php echo $ikpb?></div></div>');
			}else{
				jQuery('#order_sum_item').html('');
			}
		}
		<?php if(substr($_GET["kno"],0,4)<>"0000"){?>
		jQuery("#Card_Bank_ID").val(s1);
		jQuery("#Card_Bank").val('<?php echo $result["bank"];?>');
		jQuery("#Card_Type").val('<?php echo $result["mv"];?>');
		<?php }?>
		if(bs2==1){
			jQuery("#Payment").val('Pos Ödeme');
			jQuery("#Payment_Method").val('pos');
		}else{
			tip=""+t2+" Ödeme";
			var tip2 = t2.toLowerCase();
			jQuery("#Payment").val(tip);
			jQuery("#Payment_Method").val(tip2);
		}
	});
	jQuery('.ttbl .active').click(function(){
		jQuery(this).find('td input:radio').prop('checked', true);
		//var str =document.querySelector('input[name="tx"]:checked').value;
		var t1 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('t1');//0
		var s1 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('s1');//1
		var ts2 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('ts2');//2
		var ttut = jQuery(document.querySelector('input[name="tx"]:checked')).attr('ttutar');//3
		var gtop = jQuery(document.querySelector('input[name="tx"]:checked')).attr('tutar');//4
		var bs2 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('bs2');//5
		var bs3 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('bs3');//6
		var t2 = jQuery(document.querySelector('input[name="tx"]:checked')).attr('t2');//7
		var pb = jQuery(document.querySelector('input[name="tx"]:checked')).attr('pb');//8
		var vf = jQuery(document.querySelector('input[name="tx"]:checked')).attr('vadef');//9
		var tvf = jQuery(document.querySelector('input[name="tx"]:checked')).attr('tvf');//10
		var posDiv = document.getElementById("posislem");
		if(posDiv) {
			if(ts2==0 || ts2==1){
				jQuery("#Installment").val('1');
				show("posislem");
				posDiv.innerHTML = "<b>"+t1+"</b>&nbsp;<?php echo translate('Tek Çekim','No Installment')?>&nbsp;<b>"+gtop+"</b>&nbsp;<?php echo $kpb?>";
			} else {
				jQuery("#Installment").val(ts2);
				show("posislem");
				posDiv.innerHTML = "<b>"+t1+"</b>&nbsp;"+ts2+"x"+ttut+"&nbsp;=&nbsp;<b>"+gtop+"</b>&nbsp;<?php echo $kpb?>";
			}
		}

	//	var gtop = gtop.replace(/[^\w\s]|_/g, "");
	//	var htutar = gtop.substring(0, gtop.length - 2);
		var htutar = gtop;
	if (jQuery(".payment_total_price")[0]){
		jQuery(".payment_total_price").html(''+htutar+' <?php echo $ikpb?>');
	}else{
		jQuery(".order_total_price").html(htutar);
		if(vf>0){
			jQuery('#order_sum_item').html('<div class="v3-row" style="padding: 10px 0px; border-bottom: 1px solid #cccccc38;"><div class="v3-col-md-6 v3-col-xs-6" style="text-align:left;color:#999">Komisyon</div><div class="v3-col-md-6 v3-col-xs-6" style=" text-align:right; font-weight: bold;color:#999">'+vf+' <?php echo $ikpb?></div></div>');
		}else{
			jQuery('#order_sum_item').html('');
		}
	}
		jQuery("#Bank").val(t1);
		jQuery("#Bank_Id").val(s1);
		jQuery("#Total").val(htutar);
		jQuery("#Interest").val(vf);
		jQuery("#Interest_Percent").val(tvf);
		if(bs2==1){
			jQuery("#Payment").val('Pos Ödeme');
			jQuery("#Payment_Method").val('pos');
		}else{
			tip=""+t2+" Ödeme";
			var tip2 = t2.toLowerCase();
			jQuery("#Payment").val(tip);
			jQuery("#Payment_Method").val(tip2);
		}
	});
<?php }?>
</script>
<div style="clear:both;"></div>