function saveEditBaseDeClientes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf) { $pIngresodeBasedeClientes = new paloSantoIngresodeBasedeClientes($pDB); $arrFormIngresodeBasedeClientes = createFieldForm($pDB); $oForm = new paloForm($smarty, $arrFormIngresodeBasedeClientes); if (!$oForm->validateForm($_POST)) { // Validation basic, not empty and VALIDATION_TYPE $smarty->assign("mb_title", _tr("Validation Error")); $arrErrores = $oForm->arrErroresValidacion; $strErrorMsg = "<b>" . _tr("The following fields contain errors") . ":</b><br/>"; if (is_array($arrErrores) && count($arrErrores) > 0) { foreach ($arrErrores as $k => $v) { $strErrorMsg .= "{$k}, "; } } $smarty->assign("mb_message", $strErrorMsg); $content = viewFormIngresodeBasedeClientes($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); } else { $arrResult = $pIngresodeBasedeClientes->actualizarCampaniaRecarga($_POST); header("location: ?menu=hispana_listado_recarga"); } return $content; }
function saveNewIngresodeBasedeClientes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf) { $pIngresodeBasedeClientes = new paloSantoIngresodeBasedeClientes($pDB); $arrFormIngresodeBasedeClientes = createFieldForm(); $oForm = new paloForm($smarty, $arrFormIngresodeBasedeClientes); if (!$oForm->validateForm($_POST)) { // Validation basic, not empty and VALIDATION_TYPE $smarty->assign("mb_title", _tr("Validation Error")); $arrErrores = $oForm->arrErroresValidacion; $strErrorMsg = "<b>" . _tr("The following fields contain errors") . ":</b><br/>"; if (is_array($arrErrores) && count($arrErrores) > 0) { foreach ($arrErrores as $k => $v) { $strErrorMsg .= "{$k}, "; } } $smarty->assign("mb_message", $strErrorMsg); $content = viewFormIngresodeBasedeClientes($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); } else { if (isset($_FILES)) { $arrResult = $pIngresodeBasedeClientes->guardarActualizar($_POST, $_FILES); } $content = $pIngresodeBasedeClientes->resultadoTemplate($arrResult, $_FILES); } return $content; }