0)) { } $janW = 500; $janH = 400; $tpl = 'dacConsulta.tpl'; $linha = ""; $imgNovo = ""; $imgNovo = "$imgNovo"; $org_id = $_SESSION['SSEmpresaPadrao']; if (isset($_POST["btConsulta"]) && !empty($_POST["txtConsulta"])) { $query = "select * from pbx_dacs where org_id = $org_id and dacStatus = 0 and upper(nome) like upper('%" . $_POST["txtConsulta"] . "%') order by nome"; $param = $_POST["txtConsulta"]; } else { $query = "select * from pbx_dacs where org_id = $org_id and dacStatus = 0 order by nome"; } $result = pg_query($dbcon, $query); while ($row = pg_fetch_array($result)) { // $row[id] $row[nome] $row[descricao] $row[flaginteger] $row[musicclass] $row[announce] // $row[strategy] $row[servicelevel] $row[timeout] $row[wrapuptime] $row[retry] $row[maxlen] //$row[weight] $row[setinterfacevar] $row[announce-frequency] $row[periodic-announce-frequency] // $row[announce-holdtime] $row[joinempty] $row[eventwhencalled] $row[eventmemberstatus] $row[ringinuse] $id = $row[id]; $name = $row[nome]; $imgEdit = ""; $imgEdit = " $imgEdit"; $imgDelete = ""; $delete = "" . $imgDelete . ""; $linha .= " $row[id] $row[nome] $row[descricao] $row[musicclass] $row[announce] $row[strategy] $row[servicelevel] $row[timeout] $row[wrapuptime] $row[retry] $row[maxlen] $row[weight] $row[setinterfacevar] $row[announce_frequency] $row[periodic_announce_frequency] $row[announce_holdtime] $row[joinempty] $row[eventwhencalled] $row[eventmemberstatus] $row[ringinuse] $imgNovo $imgEdit $delete "; } $smarty->assign("linhas", $linha); $smarty->assign("txtConsulta", $param); DispRel($smarty, $tpl); function DispRel($smarty, $tpl) { $smarty->display($tpl); } ?>