Jump to content


ooooBR

Member Since 14/08/2011
Offline Last Active 08/09/2011, 15:58
-----

Topics I've Started

Exibir Dados Selecionados Pelo Perfil Do Usuario

29/08/2011, 08:21

bom dia, bom não sei bem como isso deve ser feito, ou se é dessa forma, vamos ao problema... eu tenho uma pagina que exibe tudo que está na bd, porém eu gostaria de especificar o assunto atravez de um campo no cadastro do usuario...

por exemplo verificar o campo, e comparar... o código que exibe as mensagens é esse
mysql_select_db($database_data, $data);
$query_Recordset1 = "SELECT * FROM ordemservico WHERE Arquivo = 'n'";

por exemplo o setor, se no cadastro do usuario o campo estiver preenchido compras no setor, só mostra as mensagens do setor compras!!! ou se alguém soube uma forma de selecionar o conteudo dessa meneira, pode sugerir!!!

Combo Dinamico Não Salva Dado Na Tabela

27/08/2011, 10:47

bom dia pessoal, estou com o seguinte problema... todos os campos preenchidos vão pra tabela, mais o do combo select fica em branco, segue os códigos do projeto!



codigo do combo


                <select name="setor">

    <option value="0">Selecione...</option>

          <?php

                   include'Connections/data.php';



                    $sql ="select * from setor order by setor asc";

                    $dados = mysql_query($sql);

                    while($linha = mysql_fetch_array($dados)){

                          $id    = $linha["idSetor"];

                          $valor = $linha["valor"];

                          $setor = $linha["setor"];



                          echo "<option value='$id'>$setor $valor</option> ";



                  if (isset ($id) or ($valor) or ($setor)){

                         echo "Não há registros cadastrados";

                  }

             }

?>

                </select>



onde inseri os campos na tabela


$insertSQL = sprintf("INSERT INTO ordemservico (Remetente, Data_Entrada, Hora_Entrada, setor) VALUES (%s, %s, %s, %s)",

                       GetSQLValueString($_POST['Remetente'], "text"),

                       GetSQLValueString($_POST['Data_Entrada'], "text"),

                       GetSQLValueString($_POST['Hora_Entrada'], "text"),

                       GetSQLValueString($_POST['setor'], "text");


e o da pagina de exibicão é esse

mysql_select_db($database_data, $data);

$query_Recordset1 = "SELECT

 ord.Cod_Equipamento,

 ord.Remetente

FROM

 ordemservico ord

WHERE

 setor =(

            SELECT

             setor

            FROM

             funcionario

            WHERE

             setor = "setor"

           )";




por favor alguem pode me ajudar a localizar onde ta esse erro??

Help Complexo Adicionar + Dados, Selecionar Dados E Encaminhar...

14/08/2011, 10:14

bom dia senhores, estou com um probleminha e pra ilustrar melhor a ideia, vou tentar explicar as modificações que necessito diante do codigo que tenho...

1. nessa tela preciso incluir um botão com a funcionalidade incluir, e quando clicado no incluir... fosse exibido abaixo tudo o que foi digitado, possibilitando incluir mais documentos... (posso utilizar o mesmo campo? ou é necessário inumeros campos... tipo documento1,2,3,4,5,6... etc


Código:
<?php require_once('Connections/data.php'); ?><?php require_once('Connections/data.php'); ?><?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** 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 == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "index.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;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO ordemservico (Remetente, Data_Entrada, Hora_Entrada, setor, Equipamento, nNumero, nFornecedor, nEmissao, gFornecedor, gEmissao, mTransp, mNumero, cTransp, cNumero, pPedido, pComprador, bBanco, bValor, bVencimento, fBanco, fValor, fVencimento, rBanco, rValor, rVencimento, Descricao, mDescricao, mQuantidade, tNumero, tPeso, tData, oDescricao, oQuantidade, Problemacliente
) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['Remetente'], "text"),
                       GetSQLValueString($_POST['Data_Entrada'], "text"),
                       GetSQLValueString($_POST['Hora_Entrada'], "text"),
                       GetSQLValueString($_POST['setor'], "text"),
                       GetSQLValueString($_POST['Equipamento'], "text"),
                       GetSQLValueString($_POST['nNumero'], "text"),
                       GetSQLValueString($_POST['nFornecedor'], "text"),
                       GetSQLValueString($_POST['nEmissao'], "text"),
                       GetSQLValueString($_POST['gFornecedor'], "text"),
                       GetSQLValueString($_POST['gEmissao'], "text"),
                       GetSQLValueString($_POST['mTransp'], "text"),
                       GetSQLValueString($_POST['mNumero'], "text"),
                       GetSQLValueString($_POST['cTransp'], "text"),
                       GetSQLValueString($_POST['cNumero'], "text"),
                       GetSQLValueString($_POST['pPedido'], "text"),
                       GetSQLValueString($_POST['pComprador'], "text"),
                       GetSQLValueString($_POST['bBanco'], "text"),
                       GetSQLValueString($_POST['bValor'], "text"),
                       GetSQLValueString($_POST['bVencimento'], "text"),
                       GetSQLValueString($_POST['fBanco'], "text"),
                       GetSQLValueString($_POST['fValor'], "text"),
                       GetSQLValueString($_POST['fVencimento'], "text"),
                       GetSQLValueString($_POST['rBanco'], "text"),
                       GetSQLValueString($_POST['rValor'], "text"),
                       GetSQLValueString($_POST['rVencimento'], "text"),
                       GetSQLValueString($_POST['Descricao'], "text"),
                       GetSQLValueString($_POST['mDescricao'], "text"),
                       GetSQLValueString($_POST['mQuantidade'], "text"),
                       GetSQLValueString($_POST['tNumero'], "text"),
                       GetSQLValueString($_POST['tPeso'], "text"),
                       GetSQLValueString($_POST['tData'], "text"),
                       GetSQLValueString($_POST['oDescricao'], "text"),
                       GetSQLValueString($_POST['oQuantidade'], "text"),
                       GetSQLValueString($_POST['Problemacliente'], "text"));

  mysql_select_db($database_data, $data);
  $Result1 = mysql_query($insertSQL, $data) or die(mysql_error());

  $insertGoTo = "confirma_print.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

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 funcionario WHERE codigo = %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>Gerenciador de Protocolos - Adicionar Protocolo</title>
<script language="javascript">

