<?php
include("../../../secure.php");
$path="../../../";
include("../../../map.php");
include("../../../scripts.php");
$yfd = new DateTime('first day of January');
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<style type="text/css">
	table {font-family: 'Open Sans', sans-serif;}
	@media print { .noprint { display: none !important; } }
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
    padding: 3px;
    line-height: 1.2;
}
</style>
<?php if($_POST["ts1"]==""){?>
<form action="" method="post">
	<div class="col-sm-3">
		<input type="date" class="form-control" name="ts1" placeholder="" value="<?php echo $yfd->format('Y-m-d')?>">
	</div>
	<div class="col-sm-3">
		<input type="date" class="form-control" name="ts2" placeholder="" value="<?php echo date('Y-m-d')?>">
	</div>
	<div class="col-sm-3">
		<button type="submit" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;"><?php echo translate("Listele")?></button>
	</div>
</form>
<?php }elseif($_POST["ts1"]<>""){ ?>
<div class="container">
			<table class="table">
				<tr>
					<td scope="col" style="width:40%; font-size:11px;" class=""><?php echo $_SESSION["fName"]?></td>
					<td scope="col" style="text-align:center;" class=""><b><?php echo ihb($_REQUEST["tip"])?> Kar/Zarar <?php if($_REQUEST["ts1"]<>"" or $_REQUEST["ts2"]<>""){?><br><?php echo dtarih($_REQUEST["ts1"],"gg.aa.yyyy")?>-<?php echo dtarih($_REQUEST["ts2"],"gg.aa.yyyy")?><?php }?></b></td>
					<td scope="col" style="width:30%; font-size:11px; text-align:right" class=""><?php echo dtarih(date("Y-m-d H:i:s"),"gg.aa.yyyy time")?></td>
				</tr>
			</table>
			<table class="table" style="font-size:11px; margin-top:25px;">
				<tr style="background: beige;">
					<th colspan="2" scope="col" style="text-align:center;" class="">GELİR TABLOSU</th>
				</tr>
				<tr>
					<td scope="col" style="" class="">KAR VEYA ZARAR KISMI</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and t10='203' order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$kgbakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Kira Geliri</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($kgbakiye,2,',','.')?></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t10='271' or t10='351') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$gdaabakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Gayrimenkul Değer Artış/Azalışları</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($gdaabakiye,2,',','.')?></td>
				</tr>
				<tr>
					<td scope="col" style="" class="">Faiz Gelirler</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
				<tr>
					<td scope="col" style="" class="">Temettü Gelirler</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t10='202') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$fvbakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Finansal Varlık ve Yükümlülüklere İlişkin Gerçekleşmiş Kar/Zarar</th>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($fvbakiye,2,',','.')?></th>
				</tr>
				<tr>
					<td scope="col" style="" class="">Finansal Varlık ve Yükümlülüklere İlişkin Gerçekleşmemiş Kar/Zarar</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
				<tr>
					<td scope="col" style="" class="">Net Yabancı Para Çevrim Farkı Gelirleri</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t10='241') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$edgbakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Esas Faaliyetlerden Diğer Gelirler</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($edgbakiye,2,',','.')?></td>
				</tr>
				<tr style="background: beige;">
					<th scope="col" style="" class="">Esas Faaliyet Geliri</th>
					<th scope="col" style="width:20%; text-align:right;" class=""></th>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t2='370 06 001') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$yubakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Yönetim Ücretleri</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($yubakiye,2,',','.')?></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t2='370 98 001') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$pubakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Performans Ücretleri</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($pubakiye,2,',','.')?></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t11='370 09') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$subakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Saklama Ücretleri</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($subakiye,2,',','.')?></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t10='370 99 006') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$mkkbakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">MKK Ücretler</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($mkkbakiye,2,',','.')?></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t11='370 07') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$dubakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Denetim Ücretler</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($dubakiye,2,',','.')?></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t11='370 10') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$daubakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Danışmanlık Ücretler</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($daubakiye,2,',','.')?></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t2='370 11 05') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$kubakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Kurul Ücretler</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($kubakiye,2,',','.')?></td>
				</tr>
				<tr>
					<td scope="col" style="" class="">Komisyon ve Diğer İşlem Ücretleri</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t10='370') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$efdbakiye=$btoplam-$atoplam;
	}
	?>
				<tr>
					<td scope="col" style="" class="">Esas Faaliyetlerden Diğer Giderler</td>
					<td scope="col" style="width:20%; text-align:right;" class=""><?php echo number_format($efdbakiye,2,',','.')?></td>
				</tr>
	<?php
	$btoplam=0;$atoplam=0;
	$i=0;$sqlfu = mysqli_query($conn, "select * from t4 where s2=".$_SESSION["fID"]." and (t2='370 06 001') order by id asc"); while($rsfu=mysqli_fetch_assoc($sqlfu)){
		$btoplam=$btoplam+$rsfu["pb1"];
		$atoplam=$atoplam+$rsfu["pb2"];
		$efdbakiye=$btoplam-$atoplam;
	}
	?>
				<tr style="background: beige;">
					<th scope="col" style="" class="">Esas Faaliyet Giderleri</th>
					<th scope="col" style="width:20%; text-align:right;" class=""></th>
				</tr>
				<tr style="background: beige;">
					<th scope="col" style="" class="">Esas Faaliyet Kar/Zararı</th>
					<th scope="col" style="width:20%; text-align:right;" class=""></th>
				</tr>
				<tr>
					<td scope="col" style="" class="">Finansman Giderleri</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
				<tr style="background: beige;">
					<th scope="col" style="" class="">Net Dönem Karı / Zararı (A)</th>
					<th scope="col" style="width:20%; text-align:right;" class=""></th>
				</tr>
				<tr>
					<td scope="col" style="" class="">DİĞER KAPSAMLI GELİR KISMI</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
				<tr>
					<td scope="col" style="" class="">Kar veya Zararda Yeniden Sınıflandırılmayacaklar</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
				<tr>
					<td scope="col" style="" class="">Kar veya Zararda Yeniden Sınıflandırılacaklar</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
				<tr>
					<td scope="col" style="" class="">Diğer Kapsamlı Gelir (B)</td>
					<td scope="col" style="width:20%; text-align:right;" class=""></td>
				</tr>
				<tr style="background: beige;">
					<th scope="col" style="" class="">TOPLAM DEĞERDE/NET VARLIK DEĞERİNDE ARTIŞ/AZALIŞ (A+B)</th>
					<th scope="col" style="width:20%; text-align:right;" class=""></th>
				</tr>
			</table>
</div>
			<i class="btn btn-xs btn-warning fa fa-print noprint" style="position: absolute; top: 0px; right: 10px;" onclick="window.print();"></i>
			<a href="?" class="btn btn-xs btn-info fa fa-arrow-left noprint" style="position: absolute; top: 0px; right: 40px;"></a>
<?php }?>