insereimovel.asp
<!--#include file="../includes/config.asp"--> <!--#include file="../includes/abrebanco2.asp"--> <!--#include file="travar.asp"--> <title><%=titulo%></title> <body bgcolor="<%=fundo%>" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <link href="<%=local%>includes/styles/link.css" rel="stylesheet" type="text/css"> <table width="778" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <!--#include file="../includes/barraadm.asp"--> </td> </tr> <tr> <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="159" height="249" valign="top"> <!--#include file="../includes/menuesqadm.asp"--> </td> <td width="60%" valign="top"><table width="97%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td><%=fonte02%><b>Inserir fotos do imovel</b></td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"><form action="insereimovel2.asp" method="post" enctype="multipart/form-data" name="fotos"> <table width="82%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="21%"><%=fonte02%>Foto 1:</td> <td width="79%"><input name="f_foto1" type="file" id="f_foto1"></td> </tr> <tr> <td><%=fonte02%>Foto 2:</td> <td><input name="f_foto2" type="file" id="f_foto2"></td> </tr> <tr> <td><%=fonte02%>Foto 3:</td> <td><input name="f_foto3" type="file" id="f_foto3"></td> </tr> <tr> <td><%=fonte02%>Foto 4:</td> <td><input name="f_foto4" type="file" id="f_foto4"></td> </tr> <tr> <td><%=fonte02%>Foto 5:</td> <td><input name="f_foto5" type="file" id="f_foto5"></td> </tr> <tr> <td colspan="2"><div align="left"> <input type="submit" name="Submit" value="Inserir foto"> </div></td> </tr> </table> </form> </td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"><%=fonte01%><a href="java script:window.history.go(-1)">Voltar</a></div></td> </tr> <tr> <td> </td> </tr> </table></td> <td width="154" valign="top"> <!--#include file="../includes/menudiradm.asp"--> </td> </tr> </table></td> </tr> <tr> <td><!--#include file="../includes/rodapeadm.asp"--></td> </tr> </table> </body> <!--#include file="../includes/fechabanco.asp"-->
insereimovel2.asp
<!--#include file="../includes/config.asp"--> <!--#include file="../includes/abrebanco2.asp"--> <!--#include file="travar.asp"--> <% sql = "SELECT * FROM categorias" sql2 = "SELECT * FROM tipos" sql3 = "SELECT * FROM locais" Set exe = banco.execute(sql) Set exe2 = banco.execute(sql2) Set exe3 = banco.execute(sql3) %> <title><%=titulo%></title> <body bgcolor="<%=fundo%>" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <link href="<%=local%>includes/styles/link.css" rel="stylesheet" type="text/css"> <table width="778" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <!--#include file="../includes/barraadm.asp"--> </td> </tr> <tr> <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="159" height="1006" valign="top"> <!--#include file="../includes/menuesqadm.asp"--> </td> <td width="60%" valign="top"><table width="97%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <% On Error Resume Next Set Upload = server.CreateObject("Dundas.Upload.2") Upload.UseVirtualDir = True Upload.UseUniqueNames = False Upload.Save caminho if Upload.Files.Count = 1 then origName1 = Upload.GetFileName(Upload.Files(0).Path) elseif Upload.Files.Count = 2 then origName1 = Upload.GetFileName(Upload.Files(0).Path) origName2 = Upload.GetFileName(Upload.Files(1).Path) elseif Upload.Files.Count = 3 then origName1 = Upload.GetFileName(Upload.Files(0).Path) origName2 = Upload.GetFileName(Upload.Files(1).Path) origName3 = Upload.GetFileName(Upload.Files(2).Path) elseif Upload.Files.Count = 4 then origName1 = Upload.GetFileName(Upload.Files(0).Path) origName2 = Upload.GetFileName(Upload.Files(1).Path) origName3 = Upload.GetFileName(Upload.Files(2).Path) origName4 = Upload.GetFileName(Upload.Files(3).Path) elseif Upload.Files.Count = 5 then origName1 = Upload.GetFileName(Upload.Files(0).Path) origName2 = Upload.GetFileName(Upload.Files(1).Path) origName3 = Upload.GetFileName(Upload.Files(2).Path) origName4 = Upload.GetFileName(Upload.Files(3).Path) origName5 = Upload.GetFileName(Upload.Files(4).Path) else end if Set Upload = nothing If Err <> 0 Then Response.Write Err.Description & " " & Err.Number & "<br>" Response.Write fonte02 & "<b>Houve erro(s) ao carregar o(s) arquivo(s) anexado(s)!<br><a href=java script:history.back(-1)>Voltar</a></b>" Else %> <form action="posinsereimovel.asp" method="post"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr align="left"> <td colspan="2"> </td> </tr> <tr align="left"> <td colspan="2"><%=fonte02%><strong>Inserir imóvel</strong></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><div align="center"> <table> <%IF origName1 = "" Then Response.Write "" ELSE Response.Write "<tr><td><img src="&local&"/imagens/fotos/"&origName1&"></td></tr><tr><td>"&fonte02&"Nome:* <input type=text name=f_desc1><input type=hidden name=f_foto1 value="&local&"imagens/fotos/"&origName1&">"&fonte02&" Ex: Fachada</td></tr><tr><td> </td></tr>" END IF%> <%IF origName2 = "" Then Response.Write "" ELSE Response.Write "<tr><td><img src="&local&"/imagens/fotos/"&origName2&"></td></tr><tr><td>"&fonte02&"Nome:* <input type=text name=f_desc2><input type=hidden name=f_foto2 value="&local&"imagens/fotos/"&origName2&">"&fonte02&" Ex: Fachada</td></tr><tr><td> </td></tr>" END IF%> <%IF origName3 = "" Then Response.Write "" ELSE Response.Write "<tr><td><img src="&local&"/imagens/fotos/"&origName3&"></td></tr><tr><td>"&fonte02&"Nome:* <input type=text name=f_desc3><input type=hidden name=f_foto3 value="&local&"imagens/fotos/"&origName3&">"&fonte02&" Ex: Fachada</td></tr><tr><td> </td></tr>" END IF%> <%IF origName4 = "" Then Response.Write "" ELSE Response.Write "<tr><td><img src="&local&"/imagens/fotos/"&origName4&"></td></tr><tr><td>"&fonte02&"Nome:* <input type=text name=f_desc4><input type=hidden name=f_foto4 value="&local&"imagens/fotos/"&origName4&">"&fonte02&" Ex: Fachada</td></tr><tr><td> </td></tr>" END IF%> <%IF origName5 = "" Then Response.Write "" ELSE Response.Write "<tr><td><img src="&local&"/imagens/fotos/"&origName5&"></td></tr><tr><td>"&fonte02&"Nome:* <input type=text name=f_desc5><input type=hidden name=f_foto5 value="&local&"imagens/fotos/"&origName5&">"&fonte02&" Ex: Fachada</td></tr><tr><td> </td></tr>" END IF%> </table> </div></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><div align="center"><font color="#FF0000" size="1" face="verdana">*Campos obrigatórios</font></div></td> </tr> <tr bgcolor="<%=tit_fundo%>"> <td colspan="2"><div align="center"><%=fonte04%><strong>Dados</strong></div></td> </tr> <tr> <td width="27%"><%=fonte02%>Categoria:*</td> <td width="73%"><select name="f_categoria" size="1" id="f_categoria"> <option selected>-------------------</option> <%WHILE NOT exe.eof Response.Write "<option>" & exe("categoria") & "</option>" exe.MOVENEXT : Wend%> </select></td> </tr> <tr> <td><%=fonte02%>Tipo:*</td> <td><select name="f_tipo" size="1" id="f_tipo"> <option selected>------------</option> <%WHILE NOT exe2.eof Response.Write "<option>" & exe2("tipo") & "</option>" exe2.MOVENEXT : Wend%> </select></td> </tr> <tr> <td><%=fonte02%>Local:*</td> <td><select name="f_local" size="1" id="f_local"> <option selected>----------------------</option> <%WHILE NOT exe3.eof Response.Write "<option>" & exe3("local") & "</option>" exe3.MOVENEXT : Wend%> </select></td> </tr> <tr> <td><%=fonte02%>Edifício:</td> <td><input name="f_edificio" type="text" id="f_edificio"></td> </tr> <tr> <td><%=fonte02%>Endereço:*</td> <td><textarea name="f_endereco" id="f_endereco"></textarea></td> </tr> <tr> <td><%=fonte02%>Número:</td> <td><input name="f_numero" type="text" id="f_numero"></td> </tr> <tr> <td><%=fonte02%>Andar:</td> <td><input name="f_andar" type="text" id="f_andar"></td> </tr> <tr> <td><%=fonte02%>Apto:</td> <td><input name="f_apto" type="text" id="f_apto"></td> </tr> <tr> <td><%=fonte02%>Área:*</td> <td><input name="f_area" type="text" id="f_area"></td> </tr> <tr> <td><%=fonte02%>Dormitórios:*</td> <td><input name="f_dormitorios" type="text" id="f_dormitorios"></td> </tr> <tr> <td><%=fonte02%>Sendo Suítes:</td> <td><input name="f_suites" type="text" id="f_suites"></td> </tr> <tr> <td><%=fonte02%>Preço:*</td> <td><input name="f_preco" type="text" id="f_preco"></td> </tr> <tr> <td><%=fonte02%>Condições de Pagamento:</td> <td><textarea name="f_condicoes" id="f_condicoes"></textarea></td> </tr> <tr> <td><%=fonte02%>Fase da Obra:</td> <td><input name="f_fase" type="text" id="f_fase"></td> </tr> <tr> <td><%=fonte02%>Descrição:*</td> <td><textarea name="f_descricao" id="f_descricao"></textarea></td> </tr> <tr> <td><%=fonte02%>Texto em destaque:*</td> <td><textarea name="f_destaque" id="f_destaque"></textarea></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><div align="center"> <input name="Limpar" type="reset" id="Limpar" value="Limpar"> <input name="Inserir" type="submit" id="Inserir" value="Inserir"> </div></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><div align="center"><%=fonte01%><a href="java script:window.history.go(-1)">Voltar</a></div></td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </form> <%END IF%> </td> </tr> </table> </td> <td width="154" valign="top"> <!--#include file="../includes/menudiradm.asp"--> </td> </tr> </table></td> </tr> <tr> <td><!--#include file="../includes/rodapeadm.asp"--></td> </tr> </table> </body> <!--#include file="../includes/fechabanco.asp"-->
Agradeço desde ja a ajuda!
Edição feita por: DarkSign, 25/05/2009, 16:52.
[code] para codigos