function menuSubDepartamentos($departamentos,$id="") {
		echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>";
		echo "<img src=\"".$this->image_path."images/departamentos.gif\">";
		echo "</td></tr></table>";
		echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>";
		$totDepartamentos = count($departamentos);
		$departamentoDAO = new DepartamentoDAO();
		echo "<ul>";
		
		for($i = 0; $i < $totDepartamentos; $i++) {
			$nomeDepartamento = $departamentoDAO->getDepartamentosPorId($departamentos[$i]->getIddepartamento());
			$link = UrlManage::getUrlSubCategoria($departamentos[$i]->iddepartamento,$_GET['titulo'],$departamentos[$i]->idsubdepartamento,$departamentos[$i]->subdepartamento);
			$anuncioDAO = new AnuncioDAO;
			$total = $anuncioDAO->totalAnuncios($departamentos[$i]->getIdsubdepartamento(),"subdepartamento");
			 
			if($total > 0) {
		?>
			<li>
				<a href="<?=$link;?>">
				<?
					if($departamentos[$i]->getIdSubdepartamento() == $id) {
						echo "<b>".$departamentos[$i]->getSubDepartamento()."</b>";
					} else {
						echo $departamentos[$i]->getSubDepartamento();
					}
					?>
				</a>
			</li>
		<?
			}
		}
		?>
		<li class="direita">
			<a href="<?=$this->image_path;?>departamentos.php">
				» Ver todos os departamentos
			</a>
		</li>
		<?
		echo "</ul>";
		echo "</td></tr></table>";
	}
예제 #2
0
<?
	function __autoload($classe) {
		require_once "../class/".$classe.".class.php";
	}
	
	$anuncioDAO = new AnuncioDAO();
	$anuncioDAO->contaAcesso($_POST['id']);
	
	print_r($_POST);
