Ir para conteúdo
Fórum Script Brasil

Marcos-rj

Membros
  • Total de itens

    638
  • Registro em

  • Última visita

Posts postados por Marcos-rj

  1. Para pop-up uso esse codigo.

    java script:window.open('pagina.asp','Codigo','toolbar=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=no,width=440,height=365');void(0);"

    bem simples!

  2. Bom galera, p/ quem precisa. segue ai o exemplo p/ calculo de juros compostos.

    é so colocar o valor, nº de pacelas, nº de parcelas com juros e o juros a.m.

    já montei numa tabela, so copiar e colar.

    <%
    'calcula o valor de cada parcela, e em quantas vezes o produto poderá ser parcelado e com quantas parcelas
    'possui juros, e quantas não possui.
    x = "2.550,00" 'Valor do Produto
    y = "12" 'Nº total de Parcelas
    cjuros = "0,05" 'Juros Cobrado a.m
    juros = "6" -1 +1 'Nº de Parcela C/ Juros
    %>
    <table border="0" width="200"cellspacing="1" cellpadding="0" bgcolor="#F2F2F2">
        <tr>
            <td width="197" align="center" colspan="3">
            <p align="left"><b><font face="Verdana" size="2">Parcelamento</font></b></td>
        </tr>
    <%
    For i = 1 To y
    If (i-1) = Round(y/2,0) Then
    End If
    %>
        <tr>
            <td width="38"><font face="Verdana" size="2"><%=i%> x</font></td>
            <td width="90"><font face="Verdana" size="2"><%If juros > i Or juros = 0 Then valor = FormatCurrency(Round(x/i,1),2) else valor = FormatCurrency(x * (cjuros * (1+cjuros)^ i) / ((1+cjuros)^ i -1))%><%=valor%></font></td>
            <td width="67"><font face="Verdana" size="2"><%If juros > i Or juros = 0 Then juro = "sem juros" Else juro = "<font color='#FF0000'>com juros</font>"%><%=juro%></font></td>
        </tr>
    <%Next%>
    </table>

  3. alguém ai tem a formula p/ calculo de juros compostos?

    já tentei de varias maneiras mas não rola!

    tipo:

    pv = "550,00" 'valor

    i = "0.10" 'juros

    n = "6" 'parcelas

    pmt = pv * i (1+i)^ n / (1+i)^ n -1

    mas também não rola! :blink:

    valeu. conse gui resolver.

    pv = "10,00"

    i = "0,10"

    n = "2"

    pmt = pv * (i * (1+i)^ n) / ((1+i)^ n -1)

  4. Eu uso assim e funciona:

    <script>
    //Verificar se a resolução vídeo for > 800 X 600
    if(screen.width > 800)
    {
        document.write ('<div id=floater style="position:absolute; left:790px; top:5px">')
        document.write ('<form name="frm"><iframe name="topo" id="topo" src="barra_lateral.asp" framespacing="0" frameborder="no" scrolling="no" width="180" height="700" allowtransparency="true" marginwidth="0" marginheight="0">')
        document.write ('</iframe></form>')
        document.write ('</div>');
        
    }
    </SCRIPT>

  5. tenta assim:

    <!--#include file="conecta_banco.asp"-->
    <% set listar = server.CreateObject("ADODB.Recordset")
    listar.open "Select * from socios where mostrar='sim' order by nome asc",conexao
    
    <%dim conta%>
    <table border = 0 align="center" cellpadding="2" cellspacing="2" bordercolor="#000000">
    
    <%If listar.EOF or listar.BOF Then%>
    
    NENHUM RESGISTRO ENCONTRADO!
    
    <%
    else
    do while not listar.eof%>
    <%for conta = 1 to contador step 1%>
    <% 'aqui vem a tabela com os dados, o for serve para dividir em linhas e colunas.%>
    
    .....
    .....
    
    <%if conta mod 2 = 0 then%>
    <tr>
    <%end if%>
    
    <%listar.movenext%><%next%><%loop%>
    </table> 
    </body>
    </html>
    <%end if
    end if%>

  6. O arquivo global.asa você tem que salvar na raiz do site.

    segue um código que uso p/ mostrar os usuarios online.

    usuarios_online.asp

    <%
    Sub LogNewUser
                Dim strUserList
                Dim intUserStart, intUserEnd
                Dim strUser
                Dim strDate
    
                strUserList = Application("UserList")
    
            If Instr(1, strUserList, Session.SessionID) > 0 Then
                Application.Lock
                intUserStart = Instr(1, strUserList, Session.SessionID)
                intUserEnd = Instr(intUserStart, strUserList, "|")
                strUser = Mid(strUserList, intUserStart, intUserEnd - intUserStart)
                strUserList = Replace(strUserList, strUser, Session.SessionID & ":" & Now())
                Application("UserList") = strUserList
                Application.UnLock
            Else
                Application.Lock
                Application("ActiveUsers") = CInt(Application("ActiveUsers")) + 1
                Application("UserList") = Application("UserList") & Session.SessionID & ":" & Now() & "|"
                Application.UnLock
            End If
    End Sub
    
    
    'Cleans up the user count so that the script can read the user details from it...
    
    Sub ActiveUserCleanup
    Dim ix
    Dim intUsers
    Dim strUserList
    Dim aActiveUsers
    Dim intActiveUserCleanupTime
    Dim intActiveUserTimeout
    
    intActiveUserCleanupTime = 1 'In minutes, how often should the UserList be cleaned up.
    intActiveUserTimeout = 20 'In minutes, how long before a User is considered Inactive and is deleted from UserList
    
    If Application("UserList") = "" Then Exit Sub
    
    If DateDiff("n", Application("ActiveUsersLastCleanup"), Now()) > intActiveUserCleanupTime Then
    
        Application.Lock
        Application("ActiveUsersLastCleanup") = Now()
        Application.Unlock
    
        intUsers = 0
        strUserList = Application("UserList")
        strUserList = Left(strUserList, Len(strUserList) - 1)
    
        aActiveUsers = Split(strUserList, "|")
    
    For ix = 0 To UBound(aActiveUsers)
        If DateDiff("n", Mid(aActiveUsers(ix), Instr(1, aActiveUsers(ix), ":") + 1, Len(aActiveUsers(ix))), Now()) > intActiveUserTimeout Then
            aActiveUsers(ix) = "XXXX"
        Else
            intUsers = intUsers + 1
        End If 
    Next
    
    strUserList = Join(aActiveUsers, "|") & "|"
    strUserList = Replace(strUserList, "XXXX|", "")
    
        Application.Lock
        Application("UserList") = strUserList
        Application("ActiveUsers") = intUsers
        Application.UnLock
    
    End If
    
    End Sub
    
    
    ' Shows the amount of users surfing the site
    
    Call LogNewUser()
    Call ActiveUserCleanup()
    
    Response.Write Application("ActiveUsers")
    
    %> 
    e no local onde você quiser exibir o nº de usuarios coloca:
    <!--#include file="usuarios_online.asp"-->

  7. Oi, vou postar um código que achei na net. Prompt de comando + ASP

    Public Function Ping(IP) 
    
    Dim WshShell, oExec 
    Set WshShell = CreateObject("WScript.Shell") 
    
    Set oExec = WshShell.Exec("ping " & IP) [COLOR=#008800]'<-Comando do DOS [/COLOR]
    
    If Not oExec.StdOut.AtEndOfStream Then 
    sText = sText & oExec.StdOut.ReadAll() 
    End If 
    Response.write(sText) 
    End Function 
    
    [COLOR=#008800]'Chama a função passando o ip ou nome do computador [/COLOR]
    Call ping("127.0.0.1") 

    um exemplo de pingar um host ou servidor em uma rede através de uma página ASP.

    acho que em cima disso ai você pode fazer o que está querendo.

  8. Vou te dar uma idéia por que você não faz diferente, pega o que vem depois da / ?

    tipo:

    option explicit
    response.addHeader "pragma", "no-cache"
    response.cacheControl="private"
    response.expires=0
    
    link = lcase(request.servervariables("HTTP_HOST"))
    link = right(link,instr(strreverse(link),"/") - 1)
    
    select case link
    
    case "adm"
    response.redirect "pasta1/adm"
    
    Case Else
    response.redirect "pasta1/"
    
    end select 

    montei agora , testa ai e vê se rola!

×
×
  • Criar Novo...