forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.0 KiB
32 lines
1.0 KiB
<?php |
|
|
|
/* |
|
* To change this template, choose Tools | Templates |
|
* and open the template in the editor. |
|
*/ |
|
|
|
|
|
|
|
|
|
$acaoForm = FORM_INSERT; |
|
$erro = IsPostBack() ? ValidaSite($fields, $fieldsName) : ""; |
|
|
|
if (IsPostBack() && empty($erro)) { |
|
$query = "insert into pbx_sites(host, usuario, senha, basedados, porta, descricao, status) values(%s, %s, %s, %s, %s, %s, %s)"; |
|
$query = sprintf($query, QuotedStr($host), QuotedStr($usuario), QuotedStr($senha), QuotedStr($basedados), QuotedStr($porta), QuotedStr($descricao), $status); |
|
$result = pg_query($dbcon, $query); |
|
if ($result) { |
|
$erro = "Registro inserido com sucesso!"; |
|
$jsStartup[] = "window.opener.ResetForm();"; |
|
$id = 0; |
|
$status = 1; |
|
$porta = '5432'; |
|
$host = ''; |
|
$senha = ''; |
|
$basedados = ''; |
|
$descricao = ''; |
|
$usuario = ''; |
|
} else |
|
$erro = "A operação não pode ser realizada! " . (IsAdmin() ? ("Erro: " . pg_last_error($dbcon)) : ""); |
|
} |
|
?>
|
|
|