Jump to content
Fórum Script Brasil
  • 0

Ajuda no Codigo


Anderson Orlandini

Question

Senhores,

Sou novo em PHP, estou tentando rodar o meu site, porem estou tendo o seguinte erro: Parse error: syntax error, unexpected T_ENDIF in C:\wamp\www\index.php on line 239

Já vasculhei o codigo e não consegui encontrar o que está faltando, alguém com mais experiencia poderia me ajudar?

Abaixo o codigo:

<?php

require_once "application.php";

include_once "visitanteae.php";

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta name="google-site-verification" content="gKMYz5xWeVTBaoaf2Q4sUkJKE77WTtqbTO0iTcP5vWc" />

<meta http-equiv="X-UA-Compatible" content="IE=8" />

<meta http-equiv="X-UA-Compatible" content="chrome=1" />

<title><?=$title?></title>

<!--[if IE 8]>

<link href=css/stylesheet-ie.css" rel="stylesheet" type="text/css" />

<![endif]-->

<script src="/img/AC_RunActiveContent.js" type="text/javascript"></script>

<?php include "head.inc.php";

?>

<script type="text/javascript">

var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-24825365-1]);

_gaq.push(['_trackPageview']);

(function() {

var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

})();

</script>

</head>

<body>

<? include "noscript.inc.php"; ?>

<div id=center">

<? include "cabecalho.inc.php"; ?>

<? include "barra_superior.inc.php"; ?>

<? include "banner_superior.inc.php"; ?>

<?

