<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}
else
{
	$to        = $_REQUEST['toDtYear']."-".$_REQUEST['toDtMonth']."-".$_REQUEST['toDtDay'];  
	$from      = $_REQUEST['fromDtYear']."-".$_REQUEST['fromDtMonth']."-".$_REQUEST['fromDtDay'];  

    if(isset($_POST['submit']))
	{
	  $deleteEntry = "DELETE FROM mcx
                        	 WHERE transDate BETWEEN   
						  '".$to."' AND '".$from."'";
	  $insertClientRes = mysql_query($deleteEntry);
	  if(!$insertClientRes)
	  {
	  	echo "Delete Fail";
	  }
	  else
	  {
	    header("Location:delete2.php");
	  }  
	}	
	include("./bottom.php");
	$smarty->display("delete2.tpl");
}
?>