template_dir = 'templates_jardimamerica'; $smarty->compile_dir = 'templates_jardimamerica_c/'; mysql_connect(HOST, USUARIO, SENHA); mysql_select_db(SCHEMA); $_GET = array_map('strip_tags', $_GET); $_GET = array_map('htmlentities', $_GET); $cim = mysql_real_escape_string(isset($_GET['cim']) ? $_GET['cim'] : ""); /* $sql = sprintf("SELECT mi.codigo_imovel, ba.bairro, mi.valor, mi.qtde_dormitorio, mi.qtde_suite, mi.qtde_vaga_garagem, mi.qtde_sala, mi.qtde_banheiro, ti.tipo, mi.descricao FROM modulo_imovel mi INNER JOIN bairro ba USING(id_bairro) INNER JOIN tipo_imovel ti USING(codigo_tipo) WHERE codigo_imovel = '%s'", $cim); $sql_foto = sprintf("SELECT f.foto FROM foto f INNER JOIN modulo_imovel mi USING(codigo_imovel) WHERE mi.codigo_imovel = '%s'", $cim); */ //$result_foto = mysql_query($sql_foto); /* if (isset($_SESSION['foto'])) { unset($_SESSION['foto']); } $i = 1; $j = 1; $array_total_fotos = array(); while ($i < 6) { $row_foto = mysql_fetch_row($result_foto); if (strlen($row_foto[0]) === 0) { $array_total_fotos[$j++] = "foto"; } else { $_SESSION['foto'][$i++] = $row_foto[0]; } $i++; } $result = mysql_query($sql); $imovel = mysql_fetch_assoc($result); var_dump($array_total_fotos); $smarty->assign("primeira_foto", sprintf("arquivos/%s", $_SESSION['foto'][1])); $smarty->assign("codigo_imovel", $imovel['codigo_imovel']); $smarty->assign("cim", $imovel['codigo_imovel']); $smarty->assign("tipo_imovel", $imovel['tipo']); $smarty->assign("bairro", $imovel['bairro']); $smarty->assign("array_total_fotos", $array_total_fotos); $smarty->assign("valor", money_format("%.2n", $imovel['valor'])); $smarty->assign("qtde_dormitorio", $imovel['qtde_dormitorio']); $smarty->assign("qtde_suite", $imovel['qtde_suite']); $smarty->assign("qtde_vaga_garagem", $imovel['qtde_vaga_garagem']); $smarty->assign("qtde_sala", $imovel['qtde_sala']); $smarty->assign("qtde_banheiro", $imovel['qtde_banheiro']); $smarty->assign("descricao", ucwords(strtolower($imovel['descricao']))); $smarty->display("venda3.htm"); */ ?>