<?php

$query=$db->prepare("SELECT * FROM setting");
$query->execute();
$row=$query->fetch(PDO::FETCH_ASSOC);

$theme = $settings["theme"];

if (isset($_POST['editiletisim'])) {
	$duzenle=$db->prepare("UPDATE setting SET

		address=:address,
		phone=:phone,
		gsm=:gsm,
		email=:email,
		facebook=:facebook,
		twitter=:twitter,
		instagram=:instagram,
		linkedin=:linkedin,
		youtube=:youtube,
		android_app=:android_app,
		ios_app=:ios_app
		WHERE id=0");
	$update=$duzenle->execute(array( 
		'address' => $_POST['address'],
		'phone' => $_POST['phone'],
		'gsm' => $_POST['gsm'],
		'email' => $_POST['email'],
		'facebook' => $_POST['facebook'],
		'twitter' => $_POST['twitter'],
		'instagram' => $_POST['instagram'],
		'linkedin' => $_POST['linkedin'],
		'youtube' => $_POST['youtube'],
		'android_app' => $_POST['android_app'],
		'ios_app' => $_POST['ios_app']
	));
	if ($update) {
		$success = 'İşlem başarıyla gerçekleşti.';
	} else {
		$error = 'Ayarlar güncellenirken bir hata oluştu.';
	} 
}

require admin_view('iletisim-ayarlar');