Location: PHPKode > projects > Valid tiny-erp > validerp/addesoda_detailspreview.php
<?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/addesoda_variables.php");

if(!@$_SESSION["UserID"])
{ 
	return;
}
if(!CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Search"))
{
	return;
}

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


//$strSQL = $gstrSQL;



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

$strSQL.=" ".$gstrOrderBy;

$rowcount=gSQLRowCount($where);


if ( $rowcount ) {
	$rs=db_query($strSQL,$conn);
	echo "Details found".": <strong>".$rowcount."</strong>";
			echo ( $rowcount > 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>customer</strong></td>";
	echo "<td><strong>enabled</strong></td>";
	echo "<td><strong>date</strong></td>";
	echo "<td><strong>parthner</strong></td>";
	echo "<td><strong>item</strong></td>";
	echo "<td><strong>cost</strong></td>";
	echo "<td><strong>quantity</strong></td>";
	echo "<td><strong>total</strong></td>";
	echo "<td><strong>get paid</strong></td>";
	echo "<td><strong>info</strong></td>";
	echo "</tr>";
	while ($data = db_fetch_array($rs)) {
		$recordsCounter++;
					if ( $recordsCounter > 10 ) { break; }
		echo "<tr>";
		$keylink="";
		$keylink.="&key1=".htmlspecialchars(rawurlencode($data["id"]));

	//	synallasomenos - 
		    $value="";
				if(strlen($data["synallasomenos"]))
			{
				$strdata = make_db_value("synallasomenos",$data["synallasomenos"]);
				$LookupSQL="SELECT ";
							$LookupSQL.="`name`";
				$LookupSQL.=" FROM `synallasomenos` WHERE `id` = " . $strdata;
							LogInfo($LookupSQL);
				$rsLookup = db_query($LookupSQL,$conn);
				$lookupvalue=$data["synallasomenos"];
				if($lookuprow=db_fetch_numarray($rsLookup))
					$lookupvalue=$lookuprow[0];
				$value=ProcessLargeText(GetDataInt($lookupvalue,$data,"synallasomenos", ""),"field=synallasomenos".$keylink,"",MODE_PRINT);
			}
			else
				$value="";
			echo "<td>".$value."</td>";
	//	ektelesmeni - Checkbox
		    $value="";
				$value = GetData($data,"ektelesmeni", "Checkbox");
			echo "<td>".$value."</td>";
	//	date - Short Date
		    $value="";
				$value = ProcessLargeText(GetData($data,"date", "Short Date"),"field=date".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	idkinisicategory - 
		    $value="";
				if(strlen($data["idkinisicategory"]))
			{
				$strdata = make_db_value("idkinisicategory",$data["idkinisicategory"]);
				$LookupSQL="SELECT ";
							$LookupSQL.="`kinisicategory`";
				$LookupSQL.=" FROM `kinisicategory` WHERE `id_kinisicategory` = " . $strdata;
							LogInfo($LookupSQL);
				$rsLookup = db_query($LookupSQL,$conn);
				$lookupvalue=$data["idkinisicategory"];
				if($lookuprow=db_fetch_numarray($rsLookup))
					$lookupvalue=$lookuprow[0];
				$value=ProcessLargeText(GetDataInt($lookupvalue,$data,"idkinisicategory", ""),"field=idkinisicategory".$keylink,"",MODE_PRINT);
			}
			else
				$value="";
			echo "<td>".$value."</td>";
	//	proion - 
		    $value="";
				if(strlen($data["proion"]))
			{
				$strdata = make_db_value("proion",$data["proion"]);
				$LookupSQL="SELECT ";
							$LookupSQL.="`proion`";
				$LookupSQL.=" FROM `proion` WHERE `id` = " . $strdata;
							LogInfo($LookupSQL);
				$rsLookup = db_query($LookupSQL,$conn);
				$lookupvalue=$data["proion"];
				if($lookuprow=db_fetch_numarray($rsLookup))
					$lookupvalue=$lookuprow[0];
				$value=ProcessLargeText(GetDataInt($lookupvalue,$data,"proion", ""),"field=proion".$keylink,"",MODE_PRINT);
			}
			else
				$value="";
			echo "<td>".$value."</td>";
	//	timipolisis - Number
		    $value="";
				$value = ProcessLargeText(GetData($data,"timipolisis", "Number"),"field=timipolisis".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	quantityesodo - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"quantityesodo", ""),"field=quantityesodo".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	apotelesmaesodo - Number
		    $value="";
				$value = ProcessLargeText(GetData($data,"apotelesmaesodo", "Number"),"field=apotelesmaesodo".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	eispraxi - Number
		    $value="";
				$value = ProcessLargeText(GetData($data,"eispraxi", "Number"),"field=eispraxi".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
	//	simioseis - 
		    $value="";
				$value = ProcessLargeText(GetData($data,"simioseis", ""),"field=simioseis".$keylink,"",MODE_PRINT);
			echo "<td>".$value."</td>";
		echo "</tr>";
	}
	echo "</table>";
} else {
	echo "Details found".": <strong>".$rowcount."</strong>";
}

echo "counterSeparator".postvalue("counter");
?>
Return current item: Valid tiny-erp