problema al insertar un varios modelos en una misma action

El codigo de abajo lo tengo en una clase controladora que no es la que pertenece a producto es decir quiero insertar un producto en la clase controladora que me genero el CRUD para otra tabla, mi problema es que no me quiere insertar, he pasado los datos de estaticamente y tampoco me inserta, es decir en vez de cojerlos por $_POST[‘atributo’] se los paso directamente.El codigo de abajo me imprime que no.




$array_productos = array(

		'activo'=> $_POST['activo1'],

		'codigo'=>$_POST['codproducto1'],

		'descripcion'=> $_POST['descripcion1'],

		'nombre'=> $_POST['nombre1'],

		'num_inventario'=> $_POST['num_inventario1'],

		'precio_costo'=> $_POST['precio_costo1'],

		'precio_venta'=> $_POST['precio_venta1'],

		'u_medida'=> $_POST['u_medida1']);

			

		

		 

		$producto = new Producto();

		$producto->attributes = $array_productos;

                if($producto->save())

                  { print_r('ok');die;}

                 else

                    print_r('no');die; 



Puedes usar $producto->getErrors() para ver si se trata de un problema de validación.

voy a explicarme mejor porque la verdad estoy detenida en el tiempo con esto y estoy contra reloj con este trabajo. Mira tengo este codigo en el

-form de Informe:





 <html><head>


<script type="text/javascript">

var cant=0;

function adicionarFila(){

var cont = document.getElementById("cont");

var filas = document.getElementById("filas");

cont.setAttribute("value", parseInt(cont.value,0)+1);

var tabla = document.getElementById("contenido").tBodies[0];

var fila = document.createElement("TR");

fila.setAttribute("align","center");

 

var celda1 = document.createElement("TD");

var codProducto = document.createElement("INPUT");

codProducto.setAttribute("type","text");

codProducto.setAttribute("size","5");

codProducto.setAttribute("maxlength","20");

codProducto.setAttribute("name","codProducto" + cont.value);

celda1.appendChild(codProducto);




var celda2 = document.createElement("TD");

var nombre = document.createElement("INPUT");

nombre.setAttribute("type","text");

nombre.setAttribute("size","5");

nombre.setAttribute("maxlength","20");

nombre.setAttribute("name","nombre" + cont.value);

celda2.appendChild(nombre);




var celda3 = document.createElement("TD");

var num_inventario = document.createElement("INPUT");

num_inventario.setAttribute("type","text");

num_inventario.setAttribute("size","5");

num_inventario.setAttribute("maxlength","20");

num_inventario.setAttribute("name","num_inventario" + cont.value);

celda3.appendChild(num_inventario);




var celda4 = document.createElement("TD");

var cuenta = document.createElement("INPUT");

cuenta.setAttribute("type","text");

cuenta.setAttribute("size","5");

cuenta.setAttribute("maxlength","20");

cuenta.setAttribute("name","cuenta" + cont.value);

celda4.appendChild(cuenta);


 

var celda5 = document.createElement("TD");

var subcuenta = document.createElement("INPUT");

subcuenta.setAttribute("type","text");

subcuenta.setAttribute("size","5");

subcuenta.setAttribute("maxlength","20");

subcuenta.setAttribute("name","subcuenta" + cont.value);

celda5.appendChild(subcuenta);




var celda6 = document.createElement("TD");

var analisis = document.createElement("INPUT");

analisis.setAttribute("type","text");

analisis.setAttribute("size","5");

analisis.setAttribute("maxlength","20");

analisis.setAttribute("name","analisis" + cont.value);

celda6.appendChild(analisis);




var celda7 = document.createElement("TD");

var descripcion = document.createElement("INPUT");

descripcion.setAttribute("type","text");

descripcion.setAttribute("size","10");

descripcion.setAttribute("maxlength","50");

descripcion.setAttribute("name","descripcion" + cont.value);

celda7.appendChild(descripcion);




var celda8 = document.createElement("TD");

var u_medida = document.createElement("INPUT");

u_medida.setAttribute("type","text");

u_medida.setAttribute("size","3");

u_medida.setAttribute("maxlength","20");

u_medida.setAttribute("name","u_medida" + cont.value);

celda8.appendChild(u_medida);




var celda9 = document.createElement("TD");

var cantidadProducto = document.createElement("INPUT");

cantidadProducto.setAttribute("type","text");

cantidadProducto.setAttribute("size","5");

cantidadProducto.setAttribute("maxlength","20");

cantidadProducto.setAttribute("name","cantidadProducto" + cont.value);

celda9.appendChild(cantidadProducto);




var celda10 = document.createElement("TD");

var precio = document.createElement("INPUT");

precio.setAttribute("type","text");

precio.setAttribute("size","5");

precio.setAttribute("maxlength","20");

precio.setAttribute("name","precio" + cont.value);

celda10.appendChild(precio);




var celda11 = document.createElement("TD");

var precio_costo = document.createElement("INPUT");

precio_costo.setAttribute("type","text");

precio_costo.setAttribute("size","5");

precio_costo.setAttribute("maxlength","20");

precio_costo.setAttribute("name","precio_costo" + cont.value);

celda11.appendChild(precio_costo);




var celda12 = document.createElement("TD");

var precio_venta = document.createElement("INPUT");

precio_venta.setAttribute("type","text");

precio_venta.setAttribute("size","5");

precio_venta.setAttribute("maxlength","20");

precio_venta.setAttribute("name","precio_venta" + cont.value);

celda12.appendChild(precio_venta);




var celda13 = document.createElement("TD");

var importe = document.createElement("INPUT");

importe.setAttribute("type","text");

importe.setAttribute("size","5");

importe.setAttribute("maxlength","20");

importe.setAttribute("name","importe" + cont.value);

celda13.appendChild(importe);


var celda14 = document.createElement("TD");

var saldo = document.createElement("INPUT");

saldo.setAttribute("type","text");

saldo.setAttribute("size","5");

saldo.setAttribute("maxlength","20");

saldo.setAttribute("name","saldo" + cont.value);

celda14.appendChild(saldo);




var celda15 = document.createElement("TD");

var activo = document.createElement("INPUT");

activo.setAttribute("type","text");

activo.setAttribute("size","3");

activo.setAttribute("maxlength","20");

activo.setAttribute("name","activo" + cont.value);

celda15.appendChild(activo);


var celda16 = document.createElement('TD');

var boton = document.createElement('INPUT');

boton.setAttribute('type','button');

boton.setAttribute('value','(-)');

boton.onclick=function(){borrarFila(this);}

celda16.appendChild(boton);


fila.appendChild(celda1);

fila.appendChild(celda2);

fila.appendChild(celda3);

fila.appendChild(celda4);

fila.appendChild(celda5);

fila.appendChild(celda6);

fila.appendChild(celda7);

fila.appendChild(celda8);

fila.appendChild(celda9);

fila.appendChild(celda10);

fila.appendChild(celda11);

fila.appendChild(celda12);

fila.appendChild(celda13);

fila.appendChild(celda14);

fila.appendChild(celda15);

fila.appendChild(celda16);

 

tabla.appendChild(fila);


}

