<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}
else
{
	$saudaId   = isset($_REQUEST['saudaId']) && $_REQUEST['saudaId'] != '' ? $_REQUEST['saudaId'] : 0;	 
    
	$deleteClient = "DELETE FROM client
						WHERE saudaId = ".$saudaId;
	$deleteClientRes = mysql_query($deleteClient);
	if($deleteClientRes)
	{
		$deleteRojmel = "DELETE FROM sauda
							WHERE saudaId = ".$saudaId;
		$deleteRojmelRes = mysql_query($deleteRojmel);
		if(!$deleteRojmelRes)
		{
			echo "Sauda Delete Fail";
		}
		else
		{
			header("Location:saudaList.php");
		}
	}

  
	include("./bottom.php");
	$smarty->display("rojmelList.tpl");
}
?>