<?
	require_once('user.php');
	require_once('mysql.php');
	require_once('functions.php');
	
	// SETUP MYSQL HANDLERS
	$mysqldb1 = new mysql($host, $user, $pswd, $db); $mysqldb1->connect(); $mysqldb1->select();
	
	$response = 0;
	
	switch ($_GET['table']) {
	case 'file':
		$query = "UPDATE file SET description='".trim(mysql_real_escape_string(stripslashes(urldecode($_GET['description']))))."' WHERE id=".$_GET['id'];
		if ($_GET['status'] != '') {
			$query = "UPDATE file SET status='".$_GET['status']."' WHERE id=".$_GET['id'];
		}
		break;
	default:
		if ($_GET['status'] != '') {
			$query = "UPDATE ".$_GET['table']." SET status='".$_GET['status']."' WHERE id=".$_GET['id'];
		}
	}
	
	if ($mysqldb1->query($query)) { $response = 1; }
	print $response;
	// STUB: UPDATE EVENT LOG
?>
<?
	$mysqldb1->close();
?>