getMessage() . (IsAdmin() ? ('Erro: ' . pg_last_error($dbcon) ) : '')); } } $query = "select * from pbx_campanha where cmp_id = %s "; $query = sprintf($query, $idCampanha); $result = pg_query($dbcon, $query); $dados = pg_fetch_array($result); foreach ($dados as $key => $value) { $_REQUEST[$key] = $dados[$key]; } $codSel = $_REQUEST['cmp_status']; $_REQUEST['cmp_old_status'] = $codSel; /* * Campanha com status 0-Cancelada ou 5-Concluida não pode ser reativada. */ $desabStatus = ($codSel == 0); $_REQUEST['cmp_status'] = GetStatusCampanha($dbcon, $codSel, $desabStatus, "'$codSel'"); $jsJQuery[] = "\$('#cmp_status').change(function(){document.getElementById(\"btAtivar\").disabled = (this.value == -1);}) "; $GLOBALS['jsStartup'][] = "document.getElementById(\"btAtivar\").disabled = true;"; /* * Atualiza templates templates */ foreach ($_REQUEST as $key => $value) { $smarty->assign($key, $value); } GetTemplate($smarty, $templateName); ?>