public function getColecaoSistema() { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t nome "; $sql .= "FROM "; $sql .= "\tsistema "; $sql .= "WHERE 1=1 "; $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoQuemSomos() { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t titulo, "; $sql .= "\t subtitulo, "; $sql .= "\t imagem "; $sql .= "FROM "; $sql .= "\tquem_somos "; $sql .= "WHERE 1=1 "; $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoGatway($id = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t nome "; $sql .= "FROM "; $sql .= "\tgatway "; $sql .= "WHERE 1=1 "; if (!empty($id)) { $sql .= "\t AND id = '" . $id . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoIconeBootstrap($id = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t classe "; $sql .= "FROM "; $sql .= "\ticone_bootstrap "; $sql .= "WHERE 1=1 "; if (!empty($id)) { $sql .= "\t AND id = '" . $id . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoTipoPessoa() { $sql = " SELECT"; $sql .= "\t id, "; $sql .= "\t nome "; $sql .= " FROM "; $sql .= "\ttipo_pessoa "; $sql .= " WHERE 1=1"; if (isset($_REQUEST['nome'])) { $sql .= "\tAND\tnome LIKE '%" . $_REQUEST['nome'] . "%'"; } $sql .= " ORDER BY nome"; return DBSql::getCollection($sql); }
public function getColecaoBannerCategoria($id = null, $nome = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t nome "; $sql .= "FROM "; $sql .= "\tbanner_categoria "; $sql .= "WHERE 1=1 "; if (!empty($id)) { $sql .= "\t AND id = '" . $id . "'"; } if (!empty($nome)) { $sql .= "\t AND nome = '" . $nome . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoPessoa($login = null, $senha = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t login, "; $sql .= "\t senha, "; $sql .= "\t nome "; $sql .= "FROM "; $sql .= "\tpessoa "; $sql .= "WHERE 1=1 "; if (!empty($login)) { $sql .= "\t AND login = '******'"; } if (!empty($senha)) { $sql .= "\t AND senha = '" . $senha . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoPessoaGatwayConfiguracao($pessoa_id = null, $gatway_id = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t pessoa_id, "; $sql .= "\t gatway_id, "; $sql .= "\t credendial_1, "; $sql .= "\t credencial_2 "; $sql .= "FROM "; $sql .= "\tpessoa_gatway_configuracao "; $sql .= "WHERE 1=1 "; if (!empty($pessoa_id)) { $sql .= "\t AND pessoa_id = '" . $pessoa_id . "'"; } if (!empty($gatway_id)) { $sql .= "\t AND gatway_id = '" . $gatway_id . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
/** * * @param type $menu_id * @param type $relacionamento_id * @param type $destaque * @param type $limit * @return type */ public function getColecaoImagem($menu_id = null, $relacionamento_id = null, $destaque = null, $limit = null) { $sql = " SELECT "; $sql .= "\tSQL_CACHE"; $sql .= "\tid "; $sql .= " \t,relacionamento_id "; $sql .= " \t,titulo "; $sql .= " \t,menu_id "; $sql .= " \t,destaque "; $sql .= " \t,nome_img "; $sql .= " \t,nome_thumb "; $sql .= " FROM "; $sql .= "\timagem"; $sql .= " WHERE 1=1 "; $sql .= " \tAND menu_id \t\t = " . $menu_id; if (!empty($relacionamento_id)) { $sql .= " \tAND relacionamento_id = " . $relacionamento_id; } if (!empty($_REQUEST['titulo'])) { $sql .= " AND titulo LIKE '%" . $_REQUEST['titulo'] . "%'"; } if (!empty($_REQUEST['ativo'])) { $sql .= " AND ativo = " . $_REQUEST['ativo']; } if (!empty($destaque)) { $sql .= " AND destaque = " . $destaque; } $sql .= " ORDER BY destaque ASC "; if (!empty($limit)) { $sql .= " LIMIT " . $limit; } return DBSql::getCollection($sql); }
public function getColecaoLog($pessoa_id = null, $gatway_id = null, $sistema_id = null, $transacao_id = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t pessoa_id, "; $sql .= "\t gatway_id, "; $sql .= "\t sistema_id, "; $sql .= "\t transacao_id, "; $sql .= "\t configuracao_usada, "; $sql .= "\t data, "; $sql .= "\t produto "; $sql .= "FROM "; $sql .= "\tlog "; $sql .= "WHERE 1=1 "; if (!empty($pessoa_id)) { $sql .= "\t AND pessoa_id = '" . $pessoa_id . "'"; } if (!empty($gatway_id)) { $sql .= "\t AND gatway_id = '" . $gatway_id . "'"; } if (!empty($sistema_id)) { $sql .= "\t AND sistema_id = '" . $sistema_id . "'"; } if (!empty($transacao_id)) { $sql .= "\t AND transacao_id = '" . $transacao_id . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoTransacao($pessoa_id = null, $sistema_id = null, $status_id = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t pessoa_id, "; $sql .= "\t sistema_id, "; $sql .= "\t status_id, "; $sql .= "\t produto, "; $sql .= "\t valor, "; $sql .= "\t data "; $sql .= "FROM "; $sql .= "\ttransacao "; $sql .= "WHERE 1=1 "; if (!empty($pessoa_id)) { $sql .= "\t AND pessoa_id = '" . $pessoa_id . "'"; } if (!empty($sistema_id)) { $sql .= "\t AND sistema_id = '" . $sistema_id . "'"; } if (!empty($status_id)) { $sql .= "\t AND status_id = '" . $status_id . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoPessoa($pessoa_id = null, $tipo_pessoa_id = null, $nome = null, $excluido = null, $ativo = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t pessoa_id, "; $sql .= "\t tipo_pessoa_id, "; $sql .= "\t cpf_cnpj, "; $sql .= "\t nome, "; $sql .= "\t email, "; $sql .= "\t endereco, "; $sql .= "\t data_insercao, "; $sql .= "\t fisica_juridica, "; $sql .= "\t telefone, "; $sql .= "\t ativo, "; $sql .= "\t excluido, "; $sql .= "\t mapa_localizacao "; $sql .= "FROM "; $sql .= "\tpessoa "; $sql .= "WHERE 1=1 "; if (!empty($pessoa_id)) { $sql .= "\t AND pessoa_id = '" . $pessoa_id . "'"; } if (!empty($tipo_pessoa_id)) { $sql .= "\t AND tipo_pessoa_id = '" . $tipo_pessoa_id . "'"; } if (!empty($nome)) { $sql .= "\t AND nome LIKE '%" . $nome . "%'"; } if (!empty($excluido)) { $sql .= "\t AND excluido = '" . $excluido . "'"; } if (!empty($ativo)) { $sql .= "\t AND ativo = '" . $ativo . "'"; } $sql .= "ORDER BY nome"; return DBSql::getCollection($sql); }
/** * * @param type $pessoa_id * @param type $perfil_id * @return type */ public function getColecaoUsuario($pessoa_id = null, $perfil_id = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t pessoa_id, "; $sql .= "\t perfil_id, "; $sql .= "\t login, "; $sql .= "\t senha, "; $sql .= "\t ativo, "; $sql .= "\t atendimento_online, "; $sql .= "\t nome "; $sql .= "\t ,email "; $sql .= "\t ,primeiro_acesso "; $sql .= "FROM "; $sql .= "\tusuario "; $sql .= "WHERE 1=1"; if (empty($pessoa_id)) { if ($_SESSION['dados']['pessoa']['id'] != 1) { $sql .= " AND pessoa_id = " . $_SESSION['dados']['pessoa']['id']; } } else { $sql .= " AND pessoa_id = " . $pessoa_id; } if (!empty($perfil_id)) { $sql .= " AND perfil_id = " . $perfil_id; } if ($_REQUEST['nome']) { $sql .= " AND nome LIKE '%" . $_REQUEST['nome'] . "%'"; } $sql .= " ORDER BY nome"; return DBSql::getCollection($sql); }
public function getComboMenuFilho($menu_id_1 = null) { if ($_SESSION['dados']['pessoa']['perfil_id'] != 1) { $sql = " SELECT DISTINCT"; $sql .= " m.id, "; $sql .= " m.descricao, "; $sql .= " m.url, "; $sql .= " m.iconCls "; $sql .= " FROM menu m, "; $sql .= " permissao pm, "; $sql .= " perfil pe "; $sql .= " WHERE "; $sql .= " m.id = pm.menu_id "; $sql .= " AND pm.perfil_id = pe.id "; if (!is_null($menu_id_1)) { $sql .= " AND m.menu_id = " . $menu_id_1; } $sql .= " AND pe.id = " . $_SESSION['dados']['pessoa']['perfil_id']; $sql .= " ORDER BY m.posicao"; } else { $sql = " SELECT DISTINCT"; $sql .= " m.id, "; $sql .= " m.descricao, "; $sql .= " m.url, "; $sql .= " m.iconCls "; $sql .= " FROM menu m"; $sql .= " WHERE 1=1"; if (!is_null($menu_id_1)) { $sql .= " AND m.menu_id = " . $menu_id_1; } $sql .= " ORDER BY m.posicao"; } return DBSql::getCollection($sql); }
$sql .= " ORDER BY mp.posicao"; $rs = DBSql::getCollection($sql); $categorias = array(); while ($rs->Proximo()) { $categorias[] = $rs->getItem(); } unset($rs); foreach ($categorias as $key => $categoria) { $sql = " SELECT DISTINCT"; $sql .= " m.id, "; $sql .= " m.descricao, "; $sql .= " m.url, "; $sql .= " m.iconCls "; $sql .= " FROM menu m, "; $sql .= " permissao pm, "; $sql .= " perfil pe "; $sql .= " WHERE "; $sql .= " m.id = pm.menu_id "; $sql .= " AND pm.perfil_id = pe.id "; $sql .= " AND m.menu_id = " . $categoria['id']; $sql .= " AND pe.id = " . $_SESSION['dados']['pessoa']['perfil_id']; $sql .= " ORDER BY m.posicao"; $rs = DBSql::getCollection($sql); $itens = array(); while ($rs->Proximo()) { $itens[] = $rs->getItem(); } $categorias[$key]['itens'] = $itens; } ?>
/** * * @param type $query * @param type $campoValue * @param type $campoText * @param type $default * @return string */ public function _getComboOptions($query, $campoValue, $campoText, $default = null) { $options = null; $selected = ""; $this->_rs = DBSql::getCollection($query); if ($this->_rs->Count() > 0) { $key = 0; while ($this->_rs->Proximo()) { $obj = $this->_rs->getItem(); if (!is_array($default)) { if ($obj[$campoValue] == $default) { $selected = "selected"; } } else { if (in_array($obj[$campoValue], $default)) { $selected = "selected"; } } $options .= "<option value='" . str_replace("'", " ", $obj[$campoValue]) . "' {$selected}>" . str_replace("'", " ", $obj[$campoText]) . "</option>"; $selected = ""; $key++; } } else { $options = "<option value=''>.::Sem Registros::.</option>"; } $this->_rs = null; return $options; }
/** * RETorna uma colecao * * @return Collection */ public function getColecaoPerfilPermissao() { $sql = "SELECT "; $sql .= "\tp.id, "; $sql .= "\tp.nome, "; $sql .= "\tpm.acao_inserir, "; $sql .= "\tpm.acao_alterar, "; $sql .= "\tpm.acao_excluir, "; $sql .= "\tm.id as menu_id, "; $sql .= "\tm.descricao as menu_descricao "; $sql .= " FROM "; $sql .= "\tperfil p INNER JOIN permissao pm ON (p.id = pm.perfil_id)"; $sql .= "\tinner join menu m on (pm.menu_id = m.id)"; $sql .= " WHERE p.id = " . $_REQUEST['id']; return DBSql::getCollection($sql); }
public function getColecaoConteudo($id = null, $conteudo_categoria_id = null, $titulo = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t conteudo_categoria_id, "; $sql .= "\t titulo, "; $sql .= "\t subtitulo, "; $sql .= "\t descricao, "; $sql .= "\t descricao_breve, "; $sql .= "\t ordem, "; $sql .= "\t ativo, "; $sql .= "\t valor, "; $sql .= "\t nome,"; $sql .= "\t cargo, "; $sql .= "\t funcao, "; $sql .= "\t icone_bootstrap_id "; $sql .= "FROM "; $sql .= "\tconteudo "; $sql .= "WHERE 1=1 "; if (!empty($id)) { $sql .= "\t AND id = '" . $id . "'"; } if (!empty($conteudo_categoria_id)) { $sql .= "\t AND conteudo_categoria_id = '" . $conteudo_categoria_id . "'"; } if (!empty($titulo)) { $sql .= "\t AND titulo = '" . $titulo . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }
public function getColecaoBanner($id = null, $banner_categoria_id = null, $nome = null, $link = null, $ativo = null, $descricao = null) { $sql = "SELECT"; $sql .= "\t id, "; $sql .= "\t banner_categoria_id, "; $sql .= "\t nome, "; $sql .= "\t link, "; $sql .= "\t ativo, "; $sql .= "\t descricao "; $sql .= "FROM "; $sql .= "\tbanner "; $sql .= "WHERE 1=1 "; if (!empty($id)) { $sql .= "\t AND id = '" . $id . "'"; } if (!empty($banner_categoria_id)) { $sql .= "\t AND banner_categoria_id = '" . $banner_categoria_id . "'"; } if (!empty($nome)) { $sql .= "\t AND nome = '" . $nome . "'"; } if (!empty($link)) { $sql .= "\t AND link = '" . $link . "'"; } if (!empty($ativo)) { $sql .= "\t AND ativo = '" . $ativo . "'"; } if (!empty($descricao)) { $sql .= "\t AND descricao = '" . $descricao . "'"; } $sql .= "ORDER BY id"; return DBSql::getCollection($sql); }