function mascara(o,f){ 
    v_obj=o 
    v_fun=f 
    setTimeout("execmascara()",1) 
} 
function execmascara(){ 
    v_obj.value=v_fun(v_obj.value) 
}
function mvalor(v){   
    v=v.replace(/\D/g,"");//Remove tudo o que não é dígito   
    v=v.replace(/(\d)(\d{8})$/,"$1.$2");//coloca o ponto dos milhões   
    v=v.replace(/(\d)(\d{5})$/,"$1.$2");//coloca o ponto dos milhares   
  
    v=v.replace(/(\d)(\d{2})$/,"$1,$2");//coloca a virgula antes dos 2 últimos dígitos   
    return v;   
} 
function svalor(v){   
    v=v.replace(/\D/g,"");//Remove tudo o que não é dígito   
    v=v.replace(/(\d)(\d{12})$/,"$1.$2");//coloca o ponto dos milhões   
    v=v.replace(/(\d)(\d{9})$/,"$1.$2");//coloca o ponto dos milhões   
    v=v.replace(/(\d)(\d{6})$/,"$1.$2");//coloca o ponto dos milhões   
    v=v.replace(/(\d)(\d{3})$/,"$1.$2");//coloca o ponto dos milhares   
    return v;   
} 
</script>

<link href="css/style.css" rel="stylesheet" type="text/css" />
<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>
<script language="JavaScript">
<!--
function muda(qual)
{
uCase = qual.value.toUpperCase();
qual.value = uCase;
}
-->
</script>

<script language="Javascript">
function showDiv(div)
{
document.getElementById("NotaFiscal").className = "invisivel";
document.getElementById("GNP").className = "invisivel";
document.getElementById("Minuta").className = "invisivel";
document.getElementById("Conhecimento").className = "invisivel";
document.getElementById("Pedido").className = "invisivel";
document.getElementById("Boleto").className = "invisivel";
document.getElementById("Fatura").className = "invisivel";
document.getElementById("Recibo").className = "invisivel";
document.getElementById("Minuta").className = "invisivel";
document.getElementById("Documento").className = "invisivel";
document.getElementById("Material").className = "invisivel";
document.getElementById("Ticket").className = "invisivel";
document.getElementById("Outros").className = "invisivel";
document.getElementById(div).className = "visivel";
}

