Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/09/2012, 19:14
chuntaro18
 
Fecha de Ingreso: mayo-2012
Ubicación: Distrito Federal
Mensajes: 49
Antigüedad: 12 años
Puntos: 9
Pregunta Respuesta: Libreria dompdf - generar pdf de una imagen almacenada en mysql

Este lo tuve que dividir en dos partes por que se pasa de caracteres permitidos, disculpen las molestias


perfiles.php parte 1

Código PHP:
<?php require_once('Connections/bd_futbol.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$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;
}
}

$currentPage $_SERVER["PHP_SELF"];

$colname_mostrar_datos "-1";
if (isset(
$_GET['busqueda'])) {
  
$colname_mostrar_datos $_GET['busqueda'];
}
mysql_select_db($database_bd_futbol$bd_futbol);
$query_mostrar_datos sprintf("SELECT * FROM datos_jugador WHERE posicion = %s"GetSQLValueString($colname_mostrar_datos"text"));
$mostrar_datos mysql_query($query_mostrar_datos$bd_futbol) or die(mysql_error());
$row_mostrar_datos mysql_fetch_assoc($mostrar_datos);
$maxRows_mostrar_datos 1;
$pageNum_mostrar_datos 0;
if (isset(
$_GET['pageNum_mostrar_datos'])) {
  
$pageNum_mostrar_datos $_GET['pageNum_mostrar_datos'];
}
$startRow_mostrar_datos $pageNum_mostrar_datos $maxRows_mostrar_datos;

$colname2_mostrar_datos "-1";
if (isset(
$_GET['busqueda2'])) {
  
$colname2_mostrar_datos $_GET['busqueda2'];
}
$colname_mostrar_datos "-1";
if (isset(
$_GET['busqueda'])) {
  
$colname_mostrar_datos $_GET['busqueda'];
}
mysql_select_db($database_bd_futbol$bd_futbol);
$query_mostrar_datos sprintf("SELECT * FROM datos_jugador WHERE posicion = %s OR nombre LIKE %s"GetSQLValueString($colname_mostrar_datos"text"),GetSQLValueString($colname2_mostrar_datos"text"));
$query_limit_mostrar_datos sprintf("%s LIMIT %d, %d"$query_mostrar_datos$startRow_mostrar_datos$maxRows_mostrar_datos);
$mostrar_datos mysql_query($query_limit_mostrar_datos$bd_futbol) or die(mysql_error());
$row_mostrar_datos mysql_fetch_assoc($mostrar_datos);

if (isset(
$_GET['totalRows_mostrar_datos'])) {
  
$totalRows_mostrar_datos $_GET['totalRows_mostrar_datos'];
} else {
  
$all_mostrar_datos mysql_query($query_mostrar_datos);
  
$totalRows_mostrar_datos mysql_num_rows($all_mostrar_datos);
}
$totalPages_mostrar_datos ceil($totalRows_mostrar_datos/$maxRows_mostrar_datos)-1;

$queryString_mostrar_datos "";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_mostrar_datos") == false && 
        
stristr($param"totalRows_mostrar_datos") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_mostrar_datos "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_mostrar_datos sprintf("&totalRows_mostrar_datos=%d%s"$totalRows_mostrar_datos$queryString_mostrar_datos);
?>