$value) { $GLOBALS[$key] = $value; } } else { $id = 0; $status = 1; $porta = '5432'; } } if ((GetFormAcao() == FORM_NEW) || (GetFormAcao() == FORM_INSERT)) { include("siteInsert.php"); } else if ((GetFormAcao() == FORM_UPDATE) || (GetFormAcao() == FORM_SAVE)) { include("siteUpdate.php"); } $smarty->assign('msgErro', $erro); $smarty->assign('host', $host); $smarty->assign('usuario', $usuario); $smarty->assign('senha', $senha); $smarty->assign('basedados', $basedados); $smarty->assign('porta', $porta); $smarty->assign('descricao', $descricao); $smarty->assign('status', $status ? "checked" : ""); $smarty->assign('idSite', $id); $smarty->assign("formAction", $acaoForm); $smarty->assign("formAcaoDesc", GetFormAcaoDesc($acaoForm)); GetTemplate($smarty, $tpl); } function ValidaSite($fields, $fieldsName) { foreach ($fields as $key => $value) { if (empty($_POST[$value])) return $fieldsName[$key] . " é um campo de preenchimento obrigatório!"; } return ""; }