class carrito
{
//Atributos de la clase
var $id;
var $contador;
var $producto;
var $cantidad_enviada;
var $cuerpo;
var $array_titulo2;
//Constructor. Realiza las tareas de inicializar los objetos cuando se instancian
//inicializa el numero de valores a 0
function carrito ()
{
$this->valores=0;
}
///////////////////
///////////////////
//GUARDO LA BUSQUEDA INICIAL
function guardo_busqueda($contador,$id,$titulo)
{
$repetido=0;
for ($i=0;$i<$this->valores;$i++)
{
if($this->array_id[$i]!=0)
{
if($this->array_id[$i] == $id)
{
$repetido = 1;
}
}
}
if($repetido!=1)
{
$this->array_contador[$this->valores]=$contador;
$this->array_id[$this->valores]=$id;
$this->array_titulo[$this->valores]=$titulo;
$this->array_titulo2[$id]=$titulo;
$test = $this->array_titulo2[$id];
$this->array_agrego[$this->valores]=0;
$this->array_cantidad_enviada[$this->valores]=0;
$this->valores++;
}
}
//AGREGO UN PRODUCTO A LA COTIZACION
function agrego($id,$cantidad_enviada,$medida)
{
for($i=0;$i<$this->valores;$i++)
{
if($this->array_id[$i] == $id)
{
$this->array_agrego[$i]=1;
$this->array_cantidad_enviada[$i]=$cantidad_enviada;
$this->array_medida[$i]=$medida;
//echo "agreg: ".$this->array_agrego[$i];
break;
}
}
}
///////////////////
function imprimo_cotizaciones()
{
//echo "imprimo cotizaciones
";
for($i=0;$i<$this->valores;$i++)
{
$agregados = $this->array_agrego[$i];
$producto = $this->array_id[$i];
//echo "id= $producto - agregados = $agregados
";
if($agregados == 1)
{
//echo "Agregados= $producto
";
$mando=1;
}
}
if($mando == 1)
{
//HAGO UN FORM PARA ENVIAR TODA LA INFO DEL FORMULARIO
PRINT("