<?php 
include '../xpanel/inc/vt.php';


if($_GET['islem']=="adres-sil"){
	$id=$_GET['id'];

	$adres_sil = $dbh->prepare("DELETE FROM users_adress WHERE id = ?");
	$adres_sil->execute([$id]);
	if ($adres_sil) {
		$_SESSION['okey']=1;
		header("location:../musteri.php");
	} 
}

if(isset($_POST['duzenle'])){
	print_r($_POST);
	$id	=	$_POST["id"];
	$mah	=	$_POST["mah"];
	$adres	=	$_POST["adres"];
	$adres_baslik	=	$_POST["adres_baslik"];

	$guncelle = $dbh -> prepare("UPDATE users_adress SET baslik=?,  adress=? WHERE uye=? && id = ?");
	$guncelle->execute([$adres_baslik,$adres,$_SESSION['user']->id, $id]);
	if ($guncelle) {
		$_SESSION['okey']=1;
		header("location:../musteri.php");
	}
}



?>