</script>
<style>
.invisivel { display: none; }
.visivel { visibility: visible; }

</style>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing=" 0">
  <tr>
    <td width="15" valign="top"><div align="center"><img src="Imagens/cadeado.gif" alt="" width="30" height="30" /></div></td>
    <td><b><font color="#FF0000"><span class="style7">Intranet</span></font> -<a href="fechar.php"> Fechar Janela</a></b><p>&nbsp;</td>
  </tr>
  <tr>
    <td valign="top">&nbsp;</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 width="523" height="40" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="75"><p><b>Remetente: <br />
                          <td><b>
                          <input name="Remetente" type="text" id="Remetente" size="5" maxlength="15" readonly value="<?php echo $_SESSION['MM_Username']; ?>" />
                          <br />
              </b></td>
              <td valign="top"><p><b>Setor destinatário:</b><br />
                  
                <font size="3">
                <select name="setor" size="1" class="select">
                  <option>Selecione</option>
                  <option value="Almoxarifado">Almoxarifado</option>
                  <option value="Compras">Compras</option>
                  <option value="Controladoria">Controladoria</option>
                  <option value="Documentação">Documentação</option>
                  <option value="Faturamento">Faturamento</option>
                  <option value="Financeiro">Financeiro</option>
                  <option value="Fiscal">Fiscal</option>
                  <option value="Garantia">Garantia</option>
                  <option value="Planejamento">Planejamento</option>
                  <option value="Vendas">Vendas</option>
                </select></font><br /></td>
            </tr>
            </table></td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellspacing=" 0" cellpadding="0">
            <tr>
              <td width="120" valign="top">&nbsp;<p><b>Documento:</b><br />
              <b>
        <select id="Equipamento" name="Equipamento" onchange="showDiv(this.value);">
        <option>Selecione</option>
        <option value="NotaFiscal">Nota Fiscal</option>
        <option value="GNP">GNP</option>
        <option value="Minuta">Minuta</option>
        <option value="Conhecimento">Conhecimento</option>
        <option value="Pedido">Pedido</option>
        <option value="Boleto">Boleto</option>
        <option value="Fatura">Fatura</option>
        <option value="Recibo">Recibo</option>
        <option value="Documento">Documento</option>
        <option value="Material">Material</option>
        <option value="Ticket">Ticket</option>
        <option value="Outros">Outros</option>
