Opa
<%
set Conexcao = Server.CreateObject("ADODB.Connection")
Conexcao.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MaPpath("dbsistema.mdb")
Conexcao.open
if NOT (Session("logado")) Then
Response.Redirect "index.asp"
Response.End
End If
cod = Request("cod")
estabelecimento = Request("estabelecimento")
data = Request("data")
acao= Request("acao")
'sId = request("id")
sql = "select * from dados where cod=" & cod
Set rs=Conexcao.Execute(sql)
%>
<html>
<head><title>Sistema NewStyle</title>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
.texto10 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #464646;
}
.texto11 {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: #464646;
}
-->
</style>
<script language="JavaScript">
function FormataValor(campo,tammax,teclapres) {
var tecla = teclapres.keyCode ? teclapres.keyCode : teclapres.which ? teclapres.which : teclapres.charCode;
vr = document.cadastro[campo].value;
vr = vr.replace( "/", "" );
vr = vr.replace( "/", "" );
vr = vr.replace( ",", "" );
vr = vr.replace( ".", "" );
vr = vr.replace( ".", "" );
vr = vr.replace( ".", "" );
vr = vr.replace( ".", "" );
tam = vr.length;
if (tam < tammax && tecla != 8){ tam = vr.length + 1; }
if (tecla == 8 ){ tam = tam - 1; }
if ( tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 ){
if ( tam <= 2 ){
document.cadastro[campo].value = vr; }
if ( (tam > 2) && (tam <= 5) ){
document.cadastro[campo].value = vr.substr( 0, tam - 2 ) + ',' + vr.substr( tam - 2, tam ); }
if ( (tam >= 6) && (tam <= 8) ){
document.cadastro[campo].value = vr.substr( 0, tam - 5 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ); }
if ( (tam >= 9) && (tam <= 11) ){
document.cadastro[campo].value = vr.substr( 0, tam - 8 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ); }
if ( (tam >= 12) && (tam <= 14) ){
document.cadastro[campo].value = vr.substr( 0, tam - 11 ) + '.' + vr.substr( tam - 11, 3 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ); }
if ( (tam >= 15) && (tam <= 17) ){
document.cadastro[campo].value = vr.substr( 0, tam - 14 ) + '.' + vr.substr( tam - 14, 3 ) + '.' + vr.substr( tam - 11, 3 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam );}
}
}
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<img src="topo.jpg">
<p>
<style type="text/css">
<!-- CSS
body {
background-color: #FFFFFF;
}
.texto10 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #464646;
}
.texto11 {
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
color: #464646;
}
-->
</style>
</p>
<p align="center"><span class="texto11">Dados da ação <%=rs("acao")%> do dia <%response.write(data)%></span>
</p>
<center>
<form name="cadastro" method="post" action="nosso_preco_valida.asp">
<p>
<input type="hidden" name="cod" value="<%=cod%>">
<input type="hidden" name="estabelecimento" value="<%=estabelecimento%>">
<input type="hidden" name="data" value="<%=data%>">
<input type="hidden" name="acao" value="<%=acao%>">
</p>
<p><span class="texto11">Nosso preço : </span></p>
<%
MINHAVAR = rs("nosso_produto")
MEUARRAY = SPLIT(MINHAVAR,",") %>
<%
FOR I = LBOUND(MEUARRAY) TO UBOUND(MEUARRAY)
%>
<%IF TRIM(MEUARRAY(I)) <> "" THEN%>
<table width="457" border="1" bordercolor="#00CCFF">
<tr>
<td width="70"><span class="texto10">Produto:</span></td>
<td width="175"><span class="texto10">
<input name="produto" id="produto" type="text" value="<%=(MEUARRAY(I))%>" readonly="readonly">
</span></td>
<td><span class="texto10">Preço :</span></td>
<td><input name="preço" type="text" id="preço" onKeyDown="FormataValor('preço', 13, event)"></td>
</tr></table> <%END IF%>
<%NEXT%>
<p>
</p>
<p><span class="texto11">Preço da concorrencia: </span></p>
<%
MINHAVAR = rs("concorrente_produto")
MEUARRAY = SPLIT(MINHAVAR,",") %>
<%
FOR I = LBOUND(MEUARRAY) TO UBOUND(MEUARRAY)
%>
<%IF TRIM(MEUARRAY(I)) <> "" THEN%>
<table width="457" border="1" bordercolor="#00CCFF">
<tr>
<td width="70"><span class="texto10">Produto:</span></td>
<td width="175"><span class="texto10">
<input name="produto_con" id="produto_con" type="text" value="<%=(MEUARRAY(I))%>" readonly="readonly">
</span></td>
<td><span class="texto10">Preço :</span></td>
<td><input name="preco_con" type="text" id="preco_con"></td>
</tr></table> <%END IF%>
<%NEXT%>
<br>
<input type="submit" name="Submit" value="Enviar">
</form>
</center>
<center><p> </p>
<p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="50" height="50">
<param name="movie" value="voltar4.swf">
<param name="quality" value="high">
<embed src="voltar4.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="50" height="50"></embed>
</object>
<br>
</p>
</center>
<p><img src="imagens/rodape.gif" width="779" height="44"></p>
</body>
</html>
Obrigado