Ir para conteúdo
Fórum Script Brasil

ooooBR

Membros
  • Total de itens

    12
  • Registro em

  • Última visita

Tudo que ooooBR postou

  1. ooooBR

    mover dados da bd

    bom, 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 <?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 <?php require_once('Connections/data.php'); ?><?php require_once('Connections/data.php'); ?><?phpif (!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© { 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); } S
  2. beuleal, meu... muito agradecido pela sua pacianecia e sabedoria!!! com esse lance do if funciono corretamente.... senhores moderas favor finalizar o tópico!!! <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> enfim graças as sugestões do amigo beuleal o código fico dessa maneira alcançando o resultado esperado!!! grato pela força amigão!!!
  3. beuleal então cara no meu código já tem um esquema de div pelo select de combobox, ai eu tentei adapta mais num deu certo... o interessante pra mim seria exibir o conteudo aleatoriamente, a linguagem usada não influencia, desde que eu chegue ao resultado, pode sim... se fizer o de um eu termino os demais!!!! o que você considerar mais facil será de grande ajuda!!!
  4. vishiiiiiiiiiiiiiiiii deu pane aqui brow!!! respira fundo, tecla de vagar que o tico e o teco trombo aqui... o que falta é como fazer exibir o <div> quando exibir o resultado do documento. se você pude fazer isso por mim, ficarei agradecido, porque aqui ta dificil!
  5. <div id="NotaFiscal" class="invisivel">[red]<td>[/red]<b>Número: </b> essa besterinha desse <td> perdido ai no meio do código tava impedindo dessa unica <div> ficar oculta... agora estão todas ocultas, acredito que pra exibir na hora certa o comando deve ser insirido nessa linha: <b>Documento: </b><?php if ($row_DetailRS1['Equipamento'] == 'NotaFiscal'){ echo $row_DetailRS1['Equipamento']; } é isso mesmo??? só que tudo que eu tentei incluir ai deu pau... mais uma vez grato pelas discas beuleal
  6. bom um progresso!!! está tudo oculto... menos a primeira <div> estou usando o código acima acrescentei </script> <style> .invisivel { display: none; } .visivel { visibility: visible; } </style>
  7. beuleal obrigado pela sua atenção... bem esse é o código que tenho... exibindo conforme está na imagem </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("Outros").className = "invisivel"; document.getElementById(div).className = "visivel"; } </script> <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" valign="top"><div align="center"><img src="Imagens/cadeado.gif" alt="" width="30" height="30" /></div></td> <td><b><span class="style7">Intranet</span> -<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="40"><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:<br /> </b> <?php echo $row_DetailRS1['setor']; ?><p><br /></td> </tr> </table></td> </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']; } elseif ($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'] == 'Mtaerial'){ echo $row_DetailRS1['Equipamento']; } elseif ($row_DetailRS1['Equipamento'] == 'Outros'){ echo $row_DetailRS1['Equipamento']; } ?><br /></td> <div id="NotaFiscal" class="invisivel"><td><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" 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" 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" 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" 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" 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" 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" 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" class="invisivel"><b>Descrição: </b><?php echo $row_DetailRS1['Descricao']; ?><br /> <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 id="Outros" class="invisivel"><b>Descrição: </b><?php echo $row_DetailRS1['oDescricao']; ?><br /> <b>Quantidade: </b><?php echo $row_DetailRS1['oQuantidade']; ?><br /> </b></td> </tr> </table></td> </tr>
  8. beuleal essa nova imagem acho que vai ilustra melhor o que eu desejo... cada quadrado representa um <div> (que representa um tipo de documento) como vem... estão em branco, exceto um... conforme apareceu no Documento: Boleto só a <div> que esta preenchida Banco, Valor, Vencimento deveria ficar exibida, as demais ficam ocultas, e quando o resultado do Documento for outra categoria altera a <div> exibida. acho que agora ta mais ilustrada a ideia, espero que possam me ajudar!!!
  9. vou postar uma imagem da situação de como esta sendo exibido... o que tá sem negrito ta sendo puxado da bd... eu nesse caso deveria estar aparecendo apenas Descrição: Laudo acredito que só uma div não seja viavel, pois necessito exibir dados de categorias variaveis, a ideia do CSS parece interessante, alguém poderia me ajudar amadurecer essa ideia??
  10. <b>Documento: </b><?php if ($row_DetailRS1['Documento'] == 'boleto'){ echo $row_DetailRS1['Documento']; } elseif ($row_DetailRS1['Documento'] == 'pedido'){ echo $row_DetailRS1['Documento']; } elseif ($row_DetailRS1['Documento'] == 'laudo'){ echo $row_DetailRS1['Documento']; } Ricardo obrigadão pela dica, me deu rumo certo! funcionou... porém as div's estão todas exibidas, tem mais alguma dica ai???
  11. <?php if( ($row_DetailRS1['Documento'] == 'boleto' ) && ($row_DetailRS1['Documento'] == 'pedido' ) && ($row_DetailRS1['Documento'] == 'laudo') && ($row_DetailRS1['Documento'] == 'requisicao') ){ } ?> eu fiz dessa maneira e não teve resultado... resaltando que eu necessito que apareça o item documento, mais aparece mesmo sem o "echo" no comando???
  12. Boa noite pessoal, confeço ser iniciante no assunto... a dúvida que trago aos senhores mais experientes é a seguinte... <b>Documento: </b><?php echo $row_DetailRS1[Documento]; ?><br /></td> <div id=Pedido" class="invisivel"><b>Número: </b><?php echo $row_DetailRS1['pPedido]; ?><b><br /> <b>Comprador: </b><?php echo $row_DetailRS1['pComprador']; ?><br /></div> <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> nessa pagina será exibido os dados já cadastrados... gostaria de saber se é possivel a partir do resultado dessa linha exibir os dados referentes a consulta por exemplo se o resultado do documento for Pedido, aparece só a div Pedido... ou se for Boleto, aparece a div Boleto. ou se alguém tiver uma outra sugestão, fico agradecido!!! lembrando que os dados serão aleatorios dependendo da consulta!
×
×
  • Criar Novo...