<?php
session_start();
include('../includes/config.php'); 

if(!is_numeric($_GET['id'])){
	exit();
} else {
	$id=$_GET['id'];
}

if($_SESSION["zalogowany"]!==1) {
	header("Location: $basehttp/admin/"); 
}


$type=$_GET['type'];
$column=$_GET['column'];

switch ($type):
	case 'lang':
		mysql_query("UPDATE $type SET `".$column."`=ABS(`".$column."`-1) WHERE id = '$id'"); 	
	break;	
	case 'pages':
		mysql_query("UPDATE $type SET `".$column."`=ABS(`".$column."`-1) WHERE id = '$id'"); 	
	break;
	case 'gallery':
		mysql_query("UPDATE $type SET `".$column."`=ABS(`".$column."`-1) WHERE id = '$id'"); 	
	break;			
endswitch;		

?>
