<?php echo !defined("GUVENLIK") ? die("Erisim Engellendi!.") : null;?>
<?php if(!isset($_SESSION["email"])){
	header("Location:giris.html");
}?>
<?php
if(g('islem')=="sil")
{
	$id = p('adresid');
	$adres_sil_sorgu = Sorgu("DELETE FROM adres WHERE id='$id'");
}
?>
<!-- page wapper-->
<div class="columns-container">
    <div class="container" id="columns" style="margin-bottom: 20px;">
        <!-- row -->
        <div class="row">
            <!-- Left colunm -->
            <div class="column col-xs-12 col-sm-3" id="left_column">
				
            </div>
            <!-- ./left colunm -->
            <!-- Center colunm-->
            <div class="center_column col-xs-12 col-sm-9" id="center_column">
                <!-- page heading-->
                <h2 class="page-heading">
                    <span class="page-heading-title"><a href="hesabim.html">Hesabım </a> » Adres Defterim</span>
                </h2>
                <!-- Content page -->
                <div class="content-text clearfix">
					<div class="row">
					<div class="col-sm-12">
						<div class="box-authentication">
							<table style="width:60%;" cellpadding="10" cellspacing="3" border="0">
								<tbody>
								<?php $Sorgu = Sorgu("SELECT * FROM adres WHERE uyeid = '{$_SESSION['uyeid']}'");
								while($Sonuc = Sonuc($Sorgu)){?>
								<?php $ilce = Sonuc(Sorgu("SELECT * FROM ilceler WHERE id = '$Sonuc->semt'"));?>
								<?php $il = Sonuc(Sorgu("SELECT * FROM iller WHERE id = '$Sonuc->sehir'"));?>
								<tr>
								<?php if($Sonuc->adres_tipi == "kurumsal"){?>
									<b style="color:red;"><?php echo $Sonuc->baslik;?></b>
									<td align="left" width="60%">
										<b>Firma : <?php echo $Sonuc->firma_adi;?></b><br>
										 Vergi Numarası : <?php echo $Sonuc->vn;?><br>
										 Vergi Dairesi : <?php echo $Sonuc->vd;?><br>
										 <?php echo $Sonuc->adres;?><br>
										 <?php echo $ilce->baslik;?>, <?php echo $Sonuc->postakodu;?><br>
										 <?php echo $il->baslik;?>, <br>
										 Telefon : <?php echo $Sonuc->ceptel;?>			  
									</td>
								<?php }elseif($Sonuc->adres_tipi == "bireysel"){?>
								<b style="color:red;"><?php echo $Sonuc->baslik;?></b>
									<td align="left" width="60%">
										<b>Ad,Soyad : <?php echo $Sonuc->ad;?> <?php echo $Sonuc->soyad;?></b><br>
										TC Kimlik No : <?php echo $Sonuc->tc;?><br>
										<?php echo $Sonuc->adres;?><br>
										<?php echo $ilce->baslik;?>, <?php echo $Sonuc->postakodu;?><br>
										<?php echo $il->baslik;?>, <br>
										Telefon : <?php echo $Sonuc->ceptel;?>				  
									</td>
								<?php }?>
									 <td width="40%" align="right">
										<form name="formedit" action="adres-ekle.html?islem=duzenle" method="post">
										<input type="hidden" name="adresid" id="adresid" value="<?php echo $Sonuc->id;?>">
										<input type="submit" name="submit_edit" value="Değiştir" class="btn btn-primary">			
										</form>
										<br><br>
													  
										<form name="formedit" action="adres.html?islem=sil" method="post" onsubmit="return(confirm('Bu Adresi Kaldırmak İstediğinizden Emin Misiniz?'));">
										<input type="hidden" name="adresid" id="adresid" value="<?php echo $Sonuc->id;?>">
										<input type="submit" name="submit_delete" value="Kaldır" class="btn btn-danger">			
										</form>
									</td>
								</tr>
								<tr><td colspan="2"><hr></td></tr>
								<?php }?>
								</tbody>
							</table>
							
							<form name="formedit" action="adres-ekle.html" method="post">
								<button type="submit" name="submit_add" class="btn btn-success"><i style="margin-top: 3px;" class="fa fa-plus"></i> Adres Ekle</button>
							 </form>
						</div>
					</div>
				</div>
                </div>
                <!-- ./Content page -->
            </div>
            <!-- ./ Center colunm -->
        </div>
        <!-- ./row-->
    </div>
</div>
<!-- ./page wapper-->