</select></td>
		<td>
              <div id="NotaFiscal" class="invisivel"><b>&nbsp;<p>Número: <input name="nNumero" type="text" class="select" id="nNumero" size="15" maxlength="25" onkeypress="mascara(this, svalor);"/><br><br>
              	Fornecedor: <input name="nFornecedor" type="text" class="select" id="nFornecedor" size="70" maxlength="150" onKeyUp="muda(this)"/><br><br>
              	Data de Emissão: <input name="nEmissao" type="text" class="select" id="nEmissao" onkeypress="formatar(this, '##/##/####')" size="6" maxlength="10" /></div>

              <div id="GNP" class="invisivel"><b>Fornecedor: <input name="gFornecedor" type="text" class="select" id="gFornecedor" size="70" maxlength="150" onKeyUp="muda(this)"/><br><br>
              	Data de Emissão: <input name="gEmissao" type="text" class="select" id="gEmissao" onkeypress="formatar(this, '##/##/####')" size="6" maxlength="10" /></div>

              <div id="Minuta" class="invisivel"><b>Transportadora: <input name="mTransp" type="text" class="select" id="mTransp" size="55" maxlength="100" onKeyUp="muda(this)"/><br><br>
              	Número: <input name="mNumero" type="text" class="select" id="mNumero" size="15" maxlength="25" onkeypress="mascara(this, svalor);"/></div>

              <div id="Conhecimento" class="invisivel"><b>Transportadora: <input name="cTransp" type="text" class="select" id="cTransp" size="55" maxlength="100" onKeyUp="muda(this)"/><br><br>
              	Número: <input name="cNumero" type="text" class="select" id="cNumero" size="15" maxlength="25" onkeypress="mascara(this, svalor);"/></div>

              <div id="Pedido" class="invisivel"><b>Número: <input name="pPedido" type="text" class="select" id="pPedido" size="15" maxlength="25" onkeypress="mascara(this, svalor);"/><br><br>
              	Comprador: <input name="pComprador" type="text" class="select" id="pComprador" size="25" maxlength="25" onKeyUp="muda(this)"/></div>

              <div id="Boleto" class="invisivel"><b>Banco: <input name="bBanco" type="text" class="select" id="bBanco" size="55" maxlength="100" onKeyUp="muda(this)"/><br><br>
              	Valor R$: <input name="bValor" type="text" class="select" id="bValor" onkeypress="mascara(this, mvalor);" size="10" maxlength="13"><br><br>
              	Vencimento: <input name="bVencimento" type="text" class="select" id="bVencimento" onkeypress="formatar(this, '##/##/####')" size="6" maxlength="10"/></div>

              <div id="Fatura" class="invisivel"><b>Banco: <input name="fBanco" type="text" class="select" id="fBanco" size="52" maxlength="100" onKeyUp="muda(this)"/><br><br>
              	Valor R$: <input name="fValor" type="text" class="select" id="fValor" onkeypress="mascara(this, mvalor);" size="10" maxlength="13"><br><br>
              	Vencimento: <input name="fVencimento" type="text" class="select" id="fVencimento" onkeypress="formatar(this, '##/##/####')" size="6" maxlength="10"/></div>

              <div id="Recibo" class="invisivel"><b>Banco: <input name="rBanco" type="text" class="select" id="rBanco" size="52" maxlength="100" onKeyUp="muda(this)"/><br><br>
              	Valor R$: <input name="rValor" type="text" class="select" id="rValor" onkeypress="mascara(this, mvalor);" size="10" maxlength="13"><br><br>
              	Vencimento: <input name="rVencimento" type="text" class="select" id="rVencimento" onkeypress="formatar(this, '##/##/####')" size="6" maxlength="10"/></div>

              <div id="Documento" class="invisivel"><b>Descrição: <input name="Descricao" type="text" class="select" id="Descricao" size="65" maxlength="150" onKeyUp="muda(this)"/></div>

              <div id="Material" class="invisivel"><b>Descrição: <input name="mDescricao" type="text" class="select" id="mDescricao" size="65" maxlength="150" onKeyUp="muda(this)"/><br><br>
              	Quantidade: <input name="mQuantidade" type="text" class="select" id="mQuantidade" size="6" maxlength="10" onKeyUp="muda(this)"/></div>

              <div id="Ticket" class="invisivel"><b>Número: <input name="tNumero" type="text" class="select" id="tNumero" size="15" maxlength="21" onkeypress="mascara(this, svalor);"/><br><br>
              	Peso: <input name="tPeso" type="text" class="select" id="tPeso" onkeypress="mascara(this, mvalor);" size="6" maxlength="10"> Kg<br><br>
              	Data: <input name="tData" type="text" class="select" id="tData" onkeypress="formatar(this, '##/##/####')" size="6" maxlength="10"/></div>

              <div id="Outros" class="invisivel"><b>Descrição: <input name="oDescricao" type="text" class="select" id="oDescricao" size="65" maxlength="150" onKeyUp="muda(this)"/><br><br>
              	Quantidade: <input name="oQuantidade" type="text" class="select" id="oQuantidade" size="6" maxlength="10" onKeyUp="muda(this)"/><p>&nbsp;</div>
