Ver Mensaje Individual
  #6 (permalink)  
Antiguo 08/09/2010, 18:10
faticod
 
Fecha de Ingreso: noviembre-2009
Mensajes: 19
Antigüedad: 16 años, 11 meses
Puntos: 0
Respuesta: Ayuda con contador de impresiones

Muchas gracias por su atencion , les agrego el codigo completo y las sesiones las estoy llamando al inicio


Código PHP:
<?php require_once('Connections/db.php'); ?>
<?php ob_start
();?>
<?php 
require_once('include_session.php'); ?>
<?php 
require_once('include_valida_session.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;
}
}


$Sentencia=$_GET['Sentencia'];
$PalabrasClave=$_GET['PalabrasClave'];


require(
"paginacion.php");
    
//Realizamos la conexion a la BD
    
mysql_select_db($database_outdoor, $outdoor);
    
    
$query = "SELECT * FROM anuncios WHERE $Sentencia AND Activo =1 AND Eliminado=0 ORDER BY IdTipoEmpresa DESC";
    
$rsT =  mysql_query($query, $outdoor);
    
$total = mysql_num_rows($rsT);
    
    
$pg = $_GET['page'];
    
$cantidad = 25; //Cantidad de registros que se desea mostrar por pagina
    //Para probar solo le coloque 3
    
    
$paginacion = new paginacion($cantidad, $pg);
    
$desde = $paginacion->getFrom();

    
$query = "SELECT * FROM anuncios WHERE 1 AND $Sentencia AND Activo =1 AND Eliminado=0 ORDER BY IdTipoEmpresa DESC LIMIT $desde, $cantidad";
    
$rs = mysql_query($query, $outdoor);
////////////////////////////////////////////////////////////////////////////////////////////////////////

/////INSERTAMOS La visita para el anuncio
$IdAnuncio = $_GET['IdAnuncio'];
$IdUsuario = $_SESSION['IdUsuario'];
$Fecha = date("Y-m-d");
$Hora = date("H:i:s");
mysql_select_db($database_outdoor, $outdoor);
$q="INSERT INTO bitacora (IdAnuncio,IdUsuario,Fecha,Hora) VALUES ('$IdAnuncio','$IdUsuario','$Fecha','$Hora')";
$result = mysql_query($q);

/////////////////////////////////////////////


function generaEstados()
{

    
$consulta=mysql_query("SELECT id, opcion FROM DB_ESTADOS");


    
// Voy imprimiendo el primer select compuesto por los paises
    
echo "<select class='cuerpo' name='estados' id='estados' onChange='cargaContenido(this.id)'>";
    echo 
"<option class='cuerpo' value='0'>Elige</option>";
    while(
$registro=mysql_fetch_row($consulta))
    {
        echo 
"<option class='cuerpo' value='".$registro[0]."'>".$registro[1]."</option>";
    }
    echo 
"</select>";
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
esa es la pagina de los resultados, si fueran tan amables pueden revisar el codigo completo de aqui:

http://www.megaupload.com/?d=KY4KSUQS

Ya que para postearlo es muy grande.



Gracias!