Ir para conteúdo
Fórum Script Brasil

CEBOLA~

Membros
  • Total de itens

    31
  • Registro em

  • Última visita

Posts postados por CEBOLA~

  1. Bom dia pessoal gostaria de uma ajudinha de voces.

    Tenho este sistema de ordem de serviço e gostaria de implementar cadastro de peças.

    - Sendo que ao momento que o usuário cadastrar as peças de estoque fica na tabela a quantidade.

    - Quando o Técnico for fechar a OS ele vai colocar qual peça utilizou para concertar o aparelho.

    - E ao momento que ele colocou a peça, diminuir no estoque a peça utilizada.

    alguém poderia ajudar?

    segue o código abaixo.

    <?php require_once('Connections/data.php'); ?><?php require_once('Connections/data.php'); ?>
    <?php require_once('Connections/data.php'); ?>
    <?php require_once('Connections/data.php'); ?>
    <?php
    if (!isset($_SESSION)) {
      session_start();
    }
    $MM_authorizedUsers = "1";
    $MM_donotCheckaccess = "false";
    
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
      // For security, start by assuming the visitor is NOT authorized. 
      $isValid = False; 
    
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
      // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
      if (!empty($UserName)) { 
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
        // Parse the strings into arrays. 
        $arrUsers = Explode(",", $strUsers); 
        $arrGroups = Explode(",", $strGroups); 
        if (in_array($UserName, $arrUsers)) { 
          $isValid = true; 
        } 
        // Or, you may restrict access to only certain users based on their username. 
        if (in_array($UserGroup, $arrGroups)) { 
          $isValid = true; 
        } 
        if (($strUsers == "") && false) { 
          $isValid = true; 
        } 
      } 
      return $isValid; 
    }
    
    $MM_restrictGoTo = "restrito.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) 
      $MM_referrer .= "?" . $QUERY_STRING;
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo); 
      exit;
    }
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
      $updateSQL = sprintf("UPDATE ordemservico SET Funcionario=%s, Data_Agenda=%s, Hora_Agenda=%s, DiagnosticoTecnico=%s, Solucao=%s, Previsaoentrega=%s, Dataentrega=%s, Recebido=%s, Arquivo=%s, valor=%s WHERE Cod_Equipamento=%s",
                           GetSQLValueString($_POST['Funcionario'], "text"),
                           GetSQLValueString($_POST['Data_Agenda'], "text"),
                           GetSQLValueString($_POST['Hora_Agenda'], "text"),
                           GetSQLValueString($_POST['DiagnosticoTecnico'], "text"),
                           GetSQLValueString($_POST['Solucao'], "text"),
                           GetSQLValueString($_POST['Previsaoentrega'], "text"),
                           GetSQLValueString($_POST['Dataentrega'], "text"),
                           GetSQLValueString($_POST['Recebido'], "text"),
                           GetSQLValueString($_POST['Arquivo'], "text"),
                           GetSQLValueString($_POST['valor'], "text"),
                           GetSQLValueString($_POST['Cod_Equipamento'], "int"));
    
      mysql_select_db($database_data, $data);
      $Result1 = mysql_query($updateSQL, $data) or die(mysql_error());
    
      $updateGoTo = "confirma_print2.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $updateGoTo));
    }
    
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $maxRows_DetailRS1 = 10;
    $pageNum_DetailRS1 = 0;
    if (isset($_GET['pageNum_DetailRS1'])) {
      $pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];
    }
    $startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;
    
    $colname_DetailRS1 = "-1";
    if (isset($_GET['recordID'])) {
      $colname_DetailRS1 = $_GET['recordID'];
    }
    mysql_select_db($database_data, $data);
    $query_DetailRS1 = sprintf("SELECT * FROM ordemservico WHERE Cod_Equipamento = %s", GetSQLValueString($colname_DetailRS1, "int"));
    $query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);
    $DetailRS1 = mysql_query($query_limit_DetailRS1, $data) or die(mysql_error());
    $row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
    
    if (isset($_GET['totalRows_DetailRS1'])) {
      $totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];
    } else {
      $all_DetailRS1 = mysql_query($query_DetailRS1);
      $totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);
    }
    $totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sistema de Ordem de Serviço - Eletrônica brastek</title>
    &lt;script type=text/javascript>
    documentall = document.all;
    /*
    * função para formatação de valores monetários retirada de
    * http://jonasgalvez.com/br/blog/2003-08/egocentrismo
    */
    
    function formatamoney(c) {
        var t = this; if(c == undefined) c = 2;
        var p, d = (t=t.split("."))[1].substr(0, c);
        for(p = (t=t[0]).length; (p-=3) >= 1;) {
                t = t.substr(0,p) + "." + t.substr(p);
        }
        return t+"."+d+Array(c+1-d.length).join(0);
    }
    
    String.prototype.formatCurrency=formatamoney
    
    function demaskvalue(valor, currency){
    /*
    * Se currency é false, retorna o valor sem apenas com os números. Se é true, os dois últimos caracteres são considerados as
    * casas decimais
    */
    var val2 = '';
    var strCheck = '0123456789';
    var len = valor.length;
        if (len== 0){
            return 0.00;
        }
    
        if (currency ==true){
            /* Elimina os zeros à esquerda
            * a variável  <i> passa a ser a localização do primeiro caractere após os zeros e
            * val2 contém os caracteres (descontando os zeros à esquerda)
            */
    
            for(var i = 0; i < len; i++)
                if ((valor.charAt(i) != '0') && (valor.charAt(i) != ',')) break;
    
            for(; i < len; i++){
                if (strCheck.indexOf(valor.charAt(i))!=-1) val2+= valor.charAt(i);
            }
    
            if(val2.length==0) return "0.00";
            if (val2.length==1)return "0.0" + val2;
            if (val2.length==2)return "0." + val2;
    
            var parte1 = val2.substring(0,val2.length-2);
            var parte2 = val2.substring(val2.length-2);
            var returnvalue = parte1 + "." + parte2;
            return returnvalue;
    
        }
        else{
                /* currency é false: retornamos os valores COM os zeros à esquerda,
                * sem considerar os últimos 2 algarismos como casas decimais
                */
                val3 ="";
                for(var k=0; k < len; k++){
                    if (strCheck.indexOf(valor.charAt(k))!=-1) val3+= valor.charAt(k);
                }
        return val3;
        }
    }
    
    function reais(obj,event){
    
    var whichCode = (window.Event) ? event.which : event.keyCode;
    /*
    Executa a formatação após o backspace nos navegadores !document.all
    */
    if (whichCode == 8 && !documentall) {
    /*
    Previne a ação padrão nos navegadores
    */
        if (event.preventDefault){ //standart browsers
                event.preventDefault();
            }else{ // internet explorer
                event.returnValue = false;
        }
        var valor = obj.value;
        var x = valor.substring(0,valor.length-1);
        obj.value= demaskvalue(x,true).formatCurrency();
        return false;
    }
    /*
    Executa o Formata Reais e faz o format currency novamente após o backspace
    */
    FormataReais(obj,'.',',',event);
    } // end reais
    
    
    function backspace(obj,event){
    /*
    Essa função basicamente altera o  backspace nos input com máscara reais para os navegadores IE e opera.
    O IE não detecta o keycode 8 no evento keypress, por isso, tratamos no keydown.
    Como o opera suporta o infame document.all, tratamos dele na mesma parte do código.
    */
    
    var whichCode = (window.Event) ? event.which : event.keyCode;
    if (whichCode == 8 && documentall) {
        var valor = obj.value;
        var x = valor.substring(0,valor.length-1);
        var y = demaskvalue(x,true).formatCurrency();
    
        obj.value =""; //necessário para o opera
        obj.value += y;
    
        if (event.preventDefault){ //standart browsers
                event.preventDefault();
            }else{ // internet explorer
                event.returnValue = false;
        }
        return false;
    
        }// end if
    }// end backspace
    
    function FormataReais(fld, milSep, decSep, e) {
    var sep = 0;
    var key = '';
    var i = j = 0;
    var len = len2 = 0;
    var strCheck = '0123456789';
    var aux = aux2 = '';
    var whichCode = (window.Event) ? e.which : e.keyCode;
    
    //if (whichCode == 8 ) return true; //backspace - estamos tratando disso em outra função no keydown
    if (whichCode == 0 ) return true;
    if (whichCode == 9 ) return true; //tecla tab
    if (whichCode == 13) return true; //tecla enter
    if (whichCode == 16) return true; //shift internet explorer
    if (whichCode == 17) return true; //control no internet explorer
    if (whichCode == 27 ) return true; //tecla esc
    if (whichCode == 34 ) return true; //tecla end
    if (whichCode == 35 ) return true;//tecla end
    if (whichCode == 36 ) return true; //tecla home
    
    /*
    O trecho abaixo previne a ação padrão nos navegadores. Não estamos inserindo o caractere normalmente, mas via script
    */
    
    if (e.preventDefault){ //standart browsers
            e.preventDefault()
        }else{ // internet explorer
            e.returnValue = false
    }
    
    var key = String.fromCharCode(whichCode);  // Valor para o código da Chave
    if (strCheck.indexOf(key) == -1) return false;  // Chave inválida
    
    /*
    Concatenamos ao value o keycode de key, se esse for um número
    */
    fld.value += key;
    
    var len = fld.value.length;
    var bodeaux = demaskvalue(fld.value,true).formatCurrency();
    fld.value=bodeaux;
    
    /*
    Essa parte da função tão somente move o cursor para o final no opera. Atualmente não existe como movê-lo no konqueror.
    */
      if (fld.createTextRange) {
        var range = fld.createTextRange();
        range.collapse(false);
        range.select();
      }
      else if (fld.setSelectionRange) {
        fld.focus();
        var length = fld.value.length;
        fld.setSelectionRange(length, length);
      }
      return false;
    
    }
    </SCRIPT>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    &lt;script>
    
    function formatar(src, mask)
    {
      var i = src.value.length;
      var saida = mask.substring(0,1);
      var texto = mask.substring(i)
    if (texto.substring(0,1) != saida)
      {
            src.value += texto.substring(0,1);
      }
    }
    
    </script>
    &lt;script language="JavaScript">
    <!--
    function muda(qual)
    {
    uCase = qual.value.toUpperCase();
    qual.value = uCase;
    }
    -->
    </script>
    </head>
    
    <body>
    <table width="100%" border="0" cellpadding="0" cellspacing=" 0">
      <tr>
        <td width="15"> </td>
        <td><table border="0" cellspacing="3" cellpadding="0" class="verdana" width="498" >
          <form action="<?php echo $editFormAction;?>" method="POST" name="form1" id="form1">
            <tr>
              <td valign="top" height="40" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="200" valign="top"><b>Técnico:<br />
                              <input name="Funcionario" type="text" id="Funcionario" value="<?php echo $_SESSION['MM_Username']; ?>" />
                              <br />
                  </b></td>
                  <td valign="top"><b>Cliente:<br />
                  </b>              <?php echo $row_DetailRS1['Cliente']; ?><br /></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2"><table width="100%" border="0" cellspacing=" 0" cellpadding="0">
                <tr>
                  <td width="23%"><b>Equipamento:<br />
                  </b><?php echo $row_DetailRS1['Equipamento']; ?><br /></td>
                  <td width="56%"><b>Marca:</b><br />
                    <?php echo $row_DetailRS1['Marca']; ?><br /></td>
                  <td width="21%"><b>Garantia:<br />
                      </b><?php echo $row_DetailRS1['Garantia']; ?><b><br />
                      </b></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2"><b>Modelo:</b><br />
                <?php echo $row_DetailRS1['Modelo']; ?><br />          
                <br /></td>
            </tr>
            <tr>
              <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="28%"><p><b>N. 
                    Patrimonio:<br />
                  </b><?php echo $row_DetailRS1['Patrimonio']; ?><b><br />
                    </b></p></td>
                  <td width="29%"><b>N. 
                    Serie:<br />
                    </b><?php echo $row_DetailRS1['Serie']; ?><b><br />
                    </b></td>
    <td width="43%"><b>Setor:<br />
        </b><?php echo $row_DetailRS1['Setor']; ?><b><br />
        </b></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="17%"><b>Data 
                    Entrada:</b><br />
                    <?php echo $row_DetailRS1['Data_Entrada']; ?><br /></td>
                  <td width="24%"><p><b>Hora 
                    Entrada:<br />
                    </b><?php echo $row_DetailRS1['Hora_Entrada']; ?><b><br />
                    </b></p></td>
                  <td width="45%"><b>Previsão 
                    do Diagnóstico Técnico: <br />
                                          <input name="Data_Agenda" type="text" class="select" id="Data_Agenda" onkeypress="formatar(this, '##/##/####')" size="10" maxlength="10" />
                  </b></td>
                  <td width="14%"><b>Hora: <br />
                              <input name="Hora_Agenda" type="text" class="select" id="Hora_Agenda" size="5" maxlength="5" OnKeyPress="formatar(this, '##:##')"/>
                  </b></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2"><table width="100%" border="0" cellspacing=" 0" cellpadding="0">
                <tr>
                  <td><b>Diagnóstico 
                    do Cliente:</b><br />
                    <?php echo $row_DetailRS1['Problemacliente']; ?><br />
                    <br /><br /></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2"><b>Diagnóstico 
                do Técnico:</b><br />
                              <b>
                              <textarea name="DiagnosticoTecnico" class="select" cols="85" rows="1" onKeyUp="muda(this)"></textarea>
                              </b></td>
            </tr>
            <tr>
              <td colspan="2"><b>Solução:</b><br />
                      <b>
                      <textarea name="Solucao" cols="85" rows="1" class="select" id="Solucao" onKeyUp="muda(this)"></textarea>
                      </b></td>
            </tr>
            <tr>
              <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="29%"><p><b>Previsão 
                    de Entrega: <br />
                    <input type="text" name="Previsaoentrega" class="select" size="10" maxlength="10" onkeypress="formatar(this, '##/##/####')" />
                  </b></p></td>
                  <td width="20%"><b>Data 
                    Entrega : <br />
                                          <input name="Dataentrega" type="text" class="select"  value="" size="10" maxlength="10" onkeypress="formatar(this, '##/##/####')"/>
                  </b></td>
                  <td width="51%"><b>Recebido 
                    por:<br />
                                          <input name="Recebido" type="text" class="select" id="Recebido" size="41" maxlength="150" onKeyUp="muda(this)"/>
                  </b></td>
                </tr>
              </table></td>
            </tr>
            <tr align="right">
              <td height="35" width="228"><div align="left"><b>Valor: 
                R$
                    <input name="valor" type="text" class="fm" id="valor" size="20" onkeypress=reais(this,event) onkeydown=backspace(this,event) />
              </b> </div></td>
              <td height="35" width="295"> </td>
            </tr>
            <tr align="right">
              <td height="35" colspan="2"><input name="Arquivo" type="hidden" id="Arquivo" value="s" />
                <input name="Cod_Equipamento" type="hidden" id="Cod_Equipamento" value="<?php echo $row_DetailRS1['Cod_Equipamento']; ?>" />
                <input type="submit" name="button" id="button" value=" Efetuar Cadastror" />
                <input type="reset" name="button2" id="button2" value="Limpar Cadastro" /></td>
            </tr>
            <input type="hidden" name="MM_update" value="form1" />
          </form>
        </table>
        
          </td>
      </tr>
    </table>
    
    
    
    
    </body>
    </html>
    <?php
    mysql_free_result($DetailRS1);
    
    //mysql_free_result($DetailRS2);
    ?>

  2. Ajuda aqui galera não tenho a minima ideia de com começar e e pra amnha essa lista

    Lista de Exercício de Estrutura de Dados do curso de férias
    
    1.       Fazer uma procedure para receber como entrada o endereço de inicio de uma lista duplamente encadeada e um dado correspondente a um nome de animal. A procedure deve procurar esse nome na lista e, caso não exista, incluído. A lista deve preservar os dados em ordem alfabética.
    
    
    2.       Programe uma procedure que serve como remoção de elementos de dentro de uma pilha.
    Function Top (var P: Pilha) : Elem;
    Begin
    If not IsEmpty (P) then
               Top:= P.memo [P.topo]
    Else
               Writeln ( ‘Stack Underflow’ );
    End;

  3. Bom dia.

    Gostaria de mostrar uma imagem ou até mesmo um background vermeho ou verde.

    sendo vermelho para "estado" PENDENTE e verde para CONCLUIDO.

    Essas linhas do código abaixo que desejo alterar.

    $estado_variavel = $l["estado"]== "PENDENTE" ? "PENDENTE" : "CONCLUIDO";

    <td><center>$estado_variavel</center></td>

    Abaixo mostra uma parte do código.

    <?php
    
    while($l = mysql_fetch_array($resultado)) {
        $id        = $l["id_tabela"];
        $nome_do_colaborador_variavel      = $l["nome_do_colaborador"];
        $numero_do_atendimento_variavel = $l["numero_do_atendimento"];
        $empresa_variavel     = $l["empresa"];
        $sexo      = $l["sexo"] == "M" ? "Masculino" : "Feminino";
        $data_da_solicitacao_variavel     = $l["data_da_solicitacao"];
        $motivo_variavel     = $l["motivo"];
        $solicitante_variavel     = $l["solicitante"];
        $destino_variavel     = $l["destino"];
        $observacao_variavel     = $l["observacao"];
        $estado_variavel     = $l["estado"]== "PENDENTE" ? "PENDENTE" : "CONCLUIDO";
        
    
        
        
        echo"
    
    <div  id='container'>
        <div id='content'>
      <tr>
        <td><center>$id</td>
        <td><center>$nome_do_colaborador_variavel</center></td>
        <td><center>$numero_do_atendimento_variavel</center></td>
        <td><center>$empresa_variavel</center></td>
        <td><center>$sexo</center></td>
        <td><center>$data_da_solicitacao_variavel</center></td>
        <td><center>$motivo_variavel</center></td>
        <td><center>$solicitante_variavel</center></td>
        <td><center>$destino_variavel</center></td>
        <td><center>$observacao_variavel</center></td>
        <td><center>$estado_variavel</center></td>
        <td><center><a href=\"editar.php?id=$id\">[Editar]</a> | <a  href= \"excluir.php?id=$id\" onclick=\"return confirm('Confirma exclusão do colaborador $nome_do_colaborador_variavel?')\">[Excluir]</a></center></td>
      </tr>\n
      
      </div>
      </div>";
    }  
    
    ?>

  4. Bom dia pessoal.

    Gostaria que voces me ajudassem.

    Estou precisando criar um calendario que quando o usuario escolher o ano, dia e mês automatico ele atualizar o textfield com a data selecionada.

  5. Boa noite pessoal.

    gostaria que voces me ajudassem com ideias para a criacao de uma chamada eletronica de pacientes.

    Onde trabalho tem um monte de salas, e tem vários atendimentos, gostaria de colocar uma televisao que apareça a sala e o nome do paciente na tela, logo quando o paciente chega no estabelecimento ele recebi uma senha e logo uma pessoa cadastra ele no banco de dadose na fila de espera. (isso tudo em rede local).

    O meu proposito e riar um sistema que quando o destista por exemplo, estiver desocupado e terminado o atendimento ele clicar em um botao e logo aparecer o nome do paciente de acordo com a ordem da fila (senha).

    isso irá ficar atualizando de segundo em segundo.

    alguém se habilita a uma sugestao?

    abraços

  6. Mais eu quero que só tenha 1 id mais com vários locais repetidos, tipo 100000 locais com mesma data com mesmo horário, mais nunca o id se repetir.

    Então foi isso que você postou?

    No caso quando eu for cadastrar um usuário vou ter que inserir o mesmo local? Sempre cadastrando novamente?

    abraços

  7. Bom dia pessoal.

    Sou no no mundo mysql e gostaria de uma ajudinha de vocês.

    Estou com um problema, como crio um banco que tem o id_usuario como chave primaria, e o resto dos campos ligados a ele e que podem se repetir, exemplo:

    Tem o id do usuário que contém o nome, telefone, endereço, e em quais lojas ele foi e em qual data. Quando executar um select no nome dele mostrar o usuario com todos os lugares que ele freqüentou como mostra abaixo.

    Como crio esta tabela?

    ID    NOME            LOCAL                    DATA
    23     joao              festa                     10/12/2010
    23     joao               casa da irma          12/12/2010
    23     joao            estádio                  15/12/2010

    Abraços

  8. Bom dia, olha ee pedindo uma auda d novo, amigo testei acima e funcionou certo. só que tem um problema alguns usuários tem mais de um pdf com o nome dele, exemplo mariosilva, mariosilva2, mariosilva3, mais só que ele vai digitar mariosilva e só vai mostrar o primeiro pdf que e os segundos, seria melhor se vocês me ajudassem a criar um código que mostre todos .pdf que estão em uma pasta, tipo, se o usuario digitar mariosilva ele direciona para a pasta mariosilva e mostra todos pdf

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <?php
    if(isset($_GET["acao"]))
    {
        $acao = $_GET["acao"];
    }
    if(!isset($acao)){?>
    <form action="/teste/download.php?acao=mostrar" method="post" name="form1" id="form1">
      <p>Nome: 
        <input name="nome" type="text" id="nome" size="60" />
      </p>
      <p>
        <label>
        <input name="Enviar" type="submit" id="Enviar" value="Enviar" />
        </label>
    </p>
    </form>
    <?php
    
    if (isset($acao) && $acao == "mostrar")
    { 
        $nome = $_POST['nome'];
        if(file_exists("$nome.pdf"))
        {
            echo "Certificado: <a href='$nome.pdf'>$nome</a>";
    
        }
        else
        {
            echo "Nome incorreto!";
        }
    }
    }?>
    </body>
    </html>

  9. <link href="tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
    &lt;script type="text/javascript" src="tablecloth/tablecloth.js"></script>
    
    
    
    <style type="text/css">
    body{
        margin-top:0;
        margin:0;
        padding:0;
        background:#f1f1f1;
        font:70% Arial, Helvetica, sans-serif; 
        color:#555;
        line-height:150%;
        text-align:left;
    }
    a{
        text-decoration:none;
        color:#057fac;
    }
    a:hover{
        text-decoration:none;
        color:#999;
    }
    h1{
        font-size:140%;
        margin:0 20px;
        line-height:80px;    
    }
    h2{
        font-size:120%;
    }
    #container{
        margin:0 auto;
        width:680px;
        background:#fff;
        padding-bottom:20px;
    }
    #content{margin:0 20px;}
    p.sig{    
        margin:0 auto;
        width:680px;
        padding:1em 0;
    }
    form{
        margin:1em 0;
        padding:.2em 20px;
        background:#eee;
    }
    </style>
    </head>
    
    <body>
    <table width="1129" style="margin-top:0"  height="88" border="0" align="center" cellspacing="0" cellpadding="0" >
      <tr class="ffff">
        <th height="40" colspan="11" class="zxc">
        
        
        <?php
    if(mysql_num_rows($resultado) < 1) {
        exit;
    }
    
    ?>
    
        
        <strong style="margin-top:0">DOWNLOAD</strong>:<a href="download_DB.php" target="_blank"><img src="imagens/excel.png" width="20" height="20" align="absmiddle" /></a></th>
      </tr>
      <tr class="ffff" id="container">
        <th width="30" height="30" class="zxc"><div align="center">ID</div></th>
        <th width="114"><div align="center">NOME DO COLABORADOR</div></th>
        <th width="108"><div align="center">NÚMERO DO ATENDIMENTO</div></th>
        <th width="68"><div align="center">EMPRESA</div></th>
        <th width="38"><div align="center">SEXO</div></th>
        <th width="99"><div align="center">DATA DA SOLICITAÇAO</div></th>
        <th width="58"><div align="center">MOTIVO</div></th>
        <th width="97"><div align="center">SOLICITANTE</div></th>
        <th width="63"><div align="center">DESTINO</div></th>
        <th width="281"><div align="center">OBSERVAÇÃO</div></th>
        <th width="119"><div align="center">EDITAR / EXCLUIR</div></th>
      </tr>
      
    <?php
    
    while($l = mysql_fetch_array($resultado)) {
        $id        = $l["id_tabela"];
        $nome_do_colaborador_variavel      = $l["nome_do_colaborador"];
        $numero_do_atendimento_variavel = $l["numero_do_atendimento"];
        $empresa_variavel     = $l["empresa"];
        $sexo      = $l["sexo"] == "M" ? "Masculino" : "Feminino";
        $data_da_solicitacao_variavel     = $l["data_da_solicitacao"];
        $motivo_variavel     = $l["motivo"];
        $solicitante_variavel     = $l["solicitante"];
        $destino_variavel     = $l["destino"];
        $observacao_variavel     = $l["observacao"];
        
    
        
        
        echo"
    
    <div  id='container'>
        <div id='content'>
      <tr>
        <td><center>$id</td>
        <td><center>$nome_do_colaborador_variavel</center></td>
        <td><center>$numero_do_atendimento_variavel</center></td>
        <td><center>$empresa_variavel</center></td>
        <td><center>$sexo</center></td>
        <td><center>$data_da_solicitacao_variavel</center></td>
        <td><center>$motivo_variavel</center></td>
        <td><center>$solicitante_variavel</center></td>
        <td><center>$destino_variavel</center></td>
        <td><center>$observacao_variavel</center></td>
        <td><center><a href=\"editar.php?id=$id\">[Editar]</a> | <a  href= \"excluir.php?id=$id\" onclick=\"return confirm('Confirma exclusão do colaborador $nome_do_colaborador_variavel?')\">[Excluir]</a></center></td>
      </tr>\n
      
      </div>
      </div>";
    }  
    
    ?>  
    </table>
    </body>
    </html>

    O código acima qundo cadastro vários colaboradores aparece um espaço em branco no topo da página e assim por diante, quando mais adastro mais aumenta o espaço alguém da uma luz aew porfavor?

    segue a imagem abaixo.

    enviar.jpg

  10. Bom dia.

    gostaria de uma pequena ajuda.

    estou com o código abaixo e gostaria de colocar uma confirmação de exclusão com um "alert" ou algo parecido, pois a exclusão está acontecendo sem se quer ter uma confirmação, já tetei vários códigos na internet e não funciona.

    segue o código abaixo

    <?php
    while($l = mysql_fetch_array($resultado)) {
        $id        = $l["id_tabela"];
        $nome_do_colaborador_variavel      = $l["nome_do_colaborador"];
        $numero_do_atendimento_variavel = $l["numero_do_atendimento"];
        $empresa_variavel     = $l["empresa"];
        $sexo      = $l["sexo"] == "M" ? "Masculino" : "Feminino";
        $data_da_solicitacao_variavel     = $l["data_da_solicitacao"];
        $motivo_variavel     = $l["motivo"];
        $solicitante_variavel     = $l["solicitante"];
        $destino_variavel     = $l["destino"];
        $observacao_variavel     = $l["observacao"];
        
    
        
        
        echo"
      <tr>
        <td>$id</td>
        <td>$nome_do_colaborador_variavel</td>
        <td>$numero_do_atendimento_variavel</td>
        <td>$empresa_variavel</td>
        <td>$sexo</td>
        <td>$data_da_solicitacao_variavel</td>
        <td>$motivo_variavel</td>
        <td>$solicitante_variavel</td>
        <td>$destino_variavel</td>
        <td>$observacao_variavel</td>
        <td><a href=\"editar.php?id=$id\">[Editar]</a> | <a  href= \"excluir.php?id=$id\">[Excluir]</a></td>
      </tr>\n";

  11. alguém poderia me ajudar neste código, ele não aparece o form para inserção do nome e dps o download do pdf com o valor inserido:

    <?php

    $acao = $_GET["acao"];

    if ($acao = ""){ ?>

    <form action=form.php?acao=mostrar" method="post" enctype="manuel" name="form1" id="form1">

    <p>Nome:

    <input name="nome" type="text" id="nome" />

    </p>

    <p>

    <label>

    <input name="Enviar" type="submit" id="Enviar" value="Enviar" />

    </label>

    </p>

    </form>

    <? }

    if ($acao = "mostra"){

    $pagina = $_SERVER['PHP_SELF];

    $nome = $_POST['nome'];

    echo "Estou em: <a href='$pagina/$nome.pfd'>$pagina/$nome.pfd</a>";

    }

    ?>

  12. beuleal, voce é o cara.

    e como faço agora apra colocar o .pdf no final da pagina que abrir?

    echo "Estou em: <a href='$pagina"./."$nome'".pdf;

    assim?

    abraços

    ___

    Vlw beuleal.

    vi sua edicao,

    abraços man.

    precisando estou aqui.

×
×
  • Criar Novo...