|
|
|
@ -33,7 +33,7 @@ function SetFiltroSQL($filtro, $org_id){
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((!empty($filtro)) && ($tpParcial == 0)) { |
|
|
|
|
$compl = " where (nome ilike '%$filtro%' or callerid ilike '%$filtro%' and org_id = $org_id)"; |
|
|
|
|
$compl = " and (nome ilike '%$filtro%' or callerid ilike '%$filtro%' and org_id = $org_id)"; |
|
|
|
|
} elseif ((!empty($filtro)) && ($tpParcial == 1)) { |
|
|
|
|
$params = explode(",", $filtro); |
|
|
|
|
$compl = ""; |
|
|
|
@ -41,7 +41,7 @@ function SetFiltroSQL($filtro, $org_id){
|
|
|
|
|
foreach ($params as $param) { |
|
|
|
|
$dado .= empty($dado) ? "'$param'" : ",'$param'"; |
|
|
|
|
} |
|
|
|
|
$compl = " where (nome in($dado) or callerid in($dado) and org_id = $org_id)"; |
|
|
|
|
$compl = "and (nome in($dado) or callerid in($dado) and org_id = $org_id)"; |
|
|
|
|
} elseif ((!empty($filtro)) && ($tpParcial == 2)) { |
|
|
|
|
$params = explode("-", $filtro); |
|
|
|
|
$compl = ""; |
|
|
|
@ -59,7 +59,7 @@ function SetFiltroSQL($filtro, $org_id){
|
|
|
|
|
} else { |
|
|
|
|
$fim1 = $fim; |
|
|
|
|
} |
|
|
|
|
$compl = " where nome between '$ini' and '$fim' and ramal between '$ini1' and '$fim1' and org_id = $org_id"; |
|
|
|
|
$compl = " and nome between '$ini' and '$fim' and ramal between '$ini1' and '$fim1' and org_id = $org_id"; |
|
|
|
|
} else { |
|
|
|
|
$compl = ""; |
|
|
|
|
} |
|
|
|
@ -81,22 +81,30 @@ function GetRamalFiltro( $idProg, $filtro ){
|
|
|
|
|
$query .= " limit $regPagina offset $offSet"; |
|
|
|
|
$result = pg_query($dbcon, $query); |
|
|
|
|
|
|
|
|
|
return array("ramais_db" => $result, "ramais_rodape" => $links); |
|
|
|
|
return array( |
|
|
|
|
"ramais_db" => $result, |
|
|
|
|
"ramais_rodape" => $links, |
|
|
|
|
"ramais_pagina" => $regPagina |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Buscar todos os ramais da página */ |
|
|
|
|
function GetALLRamal($idProg, $filtro = null ){ |
|
|
|
|
global $dbcon; |
|
|
|
|
$org_id = $_SESSION['SSEmpresaPadrao']; |
|
|
|
|
|
|
|
|
|
$query = GetQueryRamal(); |
|
|
|
|
|
|
|
|
|
$params = "&pbxRequest=1&numRamal=$filtro"; |
|
|
|
|
|
|
|
|
|
$links = PaginaDados($idProg, $query, $params, $regPagina, $offSet, $pagMostra, true); |
|
|
|
|
$query .= " limit $regPagina offset $offSet"; |
|
|
|
|
$result = pg_query($dbcon, $query); |
|
|
|
|
|
|
|
|
|
return array("ramais_db" => $result, "ramais_rodape" => $links); |
|
|
|
|
return array( |
|
|
|
|
"ramais_db" => $result, |
|
|
|
|
"ramais_rodape" => $links, |
|
|
|
|
"ramais_pagina" => $regPagina |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$acao = isset($_GET['acao']) ? trim($_GET['acao']) : 'select'; |
|
|
|
@ -258,7 +266,7 @@ else {
|
|
|
|
|
<table width="100%" class="grid" border="0" cellspacing="0" cellpadding="2"> |
|
|
|
|
<tr> |
|
|
|
|
<th align="center" style="width: 90%; border:0;"><?= $ramais["ramais_rodape"]; ?></th>
|
|
|
|
|
<th align="right" style="width: 10%; border:0;"><?= sprintf("%s/%s", $pagMostra, $totalReg); ?></th>
|
|
|
|
|
<th align="right" style="width: 10%; border:0;"><?= sprintf("%s/%s", $ramais["ramais_pagina"], $totalReg); ?></th>
|
|
|
|
|
</tr> |
|
|
|
|
</table> |
|
|
|
|
</th> |
|
|
|
|