function borrarFila(button){

var fila = button.parentNode.parentNode;

var tabla = document.getElementById('contenido').getElementsByTagName('tbody')[0];

tabla.removeChild(fila);

}


</script>

</head>

<body onLoad="adicionarFila()">


<input name="cont" type="hidden" id="cont" value="0" >

<input name="filas" type="hidden" id="filas" value="" >

<table align=center width=20% cellpadding=0 cellspacing=0 id="contenido" border="1">

<tr align="center">

<th>Código</th>

<th>Nombre</th>

<th>Inventario</th>

<th>Cuenta</th>

<th>Subcuenta</th>

<th>Análisis</th>

<th>Descripción</th>

<th>U/M</th>

<th>Cantidad</th>

<th>Precio unitario</th>

<th>Precio costo</th>

<th>Precio venta</th>

<th>Importe</th>

<th>Saldo</th>

<th>Activo</th>

</tr>

</table>

<table align=center width=20% cellpadding=0 cellspacing=0 border="1">

<tr>

<td>&nbsp;</td>

</tr>

<tr align="center">

<td align="CENTER">

<input name="nueva_fila" type="button" id="nueva_fila" value="nueva fila" onClick="adicionarFila()"></td></tr>

</table>


</body>

</html>




es una tablita dinamica en la que cada fila es un producto diferente y por tanto debo tomar de cada fila en la controle de Informe los valores que me hacen falta y mandarlos para la tabla Producto en la base de datos; y es ahi mi problema, que no se como tomar fila a fila esos valores en la controler…