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.

26 lines
713 B

#!/usr/bin/php -q
<?php
include("bd.php");
include("util/util.php");
$TBL_AGENTES = "pbx_supervisor_agentes";
$path = "/var/log/asterisk/log_erro_pabx.log";
$p1 = trim($argv[1]);
$log = '';
try {
if (!$p1) {
GeraExcept("Parametros de entrada invalidos, Arg1:$p1 ");
}
$query = "delete from $TBL_AGENTES where matricula = '$p1'";
if (!pg_query($dbcon, $query)) {
RaiseExcept("Erro ao atualizar Base de dados: Cmd:[{$query}]");
}
$log .= sprintf("Script: %s Exec: OK Data: %s\n", $argv[0], date("Y-m-d H:m:i"));
WriteLog($log, $path);
} catch (Exception $ex) {
$log .= sprintf("Script: %s Data: %s\n", $argv[0], date("Y-m-d H:m:i"));
WriteLog($log, $path);
}