?>
예제 #3
0
									$layout->menuSubDepartamentos($subdepartamentos, $sub);
								}
							}
						
						echo $layout->bannersEsquerda($bannerDAO->ListaBannerPorDepartamentoPosicao($id,"lateralesq",3));?>
				</div>
				<div class="miolo">
					<? 
						if($_GET['totalPP']) {
							$totalPorPagina = $_GET['totalPP'];
						} else {
							$totalPorPagina = 10;
						}
												
						$anuncio = new Anuncio();
						$anuncioDAO = new AnuncioDAO();
						if($sub == "") {
							$anuncio = $anuncioDAO->ListaAnunciosPorDepartamento($id);
							$regra = "where iddepartamento = ".$id." ";
						} else {
							$anuncio = $anuncioDAO->ListaAnunciosPorSubDepartamento($sub);
							$regra = "where idsubdepartamento = ".$sub." ";
						}
						
						$totAnuncios = count($anuncio);
						if($totAnuncios > 0) {
							$paginas = ceil($totAnuncios / $totalPorPagina);				
												
							if($_GET['pag']) {
								$pagina = $_GET['pag'];
							} else {
예제 #4
0
<?
	session_start();
	
	function __autoload($classe) {
		require_once "../class/".$classe.".class.php";
	}
	
	/*$cliente = new Cliente();
	$clienteDAO = new ClienteDAO();
	
	$cliente = $clienteDAO->getUsuarioPorNome("Oiter Busca");
	
	print_r($cliente);*/
	
	$anuncio = new Anuncio();
	$anuncioDAO = new AnuncioDAO();
	
	$anuncio = $anuncioDAO->getAnuncioPorId($_POST['id']);
	
	if($_POST['unid'] == $_SESSION['sid_textoCaptcha']) {
		$headers = "Content-type: text/html; charset=iso-8859-1\n";
		$headers .= "From: ".$_POST['nome']." <".$_POST['email'].">";
		$assunto = $_POST['assunto']. " - Contato pelo OITERBUSCA";
		if($_POST['telefone']) $telefone = '<p>Telefone: '.$_POST['telefone'].'</p>';
		$mensagem = '<html dir="ltr">
					    <head>
					    </head>
					    <body spellcheck="false">
					    	'.$telefone.'
					        <p>'.nl2br($_POST['mensagem']).'</p>
					    </body>
예제 #5
0
<?php

Auth::verificaAcesso();
ob_start();
function __autoload($classe)
{
    require_once "../../class/" . $classe . ".class.php";
}
$anuncio = new Anuncio();
$anuncioDAO = new AnuncioDAO();
$departamento = new Departamento();
$departamentoDAO = new DepartamentoDAO();
$subdepartamento = new Subdepartamento();
$subdepartamentoDAO = new SubdepartamentoDAO();
$acao = $_GET["acao"];
//$acao = "alt";
$menuDAO = new MenuAdminDAO();
$menu = $menuDAO->getMenuPorTitulo("anuncios");
$idmenu = $menu->getIdmenu();
switch ($acao) {
    case "add":
        print_r($_POST);
        exit;
        $logo = $_FILES["logo"]["name"];
        $logo_type = $_FILES["logo"]["type"];
        $logo_tmp_name = $_FILES["logo"]["tmp_name"];
        $logo_size = $_FILES["logo"]["size"];
        $setLogo = $anuncio->upload_imagem($logo, $logo_type, $logo_tmp_name, $logo_size, 1000000, 220, 500, "logos");
        $logoDestaque = $_FILES["logoDestaque"]["name"];
        $logoDestaque_type = $_FILES["logoDestaque"]["type"];
        $logoDestaque_tmp_name = $_FILES["logoDestaque"]["tmp_name"];
예제 #6
0
			<div id="corpo">
				<div class="menu">
						<?php 
echo $layout->menuDepartamentos($departamentos);
?>
						<?php 
echo $layout->bannersEsquerda($bannerDAO->ListaBannerPorDepartamentoPosicao("inicial", "lateralesq", 3));
?>
				</div>
				<div class="miolo">
					<div id="destaqueHome">
						<h2>Destaques</h2>
						<ul>
						<?
							$anuncio = new Anuncio();
							$anuncioDAO = new AnuncioDAO();
							
							$anuncio = $anuncioDAO->ListaAnunciosDestaqueHome();
							$departamento = new Departamento();
							$departamentoDAO = new DepartamentoDAO();
							
							for($i=0; $i < count($anuncio);$i++) {
								
								$departamento = $departamentoDAO->getDepartamentosPorId($anuncio[$i]->getIddepartamento());
								echo "
								<li>
									<img width=\"175\" height=\"80\" alt=\"".$anuncio[$i]->getNome()."\" src=\"".$layout->image_path."images/destaques/".$anuncio[$i]->getLogoDestaque()."\" onclick=\"contaAcesso('".$anuncio[$i]->getIdAnuncio()."');abrirDestaque('".$layout->image_path."anunciante.php?id=".$anuncio[$i]->getIdAnuncio()."','".$anuncio[$i]->getNome()."',700,500)\">
									<p><a href=\"".UrlManage::getUrlCategoria($anuncio[$i]->getIddepartamento(),"",$departamento->getDepartamento())."\">".$departamento->getDepartamento()."</a></p>
								</li>";
							}							
						?>
예제 #7
0
<?
	function __autoload($classe) {
		require_once "class/".$classe.".class.php";
	}	
	
	$id = $_REQUEST['id'];	
	$p = $_GET['p'];
	
	$layout = new Layout();
	$anuncio = new Anuncio();
	$anuncioDAO = new AnuncioDAO();
	
	$anuncio = $anuncioDAO->getAnuncioPorId($id);		
	$key['local']  = "ABQIAAAAdYDULndWHw73mv6IA5TzQxRMtg-kJ86tYRuSzULgUSI7o9IM_xTBnZ5iDcBkLKVAq13VtrFrxJwhxA";
	$key['online'] = "ABQIAAAAdYDULndWHw73mv6IA5TzQxRQnSlT4KQ-GYzt3qGqXg8vKTdKzBSXAZnS0UBwi2weHwDkS7HX_OEF6Q";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title><?php 
echo utf8_encode($anuncio->getNome());
?>
</title>
    <?php 
echo $layout->getTheme("");
?>
	<link rel="shortcut icon" href="<?php 
echo $layout->image_path;
예제 #8
0
			</div>
			<!-- Fim do Header -->
			<div id="corpo">
				<div class="miolo" style="width: 100%;">
					<? 
						if($_GET['totalPP']) {
							$totalPorPagina = $_GET['totalPP'];
						} else {
							$totalPorPagina = 10;
						}
						
						$departamento =$_GET['selDepartamentos'];
						$pesquisa = stripcslashes($_GET['pesquisa']);
																	
						$anuncio = new Anuncio();
						$anuncioDAO = new AnuncioDAO();
						
						if($departamento != "") {
							//$anuncio = $anuncioDAO->ListaAnunciosPorDepartamento($departamento);
							$regra = "where iddepartamento = ".$departamento." and (nome LIKE '%%".$pesquisa."%%' OR endereco LIKE '%%".$pesquisa."%%' OR bairro LIKE '%%".$pesquisa."%%' OR cidade LIKE '%%".$pesquisa."%%' OR estado LIKE '%%".$pesquisa."%%' OR cep LIKE '%%".$pesquisa."%%' OR telefones LIKE '%%".$pesquisa."%%' OR site LIKE '%%".$pesquisa."%%' OR email LIKE '%%".$pesquisa."%%' OR texto LIKE '%%".$pesquisa."%%' OR keywords LIKE '%%".$pesquisa."%%' OR pesquisa LIKE '%%".$pesquisa."%%')";
						} else {
							//$anuncio = $anuncioDAO->ListaAnunciosPorSubDepartamento($sub);
							$regra = "
								WHERE (nome LIKE '%%".$pesquisa."%%' OR endereco LIKE '%%".$pesquisa."%%' OR bairro LIKE '%%".$pesquisa."%%' OR cidade LIKE '%%".$pesquisa."%%' OR estado LIKE '%%".$pesquisa."%%' OR cep LIKE '%%".$pesquisa."%%' OR telefones LIKE '%%".$pesquisa."%%' OR site LIKE '%%".$pesquisa."%%' OR email LIKE '%%".$pesquisa."%%' OR texto LIKE '%%".$pesquisa."%%' OR keywords LIKE '%%".$pesquisa."%%' OR pesquisa LIKE '%%".$pesquisa."%%')
							";
						}
								
						$regra .= " Order by detalhe DESC, acessos DESC, nome ASC";
						
						if($_GET['pag']) {
							$pagina = $_GET['pag'];
		function AnuncioALT() { ?>
		<?
			$anuncio = new Anuncio();
			$anuncioDAO = new AnuncioDAO();
		
			$cep = $_GET["cep"];
			
			if(isset($cep)) {
				$resultado_busca = $this->busca_cep($cep);
			}
			
			$idanuncio = $_GET["idanuncio"]; 
			$anuncio = $anuncioDAO->getAnuncioPorId($_GET["idanuncio"]);
		?>		
	        <span class="TituloPage">• Alterar Anúncio</span>
	        <br/>
	        <br/>                         
	        <table width="558" cellspacing="1" cellpadding="4" border="0" class="BordaTabela">
	        <form action="act/Anuncio.act.php?acao=alt" name="anuncios" method="post" enctype="multipart/form-data">                       
	        <input type="hidden" name="idanuncio" value="<?=$anuncio->getIdanuncio();?>">
	        <input type="hidden" name="iddepartamento" value="<?=$iddepartamento;?>">
		        <tbody>
		        	<tr class="Linha2Tabela">
	                    <td align="right"><b> DEPARTAMENTO:</b></td>
	                    <td>
	                    	<div id="departamento">
		                    	<?
		                    		$departamento = new Departamento();
		                    		$departamentoDAO = new DepartamentoDAO();
		                    		$departamento = $departamentoDAO->Lista();
	                    			$this->selectDepartamentosAdminAlt($departamento,$anuncio->getIddepartamento());
		                    	?>
			                </div>
	                    </td>
	                </tr>	                
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> SUBDEPARTAMENTOS:</b></td>
	                    <td>	
	                    	<?
								$subdepartamento = new Subdepartamento();
								$subdepartamentoDAO = new SubdepartamentoDAO();
								$subdepartamento = $subdepartamentoDAO->getSubdepartamentosPorIddepartamento($anuncio->getIddepartamento());
	                		?>                    	
		                		<select name="idsubdepartamento" id="idsubdepartamento" class="FORMbox">
								<?
								if(count($subdepartamento) > 0 && $anuncio->getIdsubdepartamento() != 0) {
								for($i=0;$i < count($subdepartamento);$i++) { ?>
								<option <? if($anuncio->getIdsubdepartamento() == $subdepartamento[$i]->getIdsubdepartamento()) echo "selected" ?> value="<?=$subdepartamento[$i]->getIdsubdepartamento();?>"><?=$subdepartamento[$i]->getSubdepartamento();?></option>
								<? }
								} else {
								?>
								<option value="0">Sem Subdepartamento</option>
								<?
								}
								?>
								</select>
	                    </td>
	                </tr>	        	                            	   	
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> NOME DO ANÚNCIANTE</b></td>
	                    <td><input type="text" value="<?=$anuncio->getNome();?>" class="FORMbox" size="75" name="nome"/></td>
	                </tr>
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> CEP</b></td>
	                    <td><input type="text" tipo="numerico" mascara="#####-###" value="<?=$anuncio->getCep();?>" onfocus="this.value = ''" onblur="javascript:buscaCep(this.value)" id="cep" name="cep" maxlength="9" snegativo="n" title="Cep" style="width: 80px;" class="FORMBox"/></td>
	                </tr>
	                <div id="resultado">
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> ENDEREÇO</b></td>
	                    <td><input type="text" value="<?=$anuncio->getEndereco();?>" class="FORMbox" size="75" id="endereco" name="endereco"/></td>
	                </tr>
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> NÚMERO</b></td>
	                    <td><input type="text" value="<?=$anuncio->getNumero();?>" class="FORMbox" size="15" name="numero"/></td>
	                </tr>
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> COMPLEMENTO</b></td>
	                    <td><input type="text" value="<?=$anuncio->getComplemento();?>" class="FORMbox" size="15" name="complemento"/></td>
	                </tr>  
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> BAIRRO</b></td>
	                    <td><input type="text" value="<?=$anuncio->getBairro();?>" class="FORMbox" size="15" id="bairro" name="bairro"/></td>
	                </tr>
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> CIDADE</b></td>
	                    <td><input type="text" value="<?=$anuncio->getCidade();?>" class="FORMbox" size="15" id="cidade" name="cidade"/></td>
	                </tr>
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> ESTADO</b></td>
	                    <td><input type="text" value="<?=$anuncio->getEstado();?>" class="FORMbox" size="15" id="estado" name="estado"/></td>
	                </tr>
	                </div>               
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> TELEFONES</b></td>
	                    <td><input type="text" value="<?=$anuncio->getTelefones();?>" class="FORMbox" size="75" name="telefones"/></td>
	                </tr>
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> DETALHES</b></td>
	                    <td>
	                    	<select name="detalhe" id="detalhe" class="FORMBox" onchange="detalhes_alt(this.value)">
	                    		<option value="">--Selecione--</option>
	                    		<option value="1" <? if($anuncio->getDetalhe() == 1) { echo "selected"; } ?>>Sim</option>
	                    		<option value="0" <? if($anuncio->getDetalhe() == 0) { echo "selected"; } ?>>Não</option>
	                    	</select>
	                    </td>
	                </tr>	                
	                <tr id="email" class="Linha1Tabela" style='display:none'>
	                    <td align="right"><b> E-MAIL</b></td>
	                    <td><input type="text" value="<?=$anuncio->getEmail();?>" class="FORMbox" size="75" name="email"/></td>
	                </tr>
	                <tr id="site" class="Linha1Tabela" style='display:none'>
	                    <td align="right"><b> SITE</b></td>
	                    <td><input type="text" value="<?=$anuncio->getSite();?>" class="FORMbox" size="75" name="site"/></td>
	                </tr>
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> LOGO</b></td>
	                    <td><input type="file" value="" class="FORMbox" size="45" name="logo"/></td>
	                </tr>
	                <tr class="Linha1Tabela">
	                	<td align="center" colspan="2"><img src="../images/logos/<?=$anuncio->getLogo();?>" border="0"><input type="hidden" name="logo" value="<?=$anuncio->getLogo();?>"></td>
	                </tr>
	                <tr id="imagem1" class="Linha1Tabela" <? if($anuncio->getDetalhe() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                    <td align="right"><b> IMAGEM 1</b></td>
	                    <td><input type="file" value="" class="FORMbox" size="45" name="imagem1"/></td>
	                </tr>
	                <tr id="imagem1_img" class="Linha1Tabela" <? if($anuncio->getDetalhe() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                	<td align="center" colspan="2"><img src="../images/thumbs/<?=$anuncio->getImagem1();?>" border="0"><input type="hidden" name="imagem1" value="<?=$anuncio->getImagem1();?>"></td>
	                </tr>
	                <tr id="imagem2" class="Linha1Tabela" <? if($anuncio->getDetalhe() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                    <td align="right"><b> IMAGEM 2</b></td>
	                    <td><input type="file" value="" class="FORMbox" size="45" name="imagem2"/></td>
	                </tr>
	                <tr id="imagem2_img" class="Linha1Tabela" <? if($anuncio->getDestaque() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                	<td align="center" colspan="2"><img src="../images/thumbs/<?=$anuncio->getImagem2();?>" border="0"><input type="hidden" name="imagem2" value="<?=$anuncio->getImagem2();?>"></td>
	                </tr>
	                <tr id="imagem3" class="Linha1Tabela" <? if($anuncio->getDetalhe() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                    <td align="right"><b> IMAGEM 3</b></td>
	                    <td><input type="file" value="" class="FORMbox" size="45" name="imagem3"/></td>
	                </tr>
	                <tr id="imagem3_img" class="Linha1Tabela" <? if($anuncio->getDetalhe() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                	<td align="center" colspan="2"><img src="../images/thumbs/<?=$anuncio->getImagem3();?>" border="0"><input type="hidden" name="imagem3" value="<?=$anuncio->getImagem3();?>"></td>
	                </tr>
	                <tr id="imagem4" class="Linha1Tabela" <? if($anuncio->getDetalhe() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                    <td align="right"><b> IMAGEM 4</b></td>
	                    <td><input type="file" value="" class="FORMbox" size="45" name="imagem4"/></td>
	                </tr>
	                <tr id="imagem4_img" class="Linha1Tabela" <? if($anuncio->getDetalhe() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                	<td align="center" colspan="2"><img src="../images/thumbs/<?=$anuncio->getImagem4();?>" border="0"><input type="hidden" name="imagem4" value="<?=$anuncio->getImagem4();?>"></td>
	                </tr>
	                <tr id="destaque" class="Linha1Tabela" style='display:none'>
	                    <td align="right"><b> DESTAQUE</b></td>
	                    <td>
	                    	<select name="destaque" id="destaque" class="FORMBox" onchange="dest(this.value)">
	                    		<option value="">--Selecione--</option>
	                    		<option value="1" <? if($anuncio->getDestaque() == 1) { echo "selected"; } ?>>Sim</option>
	                    		<option value="0" <? if($anuncio->getDestaque() == 0) { echo "selected"; } ?>>Não</option>
	                    	</select>
	                    </td>
	                </tr>
	                <?
	                	if($anuncio->getDestaque() == 1) {
	                ?>
	                <tr class="Linha1Tabela" id="logoDestaque" <? if($anuncio->getDestaque() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                	<td align="right"><b> LOGO DESTAQUE</b></td>
	                	<td><input type="file" value="" class="FORMbox" size="45" name="logoDestaque"/><br>Imagem com 175x80 pixels</td>
	                </tr>
	                <tr class="Linha1Tabela" id="logoDestaque_img" <? if($anuncio->getDestaque() == 0) { echo "style='display:none'"; }else{ echo "style='display:'"; } ?>>
	                	<td align="center" colspan="2"><img src="../images/destaques/<?=$anuncio->getLogoDestaque();?>" border="0"><input type="hidden" name="logoDestaque" value="<?=$anuncio->getLogoDestaque();?>"></td>
	                </tr>
	                <?
	                	}
	                ?>
	                <tr class="Linha1Tabela">
	                    <td align="right"><b> PAGAMENTO</b></td>
	                    <td>
	                    	De:<input type="text" name="de" value="<?=$anuncio->MostraDataSemHora($anuncio->getDe());?>" class="data FORMBox">
	                    	até:<input type="text" name="ate" value="<?=$anuncio->MostraDataSemHora($anuncio->getAte());?>" class="data FORMBox">
	                    </td>
	                </tr>
	                <tr class="Linha1Tabela">
	                    <td align="center"><b>DESCRIÇÃO DO ANÚNCIO</b></td>
	                    <td>                                    	
	                    	<textarea name="texto" rows="10" cols="70" class="FORMBox"><?=$anuncio->getTexto();?></textarea>  		                                                                                                     
	                    </td>
	            	</tr>
	            	<tr class="Linha1Tabela">
	                    <td align="center"><b>PALAVRAS CHAVE</b></td>
	                    <td>                                    	
	                    	<textarea name="keywords" rows="10" cols="70" class="FORMBox"><?=$anuncio->getKeywords();?></textarea><br>Separe as palavras por , (vírgula). Ex.: palavras , chave , etc 		                                                                                                     
	                    </td>
	            	</tr>
	                <tr class="Linha3Tabela">
		                <td align="right" colspan="2"><input type="submit" class="bttn4" value="Alterar Anuncio" name="alterar"/>&nbsp;&nbsp;<input type="submit" class="bttn3" value="Remover Anuncio" onclick="return confirma_apagar();" name="remover"/></td>
		            </tr>
	        	</tbody>
	        </table>
	        </form>                
	<?	}