<?php
	//Connects to your Database
	include "../db_connection/db_connection.php";
	include "../config/config.php";		
	$page_id	=	base64_decode(base64_decode(base64_decode($_GET['page_id']))); 
	if($page_id==1)
	{
		$not 	= $_POST['notes'];
		$not_id	= $_POST['not_id'];
		if($not_id!=0)
		{
			$INSRT = "UPDATE note_pad SET `notes`='$not', `post_dt`='$cur_time' WHERE note_pad_id='$not_id'";
			$EXEC  = mysqli_query($connect,$INSRT);
		}
		else
		{
			$INSRT = "INSERT INTO note_pad(`admin_id`,`notes`,`post_dt`)VALUES($_SESSION[admin_login_id],'$not','$cur_time')";
			$EXEC  = mysqli_query($connect,$INSRT);
			
		}
	}
	else if($page_id==2)
	{
		$not_id	=	base64_decode(base64_decode(base64_decode($_GET['pad_id']))); 
		$INSRT = "DELETE FROM note_pad WHERE note_pad_id = '$not_id'";
		$EXEC  = mysqli_query($connect,$INSRT);
	}
?>
<script type="text/javascript">
	window.location='../note_list.php';
</script>
