$acao = $_GET["acao"]; $acao2 = $_GET["acao2"]; if ($acao2 == "salva") { $id = $_POST["id"]; $tipo_monitor = trim($_POST["tipo_monitor"]); $nome_servico = trim($_POST["nome_servico"]); $avisar_ao_chegar = trim($_POST["avisar_ao_chegar"]); if ($acao == "inseri") { $query = "INSERT INTO pbx_monitora_sistema(tipo_monitor,nome_servico,avisar_ao_chegar) VALUES ('$tipo_monitor','$nome_servico','$avisar_ao_chegar')"; pg_query($dbcon, $query); } if ($acao == "edita") { $query = "UPDATE pbx_monitora_sistema SET tipo_monitor = '$tipo_monitor',nome_servico='$nome_servico',avisar_ao_chegar='$avisar_ao_chegar' WHERE id=$id"; pg_query($dbcon, $query); } ?> } if ($acao == "edita") { $id = $_GET["id"]; $query = "SELECT * FROM pbx_monitora_sistema where id=$id"; $result = pg_query($dbcon, $query); } else { $query = "SELECT * FROM pbx_monitora_sistema where id is null"; } $result = pg_query($dbcon, $query); while ($dados = pg_fetch_array($result)) { $id = $dados["id"]; $tipo_monitor = $dados["tipo_monitor"]; $nome_servico = $dados["nome_servico"]; $avisar_ao_chegar = $dados["avisar_ao_chegar"]; } ?>
CADASTRO DE MONITOR DE SISTEMA
Tipo de Monitor :
>Servios
>Discos
>CPU
>Memria
Nome Serviço:
-------------------
$query2 = "SELECT * FROM pbx_servicos_sistema order by id asc"; $result2 = pg_query($dbcon, $query2); while ($dados2 = pg_fetch_array($result2)) { ?>
> echo $dados2['servico'] ?>
} ?>
Avisar ao chegar:
%