$leiloes = query("

SELECT l.idLeilao, l.titulo, l.url, p.img

FROM ".TB_LEILAO." l

INNER JOIN ".TB_PRODUTO." p ON l.idProduto = p.idProduto

WHERE

l.idLeilao NOT IN (SELECT a.idLeilao FROM ".TB_ARREMATADO." a)

ORDER BY l.dataInicio ASC

LIMIT 15

");

if ( $leiloes->num_rows > 0 ) :

?>

<div class="b870"> <!--border:1px solid #333;-->

<div class="content left">

<div style="width:755px;" class="left"> <!--border:1px solid #333;-->

<?

$i = 0;

$j = 0;

$ids = array();

while ($leilao = $leiloes->fetch_assoc()) :

$ids[] = $leilao['idLeilao];

$img = 'media_'.$leilao['img'];

$img = (!empty($leilao['img'])&&file_exists(IMGDIR.$img)) ? IMGDIR_URL.$img : "/img/marcadagua.png" ;

?>

<div class=t left b205 leilao <? if ($i==2) : ?>last<? endif; ?>" style="width:241px;">

<div class="b">

<div class="l">

<div class="r">

<div class="bl">

<div class="br">

<div class="tl">

<div class="tr" style="padding:8px 0px;">

<div class="center">

<h3 style="height:14px; overflow:hidden;"><a href="leilao/<?=$leilao['url]?>/<?=$leilao['idLeilao']?>.html" title=<?=$leilao['titulo]?>"><?=$leilao['titulo']?></a></h3>

<span class=small cinza">Código do leilão: <?=$leilao['idLeilao]?></span>

<div class="imagem"><a href="leilao/<?=$leilao['url']?>/<?=$leilao['idLeilao']?>.html" title=<?=$leilao['titulo]?>"><img src="<?=$img?>" height="100" border="0" vspace="4" /></a></div>

</div>

<div id="inicio<?=$leilao['idLeilao']?>" class=inicio"></div>

<div class="center">

<div id="tempo<?=$leilao['idLeilao]?>" class="tempo">&nbsp;</div>

<span id="preço<?=$leilao['idLeilao']?>" class=preço">&nbsp;</span>

<div class="lance"><a href="java script:<? if (usuarioLogado()&&creditoAtual()>0): ?>void(0)<? elseif(usuarioLogado()&&creditoAtual()==0): ?>window.location.href='<?=url('adicionar-creditos.html?zero')?>'; void 0;<? else: ?>window.location.href='<?=url('login.html')?>'; void 0;<? endif; ?>"<? if (usuarioLogado()&&creditoAtual()>0): ?> onclick="setLance(<?=$leilao['idLeilao]?>)"<? endif; ?>><img id="btn-lance-<?=$leilao['idLeilao']?>" src=/img/btn_lance.gif" border="0"/></a></div>

<div id="usuario<?=$leilao['idLeilao]?>" class="usuario">&nbsp;</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

<?

$leilao['img'] = "";

if ($i++==2) {

if ($j++<4) echo '<div class=clear"></div>';

$i = 0;

}

endwhile;

/*INICIAR LEILAO*/

init($ids);

/*INICIAR LEILAO*/

?>

</div>

<div style="width:205px;" class="left">

<?

$leiloes = query("

SELECT l.idLeilao, l.titulo, l.url, DATE_FORMAT(l.dataInicio,'%d/%m/%Y %H:%i\h') AS dataInicio, p.img

FROM ".TB_LEILAO." l

INNER JOIN ".TB_PRODUTO." p ON l.idProduto = p.idProduto

WHERE

l.idLeilao NOT IN (SELECT a.idLeilao FROM ".TB_ARREMATADO." a) and destaque = 1

ORDER BY l.dataInicio ASC

LIMIT 4

"); //destaque = 1 AND

if ( $leiloes->num_rows > 0 ) :

?>

<!-- AddThis Button BEGIN -->

<div class="addthis_toolbox addthis_default_style ">

<a class="addthis_button_tweet"></a>

<a class="addthis_counter addthis_pill_style"></a>

</div>

<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>

<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=dedestell"></script><br>

<!-- AddThis Button END -->

<script src="http://h1.flashvortex.com/display.php?id=2_1319124711_44097_305_0_205_39_8_1_24" type="text/javascript"></script><p><br>

&nbsp&nbsp&nbsp<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="184" height="165">

<param name="movie" value="/img/Banner_Propaganda1.swf" />

<param name="quality" value="high" />

<embed src="/img/Banner_Propaganda1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="184" height="165"></embed>

</object><br>

<p><br>

&nbsp&nbsp&nbsp<a href="http://www.zoinhonolance.com.br/promocoes.php"><img src="/img/propaganda1000.png" width="184" height="230"></a><br><p><br>

<div class="t left b205" style="width:205px;">

<div class="b">

<div class="l">

<div class="r">

<div class="bl">

<div class="br">

<div class="tl">

<div class="tr">

<div class="tópico">

<div class="left"></div><h3>Destaques</h3><div class="right"></div>

</div>

<?

$i = 0;

while ($leilao = $leiloes->fetch_assoc()) :

$img = 'mini_'.$leilao['img];

$img = (!empty($leilao['img'])&&file_exists(IMGDIR.$img)) ? IMGDIR_URL.$img : "/img/marcadagua.png" ;

?>

<div class=destaques center <? if ($i++==3) : ?>last<? endif; ?>">

<h3 style="height:14px; overflow:hidden;"><a href="leilao/<?=$leilao['url]?>/<?=$leilao['idLeilao']?>.html" title=<?=$leilao['titulo]?>"><?=$leilao['titulo']?></a></h3>

<div><a href=leilao/<?=$leilao['url]?>/<?=$leilao['idLeilao']?>.html" title=<?=$leilao['titulo]?>"><img src="<?=$img?>" border="0" height="76" /></a></div>

<span>Início do leilão<br /><?=$leilao['dataInicio']?></span>

</div>

<?

endwhile;

?>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

<div class=clear"></div>

<?

endif;

$enquetes = query("SELECT * FROM ".TB_ENQUETE." ORDER BY id DESC LIMIT 1");

if ($enquetes->num_rows > 0) :

$enquete = $enquetes->fetch_assoc();

?>

<div class="t left b205" style="width:205px;">

<div class="b">

<div class="l">

<div class="r">

<div class="bl">

<div class="br">

<div class="tl">

<div class="tr" style="height:256px;">

<div class="tópico">

<div class="left"></div>

<h3>Enquete</h3><div class="right"></div>

</div>

<div style="padding:3px">

<p style="text-align:justify"><?php echo $enquete['enquete]?></p>

<?php if (!isset($_SESSION['EnqueteBidOnline'])) :?>

<form id=form-enquete" action="<?php echo url('enquete.act.php')?>" method="post">

<input type="hidden" name="redir" value="<?php echo $_SERVER['REQUEST_URI]?>" />

<input type="hidden" name="idEnquete" value="<?php echo $enquete['id']?>" />

<?php if (!empty($enquete['a1'])) :?><p><label><input type=radio" name="alternativa" value="1" /> <?php echo $enquete['a1]?></label></p><? endif;?>

<?php if (!empty($enquete['a2'])) :?><p><label><input type=radio" name="alternativa" value="2" /> <?php echo $enquete['a2]?></label></p><? endif;?>

<?php if (!empty($enquete['a3'])) :?><p><label><input type=radio" name="alternativa" value="3" /> <?php echo $enquete['a3]?></label></p><? endif;?>

<?php if (!empty($enquete['a4'])) :?><p><label><input type=radio" name="alternativa" value="4" /> <?php echo $enquete['a4]?></label></p><? endif;?>

<?php /*if (!empty($enquete['a5'])) :?><p><label><input type=radio" name="alternativa" value="5" /> <?php echo $enquete['a5]?></label></p>

<!--<div class="left" style="line-height:28px"><a href="" title="Confira os resultados da enquete!">Ver resultado</a></div>--><? endif;*/?>

<div class="right"><a class="button" href="java script:document.getElementById('form-enquete').submit()" style="width:60px;" title="Votar"><span>Votar</span></a></div>

</form>

<p>&nbsp;</p>

<?php else:?>

<?php

$total = $enquete['r1'] + $enquete['r2'] + $enquete['r3'] + $enquete['r4']; //+ $enquete['r5'];

for ($i=1;$i<=4;$i++) :

$alternativa = $enquete["a".$i];

if (!empty($alternativa)) : ?>

<p class=small"><?php echo $alternativa;?></p><?

if (!empty($total)) {

$votos = $enquete["r".$i];

$resultado = round(($votos*100)/$total);

} else {

$votos = 0;

$resultado = 0;

}

?><span style="color:#EE1289"><i><? echo $resultado; ?>%<?php /*?> (<?=$votos?> votos)<?php */?></i></span><?

endif;

endfor;

?>

<p><b>Obrigado pela participação!</b></p>

<?php endif?>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

<?php endif?>

&nbsp&nbsp&nbsp<a href="http://www.zoinhonolance.com.br/registro.html"><img src="/img/propaganda5lances.png" width="184" height="90"></a><p><br>

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/pages/Zoinho-no-Lance/163172997062813?ref=ts" width="206" show_faces="true" stream="false" header="true"></fb:like-box>

</div>

</div>

<div class="bottom left"></div>

</div>

<div class="clear"></div>

<?

endif;

$arrematados = query("

SELECT a.*, l.titulo, l.url, p.preço AS mercado, a.valor AS arrematado, u.usuario AS arrematante, p.chamada, c.nome AS categoria, s.nome AS subcategoria, p.desconto, p.img,

DATE_FORMAT(a.dataArremate,'%d/%m/%Y %H:%i\h') AS dataArremate

FROM ".TB_ARREMATADO." a

LEFT JOIN ".TB_USUARIO." u ON a.idUsuario = u.idUsuario

INNER JOIN ".TB_LEILAO." l ON a.idLeilao = l.idLeilao

INNER JOIN ".TB_PRODUTO." p ON l.idProduto = p.idProduto

LEFT JOIN ".TB_CATEGORIA." c ON p.idCategoria = c.idCategoria

LEFT JOIN ".TB_SUBCATEGORIA." s ON p.idSubCategoria = s.idSubCategoria

ORDER BY a.dataArremate DESC

LIMIT 10

");

if ( $arrematados->num_rows > 0 ) :

?>

<div class="b870">

<div class="content left">

<div class="tópico">

<div class="left"></div><h3>Arrematados</h3><div class="right"></div>

</div>

<div class="header">

<div class="header-produto">Produto</div>

<div class="header-mercado">Preço de mercado</div>

<div class="header-arrematado">Arrematado à</div>

<div class="header-arrematante">Arrematante</div>

</div>

<?

while ($arrematado = $arrematados->fetch_assoc()) :

$total_lances = query("SELECT count(*) AS qtd FROM ".TB_LANCE." WHERE idUsuario = '".$arrematado['idUsuario]."' AND idLeilao = '".$arrematado['idLeilao']."'");

$total_lances = $total_lances->fetch_assoc();

$img = 'media_'.$arrematado['img'];

$img = (!empty($arrematado['img'])&&file_exists(IMGDIR.$img)) ? IMGDIR_URL.$img : "/img/marcadagua.png" ;

$d = $arrematado['desconto'];

?>

<div class=row">

<div class="row-imagem">

<a href="leilao/<?=$arrematado['url]?>/<?=$arrematado['idLeilao']?>.html" title=<?=$arrematado['titulo]?>"><img src="<?=$img?>" height="100" border="0" /></a>

</div>

<div class="row-produto">

<div>

<h3><a href="leilao/<?=$arrematado['url']?>/<?=$arrematado['idLeilao']?>.html" title=<?=$arrematado['titulo]?>"><?=$arrematado['titulo']?></a></h3>

<span class=small cinza"><!--Código do leilão: <?=$arrematado['idLeilao]?> --><?=$arrematado['categoria']?><!-- > <?=$arrematado['subcategoria']?>--></span>

<p class=medium"><?=$arrematado['chamada]?></p>

</div>

</div>

<div class="row-mercado">

<div>

<span class="chumbo">R$ <?=number_format($arrematado['mercado'],2,',','.')?></span>

</div>

</div>

<div class=row-arrematado">

<div>

<span class="<? if ( !empty($d) && is_numeric($d) ) : ?>through chumbo<? else: ?>destaque<? endif; ?>">R$ <?=number_format($arrematado['arrematado],2,',','.')?></span>

<?

if ( !empty($d) && is_numeric($d) ) : ?>

<br /><br />

<span class="small cinza">Desconto de <?=$d?>%</span><br />

<h3>R$ <?=number_format(($arrematado['arrematado']*$d)/100,2,",",".")?></h3>

<? endif; ?>

</div>

</div>

<div class=row-arrematante">

<div>

<span class="medium"><?=$arrematado['dataArremate]?><br /><?=$arrematado['arrematante']?> (<?php echo $total_lances['qtd']?> lances usados)</span>

</div>

</div>

</div>

<?

endwhile;

?>

</div>

<div class="bottom left"></div>

</div>

<? endif; ?>

<? include "rodape.inc.php"; ?>

<? include "online.php"; ?>

</div>

</body>

</html>

Muito obrigado.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Eu não sei porque as pessoas gostam de utilizar o if e else com ":"

É mais fácil manter a chave "{}" para identar melhor o arquivo.

Caso não saiba qual o número dessa linha, abra o código fonte em algum editor de texto que as mostre, pra ficar mais fácil de identificá-la.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...