<?php
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); 
set_magic_quotes_runtime(0);

include("include/dbcommon.php");
include("include/pf_tarja_variables.php");


$conn=db_connect(); 
$recordsCounter = 0;


$strSQL = $gstrSQL;



$str = SecuritySQL("Search");
if(strlen($str))
	$where.=" and ".$str;
$strSQL = AddWhere($strSQL,$where);

$strSQL.=" ".$gstrOrderBy;

$rs=db_query($strSQL,$conn);

if ( GetRowCount($strSQL) ) {
	echo "Detalles encontrados".": <strong>".GetRowCount($strSQL)."</strong>";
			echo ( GetRowCount($strSQL) > 10 ) ? ". Displaying first: <strong>10</strong>.<br /><br />" : "<br /><br />";
	echo "<table cellpadding=1 cellspacing=1 border=0 align=left class=\"detailtable\"><tr>";
	echo "<td><strong>Codigo Tarja</strong></td>";
	echo "<td><strong>Flag</strong></td>";
	echo "<td><strong>Fecha Creacion</strong></td>";
	echo "<td><strong>Tarja Anterior</strong></td>";
	echo "</tr>";
	while ($data = db_fetch_array($rs)) {
		$recordsCounter++;
					if ( $recordsCounter > 10 ) { break; }
		echo "<tr>";
		$keylink="";
		$keylink.="&key1=".htmlspecialchars(urlencode($data["codigo_tarjeta"]));

	//	codigo_tarjeta - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"codigo_tarjeta", ""),"field=codigo%5Ftarjeta".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	flag - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"flag", ""),"field=flag".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	fecha_creacion - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"fecha_creacion", ""),"field=fecha%5Fcreacion".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	tarja_anterior - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"tarja_anterior", ""),"field=tarja%5Fanterior".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
		echo "</tr>";
	}
	echo "</table>";
} else {
	echo "Detalles encontrados".": <strong>".GetRowCount($strSQL)."</strong>";
}

echo "counterSeparator".postvalue("counter");
?>