</table>
      </td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="92">&nbsp;<p><b>Data de envio: </b>
                                        <input name="Data_Entrada" type="text" id="Data_Entrada" onkeypress="formatar(this, '##/##/####')" size="6" maxlength="10" readonly value="<?php echo $data = date("d/m/Y "); ?>" />
               </b></td>
              <td width="92"><b>Hora de envio: </b>
                                        <input name="Hora_Entrada" type="text" id="Hora_Entrada" onkeypress="formatar(this, '##:##:##')" size="4" maxlength="10" readonly value="<?php echo $data = date("H:i:s "); ?>" />
              </b></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="120"><table width="100%" border="0" cellspacing=" 0" cellpadding="0">
            <tr>
              <td></br><b>Observações:</b><br />
                                      <b>
                                      <textarea name="Problemacliente" cols="85" rows="5" class="select" id="Problemacliente" onKeyUp="muda(this)"></textarea>
                                      </b></td>
            </tr>
          </table></td>
        </tr>
        <tr align="right">
          <td height="35">&nbsp;<p><input type="submit" name="button" id="button" value=" Cadastrar Protocolo" />
            </td>
        </tr>
        <input type="hidden" name="MM_insert" value="form1" />
      </form>
    </table></td>
  </tr>
</table>



</body>
</html>
<?php
mysql_free_result($DetailRS1);
?>

2.nessa tela o projeto é incluir um botão encaminhar... no caso eu mandaria os documentos para uma outra pessoa (porém na caso de ter recebido 5 documentos... eu pudesse selecionar quais eu quisesse, por exemplo... eu encaminharia apenas 2 mais mantendo o número de identificação

Código:
<?php require_once('Connections/data.php'); ?><?php require_once('Connections/data.php'); ?><?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** 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 == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "index.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;
}
}

$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 Data_Agenda=%s, Hora_Agenda=%s, Recebedor=%s, Arquivo=%s WHERE Cod_Equipamento=%s",
                       GetSQLValueString($_POST['Data_Agenda'], "text"),
                       GetSQLValueString($_POST['Hora_Agenda'], "text"),
                       GetSQLValueString($_POST['Recebedor'], "text"),
                       GetSQLValueString($_POST['Arquivo'], "text"),
                       GetSQLValueString($_POST['Cod_Equipamento'], "int"));

  mysql_select_db($database_data, $data);
  $Result1 = mysql_query($updateSQL, $data) or die(mysql_error());

  $updateGoTo = "fechar.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>Untitled Document</title>
<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>

<script language="JavaScript">
<!--
function muda(qual)
{
uCase = qual.value.toUpperCase();
qual.value = uCase;
}
-->
</script>

<link href="css/style.css" rel="stylesheet" type="text/css" />
<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>
<script language="Javascript">
function showDiv(div)
{
document.getElementById("NotaFiscal").className = "invisivel";
document.getElementById("GNP").className = "invisivel";
document.getElementById("Minuta").className = "invisivel";
document.getElementById("Conhecimento").className = "invisivel";
document.getElementById("Pedido").className = "invisivel";
document.getElementById("Boleto").className = "invisivel";
document.getElementById("Fatura").className = "invisivel";
document.getElementById("Recibo").className = "invisivel";
document.getElementById("Minuta").className = "invisivel";
document.getElementById("Documento").className = "invisivel";
document.getElementById("Material").className = "invisivel";
document.getElementById("Ticket").className = "invisivel";
document.getElementById("Outros").className = "invisivel";
document.getElementById(div).className = "visivel";
}
</script>
<style>
.invisivel { display: none; }
.visivel { visibility: visible }
</style>

