Ir para conteúdo
Fórum Script Brasil

Tenko

Membros
  • Total de itens

    638
  • Registro em

  • Última visita

Posts postados por Tenko

  1. Boa tarde, não crie uma conexão em cada página.

    Crie um arquivo de conexão : conexao.php

    <?php

    $conexao = mysql_connect('localhost','$nome');

    $sBase = mysql_select_db('banco',$conexao);

    ?>

    E nas outras párinas você coloca no topo delas o include deste arquivo de conexão

    <?php

    include 'conexao.php';

    ?>

  2. Boa tarde.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

    "http://www.w3.org/TR/html4/loose.dtd">

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <title>teste</title>

    <script>

    function muda(oObj){

    oObj.className = ( oObj.className == 'btSeguir' ) ? 'btNSeguir' : 'btSeguir' ;

    oObj.innerHTML = ( oObj.className == 'btSeguir' ) ? 'Seguir' : 'Seguindo' ;

    }

    </script>

    <style>

    .btSeguir{

    font-family: Verdana, Arial, Helvetica, sans-serif;

    font-size: 11px;

    font-style: normal;

    line-height: normal;

    font-weight: bold;

    font-variant: normal;

    text-transform: capitalize;

    color: #000000;

    text-align: center;

    vertical-align: middle;

    height: 25px;

    width:10%;

    border: 1px dashed #000000;

    cursor:pointer;

    }

    .btNSeguir{

    font-family: Verdana, Arial, Helvetica, sans-serif;

    font-size: 11px;

    font-style: normal;

    line-height: normal;

    font-weight: bold;

    font-variant: normal;

    text-transform: capitalize;

    color: #0066CC;

    text-align: center;

    vertical-align: middle;

    height: 25px;

    width:10%;

    border: 1px dashed #000000;

    background-color: #DDF4FF;

    cursor:pointer;

    }

    </style>

    </head>

    <body>

    <button class="btSeguir" onClick="muda(this);">Seguir</button>

    </body>

    </html>

  3. Boa tarde

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <title>teste</title>

    <script>

    // O modo mais simples pra você entender

    function mostra(){

    var modo = document.getElementById('t1').style.display;

    if( modo == 'none' ) {

    document.getElementById('t1').style.display = 'block';

    document.getElementById('acao').value = '-';

    } else {

    document.getElementById('t1').style.display = 'none';

    document.getElementById('acao').value = '+';

    }

    }

    </script>

    </head>

    <body>

    <input type="button" value="+" id="acao" onClick="java script:mostra();">

    <br/>

    <br/>

    <div id="t1" style="display:none; border:1px solid #000000; width:100%">

    Esse é um teste

    </div>

    </body>

    </html>

  4. Boa tarde

    Na tabela tbl_funcionario supostamente você de ter o ID do funcionário, certo?

    Então na sua tabela de ponto, seria +ou- isso

    tbl_ponto

    id_funcionario int,

    Horário de chegada datetime,

    Horário de saída para almoço datetime,

    Horário de chegada do almoço datetime,

    horário de saída datetime

    Mas é melhor você dar uma olhada nesta estrutura.

    Da pra melhorar

  5. Bom dia.

    Vê se seria isso:

    <html>
        <head>
            <title></title>
            
            &lt;script>
            function pegaElementos()
            {
                var oElementos  = document.getElementsByTagName('input');
                var iElementos  = oElementos.length;
                var sBusca      = 'imagem[]';
                var sValores    = '';
    
                for( var i = 0; i < iElementos; i++ )
                {
                    if( oElementos[ i ].type == 'text' )
                    {
                        if( oElementos[ i ].name == sBusca )
                        {
                            sValores += ' ' + oElementos[ i ].value;
                        }
                    }
                }
                
                alert( sValores )
            }
            </script>
            
        </head>
        
        <body>
        
        <input type="text" name="imagem[]" id="img" value="1"></br>
        <input type="text" name="imagem[]" id="img" value="2"></br>
        <input type="text" name="imagem[]" id="img" value="3"></br>
        <input type="text" name="imagem[]" id="img" value="4"></br>
        
        <input type="button" value="pegar elementos" onclick="pegaElementos()">
        
        </body>
    </html>

  6. Boa tarde.

    O comando \n realmente faz a quebra de linhas, se você esta abrindo o arquivo pelo bloco de notas, tente ver aparece o caracter [], isso indica que tem um caracter especial ali.

    Tente abrir o arquivo pelo Wordpad, assim ele diz se existe ou não a quebra

  7. <?php

    $sHtml = "<table width='120' border='0' bgcolor=''>";

    $busca2 = mysql_query("SELECT * FROM produtos ORDER BY codigo desc LIMIT 8") or die ("Erro ao realizar a busca <br>" . mysql_error());

    $a = 1;

    //recebe os dados e insere no vetor reg

    while ($reg2 = mysql_fetch_assoc($busca2))

    {

    //definindo a cor da tabela

    if ($a % 2 == 0) {

    $cor = "#F2F2F2";

    } else {

    $cor = "#FFFFFF";

    }

    $sHtml .= "<tr bgcolor='{$cor}'>

    <td align='center' class='texto1'><span class='texto2'>{$reg2['descricao']}</span></td>

    <td align=center' valign='middle'><img src='admin/imagens/produtos/{$reg2['imagem_mini]}' width='100' height='100'></td>

    <td align='center' class='texto2'>{$reg2['preco_venda']}</td>

    </tr>";

    $a++;

    }

    $sHtml.= '</table>';

    echo $sHtml;

    ?>

  8. function concatenar() {
    var nome = document.getElementById('nome');
    var endereco = document.getElementById('endereco');
    var texto = document.getElementById('texto');
    document.getElementById('pegardados').value = "##*##" + nome + "&" + endereco + "&" + texto + "**#**";
    
    document.write.submit()
    }
    
    
    <input type="hidden" name="pegardados" id="pegardados" value="RESULTADO">

  9. <html>
        <head>
            <title></title>
            
            <script>
            var d = document;
    
            function $( bloco )
            {
                return d.getElementById( bloco );
            }
    
            function validaprodutoadcionado(form)
            {
                if($('novo_preco').value == "" )
                {
                    alert("Preencha o campo Preço: campo obrigatório!!!");
                    $('novo_preco').focus();
                    return (false);
                }
                if($('imposto').value == "" )
                {
                    alert("Preencha o campo Imposto: campo obrigatório!!!");
                    $('imposto').focus();
                    return (false);
                }
    
                $( form ).submit();
            }
            </script>
            
        </head>
        
        <body>
        
        <form id="teste">
            <input type="text" name="novo_preco" id="novo_preco" value=""/>
            <br/>
            <input type="text" name="imposto" id="imposto" value=""/>
            <br/>        
            <input type="button" value="Validar" onclick="validaprodutoadcionado('teste')";?>
            
        </form>
        
        </body>
    </html>

×
×
  • Criar Novo...