update-compra.php
changeset 11 d5b5409fed69
parent 10 47746e0c30a3
equal deleted inserted replaced
10:47746e0c30a3 11:d5b5409fed69
   433 	{
   433 	{
   434 		if($_POST["earticle"][$i] != "")
   434 		if($_POST["earticle"][$i] != "")
   435 		{
   435 		{
   436 			settype($_POST["epreu"][$i], "double");
   436 			settype($_POST["epreu"][$i], "double");
   437 
   437 
       
   438 			/* El codi distingeix les excepcions per data+nom+preu.
       
   439 			   Per tant, no hi poden haver nom+preu iguals. */
       
   440 			for ($j = $i + 1; $j <= $_POST["num_excepcions"]; $j++)
       
   441 			{
       
   442 				if($_POST["earticle"][$i]
       
   443 					== $_POST["earticle"][$j] &&
       
   444 					$_POST["epreu"][$i]
       
   445 					== $_POST["epreu"][$j])
       
   446 				{
       
   447 					$error = "No hi poden haver "
       
   448 					       . "excepcions amb el mateix "
       
   449 					       . "nom i preu.";
       
   450 					return false;
       
   451 				}
       
   452 			}
       
   453 
   438 			if ($_POST["epreu"][$i] == 0)
   454 			if ($_POST["epreu"][$i] == 0)
   439 			{
   455 			{
   440 				$error = "Una excepció té preu 0.";
   456 				$error = "Una excepció té preu 0.";
   441 				return false;
   457 				return false;
   442 			}
   458 			}