</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing=" 0">
  <tr>
    <td width="15" valign="top"><div align="center"><img src="Imagens/cadeado.gif" alt="" width="30" height="30" /></div></td>
    <td><b><font color="#FF0000"><span class="style7">Intranet</span></font> -<a href="fechar.php"> Fechar Janela</a></b></td>
  </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td>
	<table border="0" cellspacing="3" cellpadding="0" class="verdana" width="706" >
      <form action="<?php echo $editFormAction;?>" method="POST" name="form1" id="form1">
        <tr>
          <td valign="top" height="10"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="200" valign="top"><p><b>Rementente: 
                          <b><font size="3"><?php echo $row_DetailRS1['Remetente']; ?></td>
                          <br />
              </b></p>
				<p>&nbsp;</td>
              <td valign="top"><p><b>Setor destinatário: </b><br /> <?php echo $row_DetailRS1['setor']; ?><p></td>
            </tr>
          </table>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellspacing=" 0" cellpadding="0">
            <tr><td width="200">
              <b>Documento: </b><?php if ($row_DetailRS1['Equipamento'] == 'NotaFiscal'){
    echo $row_DetailRS1['Equipamento']; 
}
             elseif ($row_DetailRS1['Equipamento'] == 'GNP'){
    echo $row_DetailRS1['Equipamento'];
}
             elseif ($row_DetailRS1['Equipamento'] == 'Minuta'){
    echo $row_DetailRS1['Equipamento'];
}  
             elseif ($row_DetailRS1['Equipamento'] == 'Conhecimento'){
    echo $row_DetailRS1['Equipamento'];
} 
             elseif ($row_DetailRS1['Equipamento'] == 'Pedido'){
    echo $row_DetailRS1['Equipamento'];
} 
             if ($row_DetailRS1['Equipamento'] == 'Boleto'){
    echo $row_DetailRS1['Equipamento'];
} 
             elseif ($row_DetailRS1['Equipamento'] == 'Fatura'){
    echo $row_DetailRS1['Equipamento'];
} 
             elseif ($row_DetailRS1['Equipamento'] == 'Recibo'){
    echo $row_DetailRS1['Equipamento'];
} 
             elseif ($row_DetailRS1['Equipamento'] == 'Documento'){
    echo $row_DetailRS1['Equipamento'];
} 
             elseif ($row_DetailRS1['Equipamento'] == 'Material'){
    echo $row_DetailRS1['Equipamento'];
} 
             elseif ($row_DetailRS1['Equipamento'] == 'Ticket'){
    echo $row_DetailRS1['Equipamento'];
} 
             elseif ($row_DetailRS1['Equipamento'] == 'Outros'){
    echo $row_DetailRS1['Equipamento']; 
} ?><br /></td>
              <td>
              <div id="NotaFiscal" <?php if( $row_DetailRS1['Equipamento'] == 'NotaFiscal'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="NotaFiscal" class="invisivel"><b>Número: </b><?php echo $row_DetailRS1['nNumero']; ?><br />
              <b>Fornecedor: </b><?php echo $row_DetailRS1['nFornecedor']; ?><br />
              <b>Data de Emissão: </b><?php echo $row_DetailRS1['nEmissao']; ?><br /></div>
              
              <div id="GNP" <?php if( $row_DetailRS1['Equipamento'] == 'GNP'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="GNP" class="invisivel"><b>Fornecedor: </b><?php echo $row_DetailRS1['gFornecedor']; ?><br />
              <b>Data de Emissão: </b><?php echo $row_DetailRS1['gEmissao']; ?><br /></div>
              
              <div id="Minuta" <?php if( $row_DetailRS1['Equipamento'] == 'Minuta'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Minuta" class="invisivel"><b>Transportadora: </b><?php echo $row_DetailRS1['mTransp']; ?><br />
              <b>Número: </b><?php echo $row_DetailRS1['mNumero']; ?><br /></div>
              
              <div id="Conhecimento" <?php if( $row_DetailRS1['Equipamento'] == 'Conhecimento'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Conhecimento" class="invisivel"><b>Transportadora: </b><?php echo $row_DetailRS1['cTransp']; ?><br />
              <b>Número: </b><?php echo $row_DetailRS1['cNumero']; ?><br /></div>

              <div id="Pedido" <?php if( $row_DetailRS1['Equipamento'] == 'Pedido'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Pedido" class="invisivel"><b>Número: </b><?php echo $row_DetailRS1['pPedido']; ?><br />
              <b>Comprador: </b><?php echo $row_DetailRS1['pComprador']; ?><br /></div>

              <div id="Boleto" <?php if( $row_DetailRS1['Equipamento'] == 'Boleto'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Boleto" class="invisivel"><b>Banco: </b><?php echo $row_DetailRS1['bBanco']; ?><br />
              <b>Valor R$: </b><?php echo $row_DetailRS1['bValor']; ?><br />
              <b>Vencimento: </b><?php echo $row_DetailRS1['bVencimento']; ?><br /></div>

              <div id="Fatura" <?php if( $row_DetailRS1['Equipamento'] == 'Fatura'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Fatura" class="invisivel"><b>Banco: </b><?php echo $row_DetailRS1['fBanco']; ?><br />
              <b>Valor R$: </b><?php echo $row_DetailRS1['fValor']; ?><br />
              <b>Vencimento: </b><?php echo $row_DetailRS1['fVencimento']; ?><br /></div>

              <div id="Recibo" <?php if( $row_DetailRS1['Equipamento'] == 'Recibo'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Recibo" class="invisivel"><b>Banco: </b><?php echo $row_DetailRS1['rBanco']; ?><br />
              <b>Valor R$: </b><?php echo $row_DetailRS1['rValor']; ?><br />
              <b>Vencimento: </b><?php echo $row_DetailRS1['rVencimento']; ?><br /></div>

              <div id="Documento" <?php if( $row_DetailRS1['Equipamento'] == 'Documento'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Documento" class="invisivel"><b>Descrição: </b><?php echo $row_DetailRS1['Descricao']; ?><br /></div>

              <div id="Material" <?php if( $row_DetailRS1['Equipamento'] == 'Material'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Material" class="invisivel"><b>Descrição: </b><?php echo $row_DetailRS1['mDescricao']; ?><br />
              <b>Quantidade: </b><?php echo $row_DetailRS1['mQuantidade']; ?><br /></div>

              <div id="Ticket" <?php if( $row_DetailRS1['Equipamento'] == 'Ticket'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Ticket" class="invisivel"><b>Número: </b><?php echo $row_DetailRS1['tNumero']; ?><br />
              <b>Peso: </b><?php echo $row_DetailRS1['tPeso']; ?> Kg<br />
              <b>Data: </b><?php echo $row_DetailRS1['tData']; ?><br /></div>

              <div id="Outros" <?php if( $row_DetailRS1['Equipamento'] == 'Outros'){
              echo "class='visivel'";
              } else {
              echo "class='invisivel'";
              }
              ?>    
              <div id="Outros" class="invisivel"><b>Descrição: </b><?php echo $row_DetailRS1['oDescricao']; ?><br />
              <b>Quantidade: </b><?php echo $row_DetailRS1['oQuantidade']; ?><br /></div>
            </td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td>
			<table width="101%" border="0" cellspacing=" 0" cellpadding="0" id="table1">
            <tr>
              <td><p><b>Observações: </b><br />
                <?php echo $row_DetailRS1['Problemacliente']; ?><br />
                <br /><br /></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td valign="top">
			<table width="111%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="19%" valign="top"><b>Data de envio:</b><br />
                <?php echo $row_DetailRS1['Data_Entrada']; ?><br /></td>
              <td width="19%" valign="top"><b>Hora de envio:</b><br />
                </b><?php echo $row_DetailRS1['Hora_Entrada']; ?><b><br />
                </b></p></td>
              <td width="24%" valign="top"><b>Data de recebimento: <br />
                           <input name="Data_Agenda" type="text" class="select" id="Data_Agenda" onkeypress="formatar(this, '##/##/####')" size="15" maxlength="10" readonly value="<?php echo $data = date("d/m/Y "); ?>" />
              </b></td>
              <td width="35%" valign="top"><b>Hora de recebimento: <br />
                          <input name="Hora_Agenda" type="text" class="select" id="Hora_Agenda" onkeypress="formatar(this, '##:##:##')" size="10" maxlength="10" readonly value="<?php echo $data = date("H:i:s "); ?>" />
              </b></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="2">&nbsp;<p>&nbsp;</p>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="49%">&nbsp;</td>
              <td width="51%"><b>Recebido por: <input name="Recebedor" type="text" id="Recebedor" size="10" maxlength="15" readonly value="<?php echo $_SESSION['MM_Username']; ?>" />

            </tr>
          </table></td>
        </tr>
        <tr align="right">
          <td height="35" width="697">&nbsp;</td>
        </tr>
        <tr align="right">
          <td height="35"><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=" Confirmar Operação" />
            </td>
        </tr>
        <input type="hidden" name="MM_update" value="form1" />
      </form>
    </table>
    
      </td>
  </tr>
</table>

</body>
</html>
<?php
mysql_free_result($DetailRS1);
?>

to quebrando a cabeça e com isso peço a colaboração de alguém com mais conhecimento, pois o meu ta meio limitado... rs
desde já obrigado pessoal!!

IPB Skin By Virteq