public static function buscaPorEmail($email) { global $db; $sql = "SELECT id\n FROM s3_cliente\n\t\t\t\tWHERE email = '" . trim($email) . "'\n\t\t\t\tLIMIT 0,1"; // exit($sql); $rs = executaSql($sql); if ($rg = $rs->fetchRow()) { return $rg['id']; } else { return false; } }
public static function listar($filtro = "") { global $db; $sql = "SELECT n.*, ni.imagem, ni.legenda, n.data as dataSalao\n FROM s3_saloes n\n LEFT JOIN s3_saloes_imagem ni\n ON n.id = ni.id_salao and ni.principal = 's'\n WHERE 1=1 " . $filtro; // exit($sql); $rs = executaSql($sql); $arrLista = array(); while ($rg = $rs->fetchRow()) { foreach ($rg as $campo => $valor) { $arrLista[$rg['id']][$campo] = $valor; } } return count($arrLista) > 0 ? $arrLista : false; }
public static function listar($filtro = "") { global $bd; $sql = "SELECT n.*\n FROM s3_noticias n\n LEFT JOIN s3_noticias_tag nt\n ON nt.id_noticia = n.id\n LEFT JOIN s3_noticias_tags nts\n ON nts.id = nt.id_tag\n WHERE 1=1 " . $filtro; //exit($sql); $rs = executaSql($sql); $arrLista = array(); while ($rg = $rs->fetchRow()) { foreach ($rg as $campo => $valor) { $arrLista[$rg['id']][$campo] = $valor; } } return count($arrLista) > 0 ? $arrLista : false; }
public static function listar($filtro = "") { global $db; $sql = "SELECT p.*,\n ps.status,\n c.nome cliente,\n ps.id id_p_status,\n c.id idCliente,\n p.total,\n p.data_cadastro\n FROM s3_pedido p,\n s3_status ps,\n s3_cliente c\n WHERE p.id_pedido_status = ps.id\n AND p.id_cliente = c.id\n " . $filtro; //exit($sql); $rs = executaSql($sql); $arrLista = array(); while ($rg = $rs->fetchRow()) { $arrLista[$rg['id']]['id'] = $rg['id']; $arrLista[$rg['id']]['data_cadastro'] = $rg['data_cadastro']; $arrLista[$rg['id']]['total'] = $rg['total']; $arrLista[$rg['id']]['status'] = $rg['id_p_status']; $arrLista[$rg['id']]['statusNome'] = $rg['status']; $arrLista[$rg['id']]['idCliente'] = $rg['idCliente']; } //echoArray($arrLista); exit; return count($arrLista) > 0 ? $arrLista : false; }
public function atualizaId() { global $db; $sql = "SELECT MAX(" . $this->tabelaId . ") ultimo FROM " . $this->tabelaNome; $rs = executaSql($sql); $rg = $rs->fetchRow(); $this->{$this->arrCampos[$this->tabelaId]} = $rg['ultimo']; //return $rg['ultimo']; }