<?php

if (!empty($_GET['del_comm']) && is_numeric($_GET['del_comm']))
{
	$del_comm = abs(intval($_GET['del_comm']));

	if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `shop_comm` WHERE `id` = '".$del_comm."' LIMIT 1"),0) == true)
	{
		$arr_del_comm = mysql_fetch_array(mysql_query("SELECT * FROM `shop_comm` WHERE `id` = '".$del_comm."' LIMIT 1"));
		
		if ($user_id == $arr_del_comm['user_id'] or $user_id == $shop['dir'])
		{
		mysql_query("DELETE FROM `shop_comm` WHERE `id` = '".$del_comm."'");
		mysql_query("UPDATE `shop` SET comm=comm-1 WHERE `id` = '".$shop['id']."'");
		$arr['comm'] = $arr['comm']-1;
		}
	}
}

?>