<?php
session_start();	
?>
<?php
include_once 'ayarlar.php';
$mysql_baglanti= new yonetici(); 
$mysql_baglanti->mysql_baglan();
error_reporting(E_ALL ^ E_NOTICE);
ini_set('error_reporting', E_ALL ^ E_NOTICE); 
?>


<?php
if($_POST['f']=='delete_language'){
	mysql_query("Delete from languages where id='".$_POST['language']."'");
}?>
<? if ($_POST['islem']=="show_language"){?>
<? mysql_query("UPDATE languages SET status='0' where id='".addslashes($_POST['language'])."'")?>
<?  } ?>

<? if ($_POST['islem']=="hide_language"){?>
<? mysql_query("UPDATE languages SET status='1' where id='".addslashes($_POST['language'])."'")?>
<?  } ?>



<? if($_POST['f']=='delete_project_list'){
	mysql_query("Delete from projects where id='".$_POST['project']."'");
}?>

<? if ($_POST['islem']=="add_popular"){?>
<? mysql_query("UPDATE projects SET featured_project='1' where id='".addslashes($_POST['project'])."'")?>
<?  } ?>

<? if ($_POST['islem']=="remove_popular"){?>
<? mysql_query("UPDATE projects SET featured_project='0' where id='".addslashes($_POST['project'])."'")?>
<?  } ?>

<? if ($_POST['islem']=="show_project_on_site"){?>
<? mysql_query("UPDATE projects SET status='0' where id='".addslashes($_POST['project'])."'")?>
<?  } ?>

<? if ($_POST['islem']=="hide_project_on_site"){?>
<? mysql_query("UPDATE projects SET status='1' where id='".addslashes($_POST['project'])."'")?>
<?  } ?>


<? if($_POST['f']=='delete_product_list'){
	mysql_query("Delete from products where id='".$_POST['product']."'");
}?>

<? if ($_POST['islem']=="add_popular"){?>
<? mysql_query("UPDATE products SET featured_product='1' where id='".addslashes($_POST['product'])."'")?>
<?  } ?>

<? if ($_POST['islem']=="remove_popular"){?>
<? mysql_query("UPDATE products SET featured_product='0' where id='".addslashes($_POST['product'])."'")?>
<?  } ?>

<? if ($_POST['islem']=="show_product_on_site"){?>
<? mysql_query("UPDATE products SET status='0' where id='".addslashes($_POST['product'])."'")?>
<?  } ?>

<? if ($_POST['islem']=="hide_product_on_site"){?>
<? mysql_query("UPDATE products SET status='1' where id='".addslashes($_POST['product'])."'")?>
<?  } ?>


<?
if ($_POST['f'] == "order_pages"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update pages Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>

<?
if ($_POST['f'] == "order_page_files"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update page_files Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>
<?
if ($_POST['f'] == "order_slider"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update slider Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>

<?
if ($_POST['f'] == "order_project"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update projects Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>
<?
if ($_POST['f'] == "order_product"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update products Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>


<?
if ($_POST['f'] == "order_project_gallery"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update project_gallery Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>
<?
if ($_POST['f'] == "order_product_gallery"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update product_gallery Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>


<?
if ($_POST['f'] == "order_product_category"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update product_categories Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>
<?
if ($_POST['f'] == "order_project_category"){
	$array	= $_POST['arrayorder'];
	$count = 1;
	foreach ($array as $idval) {
		mysql_query("Update project_categories Set priority='".$count."' where id ='".$idval."'");
		$count ++;	
	}
	echo 'Sıralama İşlemi Gerçekleşmiştir.';
}
?>
