

function increase_item(order,item,price)
{
	var quantity=document.getElementById(item).value;
	quantity++;

	document.getElementById(item).value=quantity;

	newprice=quantity*price;

	get_total=document.getElementById('total').innerHTML;
	newtotal=parseFloat(get_total)+price;

	window.location="view_cart.php?action=update&q="+quantity+"&order="+order+"&item="+item;

}
function decrease_item(order,item,price)
{
	var quantity=document.getElementById(item).value;
	if(quantity>1)
	{
		quantity--;

		document.getElementById(item).value=quantity;

		newprice=quantity*price;

		get_total=document.getElementById('total').innerHTML;
		newtotal=parseFloat(get_total)-price;

		window.location="view_cart.php?action=update&q="+quantity+"&order="+order+"&item="+item;
	}
	else{
		alert("لا يمكن تسجيل  صفر كمية من أي منتج. إذا كنت لا تريده في السلة ، نرجو منك حذفه نهائياًمن السلة");
	}

}
function write_qunatity(which,order,item,price)
{

	if (isNaN(which.value))
	{
		alert ("You must enter an integer");
		return false;

	}
	else
	{
		quantity=which.value;

		if(quantity>=1)
		{
			previous=document.getElementById('price'+item).innerHTML;

			newprice=quantity*price;

			increase=newprice-previous;

			get_total=document.getElementById('total').innerHTML;
			newtotal=parseFloat(get_total)+increase;

			window.location="view_cart.php?action=update&q="+quantity+"&order="+order+"&item="+item;
		}
		else{
			alert("لا يمكن تسجيل  صفر كمية من أي منتج. إذا كنت لا تريده في السلة ، نرجو منك حذفه نهائياًمن السلة");
		}

	}
}