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

	if($_SESSION["zalogowany"]!==1) {
		header("Location: $basehttp/admin/"); 
	}	
	
	$type = trim($_GET['type']);
	
	foreach ($_GET['listItem'] as $position => $item) :
		$sql="UPDATE $type SET `position` = $position  WHERE `id` = $item "	;	
		mysql_query ($sql)  or die('Blad zapytania2: '.mysql_error());	
	endforeach;
	
?>

