<?php
/*
  ===============================================================

  inGenio X
  http://ingenio.area421.com

  Created by 
  Julian Moreno Hidalgo (Software developer)
  Jesus Moreno Hidalgo (Communication's tree)

  inGenio X is a free software licensed under CC-GNU GPL

  ===============================================================
*/

	if (!defined("IGNX")) { die("Attempt..."); }

// actualizar carro
if (isset($_POST["sc"]))
{
		
		if (isset($_POST["act"]))
		{

			foreach ($_POST as $key => $val)
				if (strstr($key, "count_"))
				{

					if ($val > 0)
					{
						for ($i=0; $i<count($_SESSION["gids"]); $i++)
						{
							if ($_SESSION["gids"][$i] == str_replace("count_","",$key))
							{
								$_SESSION["counts"][$i] = floor($val);
							}
						}
					}
					else // descontar
					{
						$i=0;
						while ($_SESSION["gids"][$i] != str_replace("count_","",$key) && $i<count($_SESSION["gids"])) $i++;
						$_SESSION["gids"][$i] = 0;
					}
				  }

			Redir (RUTA_INICIO."len".IGUAL.IDIOMA_ACTUAL.AMPER."sc".IGUAL."1");

		}


}

?>