I have some problem, i am updating a 2nd table with an after add event and it seems to work but its not entering the correct date, instead its entering 0000-00-00, but the format date is correct, i'm displaying dates in YYYY-MM-DD
my code:
// Parameters:
// $values - Array object.
// Each field on the Add form is represented as a 'Field name'-'Field value' pair
// $keys - Array object with added record key column values
//** Insert a record into another table ****
global $conn;
$fechacuota = date("Y-m-d",strtotime($values["fecha_inicio_credito"]));
$saldo = $values["monto_autorizado"];
$fin = $values["cantidad_cuotas"];
$tiempogracia = $values["tiempo_gracia"];
$numerocuota = 0;
$cedula = $values["cedula_credito"];
$interesordinario = ($values["interes_ordinario"] / 100) (30 / 360);
echo $fechacuota;
$base = (1 + $interesordinario);
$exponente = -($fin - $tiempogracia);
$resultado = pow($base, $exponente);
$cuotafija = ($values["monto_autorizado"]) (($interesordinario) / (1 - $resultado));
$numerocredito = $values["nro_credito"];
for ($i = 1; $i <= $fin; $i++) {
$numerocuota++;
$columnainteres = ($saldo * $interesordinario);
$amortizacion = $cuotafija - $columnainteres;
$saldo = $saldo - $amortizacion;
$strSQLInsert = "insert into cuotas (cedula_cuota, nro_credito_cuota, nro_cuota, fecha_cuota, interes, amortizacion, cuota_fija, saldo) values ($cedula, $numerocredito, $numerocuota, $fechacuota, $columnainteres, $amortizacion, $cuotafija, $saldo)";
db_exec($strSQLInsert,$conn);
} // fin del ciclo for
//** Display a message on the Web page ****
echo "TABLA DE AMORTIZACION GENERADA .....";