<?php
include ("../../include/session.php");
include ("../../include/db.php");
if(!$session->isAdmin()){
	header("Location: ../../storeMenu.php");
} else {
	$id = mysql_real_escape_string($_POST['id']);
	$comments = mysql_real_escape_string($_POST['comments']);
	$delNote = mysql_real_escape_string($_POST['delNote']);
	$orderNo = mysql_real_escape_string($_POST['orderNo']);
	$type = mysql_real_escape_string($_POST['type']);
	if($type == "del"){
		$q = "UPDATE sales SET comments = '$comments' WHERE saleId = '$id'";
		$r = execsql($q);
		header("Location: ../displayDelNote.php?delNote=$delNote");
	}elseif($type == "order"){
		$q = "UPDATE orders SET comments = '$comments' WHERE saleId = '$id'";
		$r = execsql($q);
		header("Location: ../orderByDates.php?orderNo=$orderNo");
	}


}