<?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_camara_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>Identificador Camara</strong></td>";
	echo "<td><strong>Nombre de la Camara</strong></td>";
	echo "<td><strong>Estado Actual</strong></td>";
	echo "<td><strong>Tipo de Camara</strong></td>";
	echo "<td><strong>Proceso Actual</strong></td>";
	echo "<td><strong>Posicion de la Puerta</strong></td>";
	echo "<td><strong>x</strong></td>";
	echo "<td><strong>y</strong></td>";
	echo "<td><strong>w</strong></td>";
	echo "<td><strong>h</strong></td>";
	echo "<td><strong>Maximo Numero de Pallets</strong></td>";
	echo "</tr>";
	while ($data = db_fetch_array($rs)) {
		$recordsCounter++;
					if ( $recordsCounter > 10 ) { break; }
		echo "<tr>";
		$keylink="";
		$keylink.="&key1=".htmlspecialchars(urlencode($data["id_camara"]));

	//	id_camara - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"id_camara", ""),"field=id%5Fcamara".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	nombre_camara - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"nombre_camara", ""),"field=nombre%5Fcamara".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	estado_actual - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"estado_actual", ""),"field=estado%5Factual".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	tipo_camara - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"tipo_camara", ""),"field=tipo%5Fcamara".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	proceso_actual - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"proceso_actual", ""),"field=proceso%5Factual".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	posicion_puerta - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"posicion_puerta", ""),"field=posicion%5Fpuerta".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	x - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"x", ""),"field=x".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	y - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"y", ""),"field=y".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	w - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"w", ""),"field=w".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	h - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"h", ""),"field=h".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	maxpallet - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"maxpallet", ""),"field=maxpallet".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
		echo "</tr>";
	}
	echo "</table>";
} else {
	echo "Detalles encontrados".": <strong>".GetRowCount($strSQL)."</strong>";
}

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