first_php_project/eventos.php
2021-11-19 22:12:23 -03:00

65 lines
2.4 KiB
PHP
Executable File

<?php require_once('Connections/conn_sustentabilidade.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_conn_sustentabilidade, $conn_sustentabilidade);
$query_lista_evento = "SELECT * FROM vw_tbeventos ORDER BY nome_evento ASC";
$lista_evento = mysql_query($query_lista_evento, $conn_sustentabilidade) or die(mysql_error());
$row_lista_evento = mysql_fetch_assoc($lista_evento);
$totalRows_lista_evento = mysql_num_rows($lista_evento);
?>
<section class="main">
<h1>Eventos</h1>
<section class="container-fluid">
<section class="row">
<?php do { ?>
<section class="col-xs-12 col-md-6 col-sm-6 thumbnail">
<section class="col-md-12">
<img src="imagens/<?php echo $row_lista_evento['imagem_evento']?>" class="img-responsive img-thumbnail" alt="Imagem do Evento" style="max-height: 100%">
</section>
<section class="col-md-12">
<h4><?php echo $row_lista_evento['rotulo_tipo']?></h4>
<p>Público: <?php echo $row_lista_evento['publico_evento']?></p>
<p><?php echo mb_strimwidth($row_lista_evento['descr_evento'],0,125,"...")?></p>
<p class="text-right">
<a href="eventos_detalhe.php?id_evento=<?php echo $row_lista_evento['id_evento'];?>" class="btn btn-default">Veja mais!</a>
</p>
</section>
</section>
<?php } while ($row_lista_evento = mysql_fetch_assoc($lista_evento)); ?>
</section>
</section>
</section>
<?php
mysql_free_result($lista_evento);
?>