I currently have a button to record and continue recording another record
<button type="submit" name="input" id="input">Grabar y Agregar</button>
and he does it well, I want to put another two
<button type="submit" name="input" id="input>Grabar y Duplicar</button>
and
<button type="submit" name="input" id="input" >Grabar y Salir</button>
How do I record and duplicate the values of the current record and be ready to record? and how do I record and redirect to another page?
code where the record is saved ...
// check for duplicate code
$stmt = $conn->prepare("SELECT * FROM ".$database_table_prefix."products WHERE prd_code = ?");
$stmt->execute([$code]);
$exist_code = $stmt->fetchColumn();
if($exist_code!=0)
{
echo '<div class="alert alert-danger background-danger" role="alert">
<strong>Codigo de Producto ya Existe!</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>';
exit();
}
//insert
$insert = $conn->prepare("INSERT INTO ".$database_table_prefix."products(prd_id, prd_code, prd_name, prd_description, prd_ref, prd_brand, prd_ubic, prd_cat, prd_img, prd_pricesell1, prd_pricesell2, prd_pricesell3, prd_pricesell4,
prd_pricecost, prd_InvMinimo, prd_InvMaximo, prd_Existencias, prd_PorcentajeRF, prd_UnidadEmpaque, prd_Activo, prd_FechaCreacion, prd_PorcentajeIva, prd_UtilidadPrecio1, prd_UtilidadPrecio2,
prd_UtilidadPrecio3, prd_UtilidadPrecio4, prd_ComisionXVtas, prd_Procedimiento, prd_Convertir, prd_IdProductoEquivalente, prd_CantidadEquivalente, prd_Inventario, prd_ColorBoton,
prd_ColorTexto, prd_UbicacionBoton, prd_Impresora1, prd_Impresora2, prd_Impresora3, prd_Impresora4, prd_CantidadEnPesa, prd_BotonEnFactura, prd_id_branch, prd_Estampilla, prd_GradosAlcohol, prd_TCantXUnidadEmpaque, prd_AdValorem, prd_PrecioPromDane, prd_ComponentesEnEntrada)
VALUES(NULL,'$code','$name','$descrip','$ref','$brand','$ubic','$Group','$img','$pv1','$pv2','$pv3','$pv4','$pcto','$invmin','$invmax','$stock','$rtefte','$pack','$active','$dateadd','$tax',
'$utlpv1','$utlpv2','$utlpv3','$utlpv4','$comvtas','$porced','$convert','$proequival','$quantity', '$inventory','$btnclr','$btntxtclr','$btnubic','$prtr1','$prtr2','$prtr3','$prtr4','$weight',
'$btninvoice','$branch','$liqStamp','$liquorsDegrees','$liquorsPack','$liquorsAdVal','$liquorsDane','$descargarEnEntrada')");
$insert->execute();
$prd_id = $conn->lastInsertId(); // last inserted ID