<?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_planta_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>id_planta</strong></td>";
	echo "<td><strong>nombre</strong></td>";
	echo "<td><strong>num_camara</strong></td>";
	echo "</tr>";
	while ($data = db_fetch_array($rs)) {
		$recordsCounter++;
					if ( $recordsCounter > 10 ) { break; }
		echo "<tr>";
		$keylink="";
		$keylink.="&key1=".htmlspecialchars(urlencode($data["id_planta"]));

	//	id_planta - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"id_planta", ""),"field=id%5Fplanta".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	nombre - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"nombre", ""),"field=nombre".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	num_camara - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"num_camara", ""),"field=num%5Fcamara".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
		echo "</tr>";
	}
	echo "</table>";
} else {
	echo "Detalles encontrados".": <strong>".GetRowCount($strSQL)."</strong>";
}

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