Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/01/2011, 23:00
Avatar de oscarios
oscarios
 
Fecha de Ingreso: septiembre-2004
Mensajes: 186
Antigüedad: 19 años, 8 meses
Puntos: 2
ocultar en php

buenas noches amigos foreros del ya refamoso FOROS DEL WEB saludos desde Colombia, una vez mas en busca de su valiosa ayuda con lo siguiente

tengo una tabla dinamica que muestra los resultados de una consulta, al final de cada fila tengo un link VER quiciera qe si el campo locationde esa fila dice out que el link VER no se mostrara.

e tratado con if y else pero como no se programacion me he complicado muchisimo.

DE ANTEMANO GRACIAS POR SU ATENCION .......

esto es lo que tengo en codigo

Código PHP:
Ver original
  1. <?php
  2. if (!function_exists("GetSQLValueString")) {
  3. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  4. {
  5.   if (PHP_VERSION < 6) {
  6.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7.   }
  8.  
  9.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  10.  
  11.   switch ($theType) {
  12.     case "text":
  13.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  14.       break;    
  15.     case "long":
  16.     case "int":
  17.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  18.       break;
  19.     case "double":
  20.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  21.       break;
  22.     case "date":
  23.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  24.       break;
  25.     case "defined":
  26.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  27.       break;
  28.   }
  29.   return $theValue;
  30. }
  31. }
  32.  
  33. $maxRows_Recordset1 = 10;
  34. $pageNum_Recordset1 = 0;
  35. if (isset($_GET['pageNum_Recordset1'])) {
  36.   $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
  37. }
  38. $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
  39.  
  40. $colname_Recordset1 = "-1";
  41. if (isset($_GET['busca'])) {
  42.   $colname_Recordset1 = $_GET['busca'];
  43. }
  44. mysql_select_db($database_connts, $connts);
  45. $query_Recordset1 = sprintf("SELECT id, sap, mac, serial, categoria, estado, location, fecha FROM maestra WHERE serial = %s ORDER BY id DESC", GetSQLValueString($colname_Recordset1, "text"));
  46. $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
  47. $Recordset1 = mysql_query($query_limit_Recordset1, $connts) or die(mysql_error());
  48. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  49.  
  50. if (isset($_GET['totalRows_Recordset1'])) {
  51.   $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
  52. } else {
  53.   $all_Recordset1 = mysql_query($query_Recordset1);
  54.   $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
  55. }
  56. $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
  57. ?>
  58. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  59. <html xmlns="http://www.w3.org/1999/xhtml">
  60. <head>
  61. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  62. <title>Documento sin título</title>
  63. </head>
  64.  
  65. <body>
  66. <p><a href="index.php">buscar</a> - LINE GEAR - VERIFICAR</p>
  67. <table border="1">
  68.   <tr>
  69.     <td>id</td>
  70.     <td>fecha</td>
  71.     <td>sap</td>
  72.     <td>mac</td>
  73.     <td>serial</td>
  74.     <td>categoria</td>
  75.     <td>estado</td>
  76.     <td>location</td>
  77.     <td>&nbsp;</td>
  78.     <td>&nbsp;</td>
  79.   </tr>
  80.   <?php do { ?>
  81.     <tr>
  82.       <td><?php echo $row_Recordset1['id']; ?></td>
  83.       <td><?php echo $row_Recordset1['fecha']; ?></td>
  84.       <td><?php echo $row_Recordset1['sap']; ?></td>
  85.       <td><?php echo $row_Recordset1['mac']; ?></td>
  86.       <td><?php echo $row_Recordset1['serial']; ?></td>
  87.       <td><?php echo $row_Recordset1['categoria']; ?></td>
  88.       <td><?php echo $row_Recordset1['estado']; ?></td>
  89.       <td><?php echo $row_Recordset1['location']; ?></td>
  90.       <td><a href="actualiza2.php?busca=<?php echo $row_Recordset1['serial']; ?>&busca2=<?php echo $row_Recordset1['fecha']; ?>">VER</a></td>
  91.       <td><a href="resultados.php?busca=<?php echo $row_Recordset1['serial']; ?>&busca2=<?php echo $row_Recordset1['fecha']; ?>">CONTINUAR</a></td>
  92.     </tr>
  93.     <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
  94. </table>
  95. </body>
  96. </html>
  97. <?php
  98. mysql_free_result($Recordset1);
  99. ?>
__________________
oscariosdw