<?php
ob_start();
session_start();
include_once('class/class.mysql.php');
include_once('include/utilitarios.php');
include_once('salao_igreja/class.salao_igreja.php');
include_once('evento/class.evento.php');

$mysqlCom = new MysqlConnect();
extract($_GET);
$id_empresa = $_SESSION["fild_id_empresa"];
$Local = new SalaoIgreja();
$Evento = new Evento();

$Evento->Select($id);

while ($row = mysqli_fetch_object($Evento->qry)) {
	$nome 		 = $row->nome;
	$tipo_evento = $row->tipo_evento;
	$data   	 = $row->data_evento;
	$hora		 = $row->hora;
	$tel_residencial	 = $row->tel_residencial;
	$tel_comercial	 = $row->tel_comercial;
	$tel_celular	 = $row->tel_celular;
}




$id_salao_evento = 0;
$id_salao_festa = 0;

$sql = "SELECT id_salao_igreja FROM evento_local_evento
 		where id_evento = $id
		and id_empresa = $id_empresa";
$qry = mysqli_query($mysqlCom->connect(), $sql);

while ($row = mysqli_fetch_object($qry))
	$id_salao_evento = $row->id_salao_igreja;




$sql = "SELECT id_salao_igreja FROM evento_local_festa
 		where id_evento = $id
		and id_empresa = $id_empresa";
$qry = mysqli_query($mysqlCom->connect(), $sql);

while ($row = mysqli_fetch_object($qry))
	$id_salao_festa = $row->id_salao_igreja;

?>

<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Endereço do Evento</title>
	<style>
		.desc {
			float: left;
			width: 150px;
			text-align: right;
			margin-right: 10px;
			padding: 3px;
			clear: both;
		}

		.dados {
			padding: 4px;
		}

		.pnPrin {
			width: 600px;
			border: 1px solid #CCC;
			margin-left: 20px;
			margin-bottom: 15px;
			clear: both;
		}

		.can {
			clear: both;
		}
	</style>
</head>

<body>
	<table width="780" border="0">
		<tr>
			<td colspan="6" align="center">Dados do Evento</td>
		</tr>
		<tr>
			<td width="153" align="right">Nome</td>
			<td width="27">&nbsp;</td>
			<td colspan="2"><strong><?php echo $nome ?></strong></td>
			<td colspan="2"><?php echo $tipo_evento ?></td>
		</tr>
		<tr>
			<td align="right">Data </td>
			<td>&nbsp;</td>
			<td width="132"><?php echo $data ?></td>
			<td width="124" align="right">Hora</td>
			<td width="16">&nbsp;</td>
			<td width="302"><strong><?php echo $hora ?></strong></td>
		</tr>
		<tr>
			<td align="right">Telefones</td>
			<td>&nbsp;</td>
			<td><?php echo $tel_celular ?></td>
			<td align="left"><?php echo $tel_comercial ?></td>
			<td>&nbsp;</td>
			<td><?php echo $tel_residencial ?></td>
		</tr>
	</table>
	<br />

	<div class="pnPrin"><strong>Local do Evento</strong>
		<div class="can"></div>
		<?php
		if ($id_salao_evento != '0') {
			$Local->Select($id_salao_evento);
			echo 'Chico';
			while ($row = mysqli_fetch_object($Local->qry)) {
		?>
				<div class="desc">Nome</div>
				<div class="dados"><?php echo $row->nome; ?></div>
				<div class="desc">Telefone</div>
				<div class="dados"><?php echo $row->telefone; ?></div>
				<div class="desc">Endereco</div>
				<div class="dados"><?php echo $row->endereco; ?></div>
				<div class="desc">Bairro</div>
				<div class="dados"><?php echo $row->bairro; ?></div>
				<div class="desc">Cidade</div>
				<div class="dados">.<?php echo $row->Cidade; ?></div>
				<div class="desc">obs</div>
				<div class="dados">.<?php echo $row->obs; ?></div>
		<?php }
		} ?>

	</div>
	<div class="can"></div>

	<div class="pnPrin"><strong>Local do Festa</strong>
		<div class="can"></div>
		<?php
		if ($id_salao_festa != '0') {
			$Local->Select($id_salao_festa);
			while ($row = mysqli_fetch_object($Local->qry)) {
		?>
				<div class="desc">Nome</div>
				<div class="dados"><?php echo $row->nome; ?></div>
				<div class="desc">Telefone</div>
				<div class="dados"><?php echo $row->telefone; ?></div>
				<div class="desc">Endereco</div>
				<div class="dados"><?php echo $row->endereco; ?></div>
				<div class="desc">Bairro</div>
				<div class="dados"><?php echo $row->bairro; ?></div>
				<div class="desc">Cidade</div>
				<div class="dados"><?php echo $row->Cidade; ?>.</div>
				<div class="desc">obs</div>
				<div class="dados"><?php echo $row->obs; ?>.</div>
		<?php }
		} ?>

	</div>
	<div class="can"></div>


</body>

</html>