PABX da Simples IP
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.
 
 
 
 
 
 

25 lines
971 B

<?php
$acaoForm = FORM_INSERT;
$erro = IsPostBack() ? ValidaSite($fields, $fieldsName) : "";
$org_id = GetOrganizacao();
if (IsPostBack() && empty($erro)) {
$query = "INSERT INTO pbx_sites (host, usuario, senha, basedados, porta, descricao, status, org_id) VALUES(%s, %s, %s, %s, %s, %s, %s, %s)";
$query = sprintf($query, QuotedStr($host), QuotedStr($usuario), QuotedStr($senha), QuotedStr($basedados), QuotedStr($porta), QuotedStr($descricao), $status, $org_id);
$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)) : "");
}
}