Location: PHPKode > projects > Blogs manager > blogs/_comments_export.php
<?php 
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
session_cache_limiter("none");
set_magic_quotes_runtime(0);

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

if(!@$_SESSION["UserID"])
{ 
	$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
	header("Location: login.php?message=expired"); 
	return;
}
if(!CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Export"))
{
	echo "<p>"."You don't have permissions to access this table"."<a href=\"login.php\">"."Back to login page"."</a></p>";
	return;
}

$conn=db_connect();
//	Before Process event
if(function_exists("BeforeProcessExport"))
	BeforeProcessExport($conn);

$strWhereClause="";

$options = "1";
if (@$_REQUEST["a"]!="") 
{
	$options = "";
	
	$sWhere = "1=0";	

//	process selection
	$selected_recs=array();
	if (@$_REQUEST["mdelete"])
	{
		foreach(@$_REQUEST["mdelete"] as $ind)
		{
			$keys=array();
			$keys["id"]=refine($_REQUEST["mdelete1"][$ind-1]);
			$selected_recs[]=$keys;
		}
	}
	elseif(@$_REQUEST["selection"])
	{
		foreach(@$_REQUEST["selection"] as $keyblock)
		{
			$arr=split("&",refine($keyblock));
			if(count($arr)<1)
				continue;
			$keys=array();
			$keys["id"]=urldecode($arr[0]);
			$selected_recs[]=$keys;
		}
	}

	foreach($selected_recs as $keys)
	{
		$sWhere = $sWhere . " or ";
		$sWhere.=KeyWhere($keys);
	}


	$strSQL = gSQLWhere($sWhere);
	$strWhereClause=$sWhere;
	
	$_SESSION[$strTableName."_SelectedSQL"] = $strSQL;
	$_SESSION[$strTableName."_SelectedWhere"] = $sWhere;
}

if ($_SESSION[$strTableName."_SelectedSQL"]!="" && @$_REQUEST["records"]=="") 
{
	$strSQL = $_SESSION[$strTableName."_SelectedSQL"];
	$strWhereClause=@$_SESSION[$strTableName."_SelectedWhere"];
}
else
{
	$strWhereClause=@$_SESSION[$strTableName."_where"];
	$strSQL=gSQLWhere($strWhereClause);
}


$mypage=1;
if(@$_REQUEST["type"])
{
//	order by
	$strOrderBy=$_SESSION[$strTableName."_order"];
	if(!$strOrderBy)
		$strOrderBy=$gstrOrderBy;
	$strSQL.=" ".trim($strOrderBy);

	$strSQLbak = $strSQL;
	if(function_exists("BeforeQueryExport"))
		BeforeQueryExport($strSQL,$strWhereClause,$strOrderBy);
//	Rebuild SQL if needed
	if($strSQL!=$strSQLbak)
	{
//	changed $strSQL - old style	
		$numrows=GetRowCount($strSQL);
	}
	else
	{
		$strSQL = gSQLWhere($strWhereClause);
		$strSQL.=" ".trim($strOrderBy);
		$numrows=gSQLRowCount($strWhereClause);
	}
	LogInfo($strSQL);

//	 Pagination:

	$nPageSize=0;
	if(@$_REQUEST["records"]=="page" && $numrows)
	{
		$mypage=(integer)@$_SESSION[$strTableName."_pagenumber"];
		$nPageSize=(integer)@$_SESSION[$strTableName."_pagesize"];
		if($numrows<=($mypage-1)*$nPageSize)
			$mypage=ceil($numrows/$nPageSize);
		if(!$nPageSize)
			$nPageSize=$gPageSize;
		if(!$mypage)
			$mypage=1;

		$strSQL.=" limit ".(($mypage-1)*$nPageSize).",".$nPageSize;
	}
	$rs=db_query($strSQL,$conn);

	if(!ini_get("safe_mode"))
		set_time_limit(300);
	
	if(@$_REQUEST["type"]=="excel")
		ExportToExcel();
	else if(@$_REQUEST["type"]=="word")
		ExportToWord();
	else if(@$_REQUEST["type"]=="xml")
		ExportToXML();
	else if(@$_REQUEST["type"]=="csv")
		ExportToCSV();
	else if(@$_REQUEST["type"]=="pdf")
		ExportToPDF();

	db_close($conn);
	return;
}

header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); 

include('libs/Smarty.class.php');
$smarty = new Smarty();
$smarty->assign("options",$options);
$smarty->display("_comments_export.htm");


function ExportToExcel()
{
	global $cCharset;
	header("Content-type: application/vnd.ms-excel");
	header("Content-Disposition: attachment;Filename=_comments.xls");

	echo "<html>";
	echo "<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns=\"http://www.w3.org/TR/REC-html40\">";
	
	echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$cCharset."\">";
	echo "<body>";
	echo "<table border=1>";

	WriteTableData();

	echo "</table>";
	echo "</body>";
	echo "</html>";
}

function ExportToWord()
{
	global $cCharset;
	header("Content-type: application/vnd.ms-word");
	header("Content-Disposition: attachment;Filename=_comments.doc");

	echo "<html>";
	echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$cCharset."\">";
	echo "<body>";
	echo "<table border=1>";

	WriteTableData();

	echo "</table>";
	echo "</body>";
	echo "</html>";
}

function ExportToXML()
{
	global $nPageSize,$rs,$strTableName,$conn;
	header("Content-type: text/xml");
	header("Content-Disposition: attachment;Filename=_comments.xml");
	if(!($row=db_fetch_array($rs)))
		return;
	global $cCharset;
	echo "<?xml version=\"1.0\" encoding=\"".$cCharset."\" standalone=\"yes\"?>\r\n";
	echo "<table>\r\n";
	$i=0;
	while((!$nPageSize || $i<$nPageSize) && $row)
	{
		echo "<row>\r\n";
		$field=htmlspecialchars(XMLNameEncode("id"));
		echo "<".$field.">";
		echo htmlspecialchars(GetData($row,"id",""));
		echo "</".$field.">\r\n";
		$field=htmlspecialchars(XMLNameEncode("username"));
		echo "<".$field.">";
		echo htmlspecialchars(GetData($row,"username",""));
		echo "</".$field.">\r\n";
		$field=htmlspecialchars(XMLNameEncode("blogfirstline"));
		echo "<".$field.">";
		if(strlen($row["blogfirstline"]))
		{
			$strdata = make_db_value("blogfirstline",$row["blogfirstline"]);
			$LookupSQL="SELECT ";
					$LookupSQL.="`firstline`";
			$LookupSQL.=" FROM `_blogs` WHERE `firstline` = " . $strdata;
					LogInfo($LookupSQL);
			$rsLookup = db_query($LookupSQL,$conn);
			$lookupvalue=$row["blogfirstline"];
			if($lookuprow=db_fetch_numarray($rsLookup))
				$lookupvalue=$lookuprow[0];
			echo htmlspecialchars(GetDataInt($lookupvalue,$row,"blogfirstline", ""));
		}
		echo "</".$field.">\r\n";
		$field=htmlspecialchars(XMLNameEncode("date"));
		echo "<".$field.">";
		echo htmlspecialchars(GetData($row,"date",""));
		echo "</".$field.">\r\n";
		$field=htmlspecialchars(XMLNameEncode("time"));
		echo "<".$field.">";
		echo htmlspecialchars(GetData($row,"time",""));
		echo "</".$field.">\r\n";
		$field=htmlspecialchars(XMLNameEncode("rate"));
		echo "<".$field.">";
		if(strlen($row["rate"]))
		{
			$strdata = make_db_value("rate",$row["rate"]);
			$LookupSQL="SELECT ";
					$LookupSQL.="concat(rate,'  if: ',meanning)";
			$LookupSQL.=" FROM `_rate` WHERE `rate` = " . $strdata;
					LogInfo($LookupSQL);
			$rsLookup = db_query($LookupSQL,$conn);
			$lookupvalue=$row["rate"];
			if($lookuprow=db_fetch_numarray($rsLookup))
				$lookupvalue=$lookuprow[0];
			echo htmlspecialchars(GetDataInt($lookupvalue,$row,"rate", ""));
		}
		echo "</".$field.">\r\n";
		$field=htmlspecialchars(XMLNameEncode("comment"));
		echo "<".$field.">";
		echo htmlspecialchars(GetData($row,"comment",""));
		echo "</".$field.">\r\n";
		echo "</row>\r\n";
		$i++;
		$row=db_fetch_array($rs);
	}
	echo "</table>\r\n";
}

function ExportToCSV()
{
	global $rs,$nPageSize,$strTableName,$conn;
	header("Content-type: application/csv");
	header("Content-Disposition: attachment;Filename=_comments.csv");

	if(!($row=db_fetch_array($rs)))
		return;

	$totals=array();

	
// write header
	$outstr="";
	if($outstr!="")
		$outstr.=",";
	$outstr.= "\"id\"";
	if($outstr!="")
		$outstr.=",";
	$outstr.= "\"username\"";
	if($outstr!="")
		$outstr.=",";
	$outstr.= "\"blogfirstline\"";
	if($outstr!="")
		$outstr.=",";
	$outstr.= "\"date\"";
	if($outstr!="")
		$outstr.=",";
	$outstr.= "\"time\"";
	if($outstr!="")
		$outstr.=",";
	$outstr.= "\"rate\"";
	if($outstr!="")
		$outstr.=",";
	$outstr.= "\"comment\"";
	echo $outstr;
	echo "\r\n";

// write data rows
	$iNumberOfRows = 0;
	while((!$nPageSize || $iNumberOfRows<$nPageSize) && $row)
	{
		$outstr="";
		if($outstr!="")
			$outstr.=",";
			$format="";
		$outstr.='"'.htmlspecialchars(GetData($row,"id",$format)).'"';
		if($outstr!="")
			$outstr.=",";
			$format="";
		$outstr.='"'.htmlspecialchars(GetData($row,"username",$format)).'"';
		if($outstr!="")
			$outstr.=",";
		if(strlen($row["blogfirstline"]))
		{
			$strdata = make_db_value("blogfirstline",$row["blogfirstline"]);
			$LookupSQL="SELECT ";
					$LookupSQL.="`firstline`";
			$LookupSQL.=" FROM `_blogs` WHERE `firstline` = " . $strdata;
					LogInfo($LookupSQL);
			$rsLookup = db_query($LookupSQL,$conn);

			$lookupvalue=$row["blogfirstline"];
			if($lookuprow=db_fetch_numarray($rsLookup))
				$lookupvalue=$lookuprow[0];
			$outstr.='"'.htmlspecialchars(GetDataInt($lookupvalue,$row,"blogfirstline", "")).'"';
		}
		if($outstr!="")
			$outstr.=",";
			$format="Short Date";
		$outstr.='"'.htmlspecialchars(GetData($row,"date",$format)).'"';
		if($outstr!="")
			$outstr.=",";
			$format="Time";
		$outstr.='"'.htmlspecialchars(GetData($row,"time",$format)).'"';
		if($outstr!="")
			$outstr.=",";
		if(strlen($row["rate"]))
		{
			$strdata = make_db_value("rate",$row["rate"]);
			$LookupSQL="SELECT ";
					$LookupSQL.="concat(rate,'  if: ',meanning)";
			$LookupSQL.=" FROM `_rate` WHERE `rate` = " . $strdata;
					LogInfo($LookupSQL);
			$rsLookup = db_query($LookupSQL,$conn);

			$lookupvalue=$row["rate"];
			if($lookuprow=db_fetch_numarray($rsLookup))
				$lookupvalue=$lookuprow[0];
			$outstr.='"'.htmlspecialchars(GetDataInt($lookupvalue,$row,"rate", "")).'"';
		}
		if($outstr!="")
			$outstr.=",";
			$format="HTML";
		$outstr.='"'.htmlspecialchars(GetData($row,"comment",$format)).'"';
		echo $outstr;
		echo "\r\n";
		$iNumberOfRows++;
		$row=db_fetch_array($rs);
	}

//	display totals
	$first=true;

}


function WriteTableData()
{
	global $rs,$nPageSize,$strTableName,$conn;
	if(!($row=db_fetch_array($rs)))
		return;
// write header
	echo "<tr>";
	if($_REQUEST["type"]=="excel")
	{
		echo '<td style="width: 100" x:str>'.PrepareForExcel("id").'</td>';
		echo '<td style="width: 100" x:str>'.PrepareForExcel("username").'</td>';
		echo '<td style="width: 100" x:str>'.PrepareForExcel("blogfirstline").'</td>';
		echo '<td style="width: 100" x:str>'.PrepareForExcel("date").'</td>';
		echo '<td style="width: 100" x:str>'.PrepareForExcel("time").'</td>';
		echo '<td style="width: 100" x:str>'.PrepareForExcel("rate").'</td>';
		echo '<td style="width: 100" x:str>'.PrepareForExcel("comment").'</td>';
	}
	else
	{
		echo "<td>id</td>";
		echo "<td>username</td>";
		echo "<td>blogfirstline</td>";
		echo "<td>date</td>";
		echo "<td>time</td>";
		echo "<td>rate</td>";
		echo "<td>comment</td>";
	}
	echo "</tr>";

	$totals=array();
// write data rows
	$iNumberOfRows = 0;
	while((!$nPageSize || $iNumberOfRows<$nPageSize) && $row)
	{
		echo "<tr>";
	echo '<td>';

		$format="";
			echo htmlspecialchars(GetData($row,"id",$format));
	echo '</td>';
	if($_REQUEST["type"]=="excel")
		echo '<td x:str>';
	else
		echo '<td>';

		$format="";
			if($_REQUEST["type"]=="excel")
			echo PrepareForExcel(GetData($row,"username",$format));
		else
			echo htmlspecialchars(GetData($row,"username",$format));
	echo '</td>';
	if($_REQUEST["type"]=="excel")
		echo '<td x:str>';
	else
		echo '<td>';
		if(strlen($row["blogfirstline"]))
		{
			$strdata = make_db_value("blogfirstline",$row["blogfirstline"]);
			$LookupSQL="SELECT ";
					$LookupSQL.="`firstline`";
			$LookupSQL.=" FROM `_blogs` WHERE `firstline` = " . $strdata;
					LogInfo($LookupSQL);
			$rsLookup = db_query($LookupSQL,$conn);
			$lookupvalue=$row["blogfirstline"];
			if($lookuprow=db_fetch_numarray($rsLookup))
				$lookupvalue=$lookuprow[0];

			$strValue=GetDataInt($lookupvalue,$row,"blogfirstline", "");
						if($_REQUEST["type"]=="excel")
				echo PrepareForExcel($strValue);
			else
				echo htmlspecialchars($strValue);

		}
	echo '</td>';
	echo '<td>';

		$format="Short Date";
			if($_REQUEST["type"]=="excel")
			echo PrepareForExcel(GetData($row,"date",$format));
		else
			echo htmlspecialchars(GetData($row,"date",$format));
	echo '</td>';
	echo '<td>';

		$format="Time";
			if($_REQUEST["type"]=="excel")
			echo PrepareForExcel(GetData($row,"time",$format));
		else
			echo htmlspecialchars(GetData($row,"time",$format));
	echo '</td>';
	echo '<td>';
		if(strlen($row["rate"]))
		{
			$strdata = make_db_value("rate",$row["rate"]);
			$LookupSQL="SELECT ";
					$LookupSQL.="concat(rate,'  if: ',meanning)";
			$LookupSQL.=" FROM `_rate` WHERE `rate` = " . $strdata;
					LogInfo($LookupSQL);
			$rsLookup = db_query($LookupSQL,$conn);
			$lookupvalue=$row["rate"];
			if($lookuprow=db_fetch_numarray($rsLookup))
				$lookupvalue=$lookuprow[0];

			$strValue=GetDataInt($lookupvalue,$row,"rate", "");
						if($_REQUEST["type"]=="excel")
				echo PrepareForExcel($strValue);
			else
				echo htmlspecialchars($strValue);

		}
	echo '</td>';
	if($_REQUEST["type"]=="excel")
		echo '<td x:str>';
	else
		echo '<td>';

		$format="HTML";
			echo GetData($row,"comment",$format);
	echo '</td>';
		echo "</tr>";
		$iNumberOfRows++;
		$row=db_fetch_array($rs);
	}

}

function XMLNameEncode($strValue)
{	
	$search=array(" ","#","'","/","\\","(",")",",","[","]","+","\"","-","_","|","}","{","=");
	return str_replace($search,"",$strValue);
}

function PrepareForExcel($str)
{
	$ret = htmlspecialchars($str);
	if (substr($ret,0,1)== "=") 
		$ret = "&#61;".substr($ret,1);
	return $ret;

}




function ExportToPDF()
{
	global $nPageSize,$rs,$strTableName,$conn;
		global $colwidth,$leftmargin;
	if(!($row=db_fetch_array($rs)))
		return;


	include("libs/fpdf.php");

	class PDF extends FPDF
	{
	//Current column
		var $col=0;
	//Ordinate of column start
		var $y0;
		var $maxheight;

	function AcceptPageBreak()
	{
		global $colwidth,$leftmargin;
		if($this->y0+$this->rowheight>$this->PageBreakTrigger)
			return true;
		$x=$leftmargin;
		if($this->maxheight<$this->PageBreakTrigger-$this->y0)
			$this->maxheight=$this->PageBreakTrigger-$this->y0;
		$this->Rect($x,$this->y0,$colwidth["id"],$this->maxheight);
		$x+=$colwidth["id"];
		$this->Rect($x,$this->y0,$colwidth["username"],$this->maxheight);
		$x+=$colwidth["username"];
		$this->Rect($x,$this->y0,$colwidth["blogfirstline"],$this->maxheight);
		$x+=$colwidth["blogfirstline"];
		$this->Rect($x,$this->y0,$colwidth["date"],$this->maxheight);
		$x+=$colwidth["date"];
		$this->Rect($x,$this->y0,$colwidth["time"],$this->maxheight);
		$x+=$colwidth["time"];
		$this->Rect($x,$this->y0,$colwidth["rate"],$this->maxheight);
		$x+=$colwidth["rate"];
		$this->Rect($x,$this->y0,$colwidth["comment"],$this->maxheight);
		$x+=$colwidth["comment"];
		$this->maxheight = $this->rowheight;
//	draw frame	
		return true;
	}

	function Header()
	{
		global $colwidth,$leftmargin;
	    //Page header
		$this->SetFillColor(192);
		$this->SetX($leftmargin);
		$this->Cell($colwidth["id"],$this->rowheight,"id",1,0,'C',1);
		$this->Cell($colwidth["username"],$this->rowheight,"username",1,0,'C',1);
		$this->Cell($colwidth["blogfirstline"],$this->rowheight,"blogfirstline",1,0,'C',1);
		$this->Cell($colwidth["date"],$this->rowheight,"date",1,0,'C',1);
		$this->Cell($colwidth["time"],$this->rowheight,"time",1,0,'C',1);
		$this->Cell($colwidth["rate"],$this->rowheight,"rate",1,0,'C',1);
		$this->Cell($colwidth["comment"],$this->rowheight,"comment",1,0,'C',1);
		$this->Ln($this->rowheight);
		$this->y0=$this->GetY();
	}

	}

	$pdf=new PDF();

	$leftmargin=5;
	$pagewidth=200;
	$pageheight=290;
	$rowheight=5;


	$defwidth=$pagewidth/7;
	$colwidth=array();
    $colwidth["id"]=$defwidth;
    $colwidth["username"]=$defwidth;
    $colwidth["blogfirstline"]=$defwidth;
    $colwidth["date"]=$defwidth;
    $colwidth["time"]=$defwidth;
    $colwidth["rate"]=$defwidth;
    $colwidth["comment"]=$defwidth;
	
	$pdf->AddFont('CourierNewPSMT','','courcp1253.php');
	$pdf->rowheight=$rowheight;
	
	$pdf->SetFont('CourierNewPSMT','',8);
	$pdf->AddPage();
	

	$i=0;
	while((!$nPageSize || $i<$nPageSize) && $row)
	{
		$pdf->maxheight=$rowheight;
		$x=$leftmargin;
		$pdf->SetY($pdf->y0);
		$pdf->SetX($x);
		$pdf->MultiCell($colwidth["id"],$rowheight,GetData($row,"id",""));
		$x+=$colwidth["id"];
		if($pdf->GetY()-$pdf->y0>$pdf->maxheight)
			$pdf->maxheight=$pdf->GetY()-$pdf->y0;
		$pdf->SetY($pdf->y0);
		$pdf->SetX($x);
		$pdf->MultiCell($colwidth["username"],$rowheight,GetData($row,"username",""));
		$x+=$colwidth["username"];
		if($pdf->GetY()-$pdf->y0>$pdf->maxheight)
			$pdf->maxheight=$pdf->GetY()-$pdf->y0;
		$pdf->SetY($pdf->y0);
		$pdf->SetX($x);
		if(strlen($row["blogfirstline"]))
		{
			$strdata = make_db_value("blogfirstline",$row["blogfirstline"]);
			$LookupSQL="SELECT ";
					$LookupSQL.="`firstline`";
			$LookupSQL.=" FROM `_blogs` WHERE `firstline` = " . $strdata;
					LogInfo($LookupSQL);
			$rsLookup = db_query($LookupSQL,$conn);
			$lookupvalue=$row["blogfirstline"];
			if($lookuprow=db_fetch_numarray($rsLookup))
				$lookupvalue=$lookuprow[0];
			$pdf->Cell($colwidth["blogfirstline"],$rowheight,GetDataInt($lookupvalue,$row,"blogfirstline", ""));
		}
		$x+=$colwidth["blogfirstline"];
		if($pdf->GetY()-$pdf->y0>$pdf->maxheight)
			$pdf->maxheight=$pdf->GetY()-$pdf->y0;
		$pdf->SetY($pdf->y0);
		$pdf->SetX($x);
		$pdf->MultiCell($colwidth["date"],$rowheight,GetData($row,"date","Short Date"));
		$x+=$colwidth["date"];
		if($pdf->GetY()-$pdf->y0>$pdf->maxheight)
			$pdf->maxheight=$pdf->GetY()-$pdf->y0;
		$pdf->SetY($pdf->y0);
		$pdf->SetX($x);
		$pdf->MultiCell($colwidth["time"],$rowheight,GetData($row,"time","Time"));
		$x+=$colwidth["time"];
		if($pdf->GetY()-$pdf->y0>$pdf->maxheight)
			$pdf->maxheight=$pdf->GetY()-$pdf->y0;
		$pdf->SetY($pdf->y0);
		$pdf->SetX($x);
		if(strlen($row["rate"]))
		{
			$strdata = make_db_value("rate",$row["rate"]);
			$LookupSQL="SELECT ";
					$LookupSQL.="concat(rate,'  if: ',meanning)";
			$LookupSQL.=" FROM `_rate` WHERE `rate` = " . $strdata;
					LogInfo($LookupSQL);
			$rsLookup = db_query($LookupSQL,$conn);
			$lookupvalue=$row["rate"];
			if($lookuprow=db_fetch_numarray($rsLookup))
				$lookupvalue=$lookuprow[0];
			$pdf->Cell($colwidth["rate"],$rowheight,GetDataInt($lookupvalue,$row,"rate", ""));
		}
		$x+=$colwidth["rate"];
		if($pdf->GetY()-$pdf->y0>$pdf->maxheight)
			$pdf->maxheight=$pdf->GetY()-$pdf->y0;
		$pdf->SetY($pdf->y0);
		$pdf->SetX($x);
		$pdf->MultiCell($colwidth["comment"],$rowheight,GetData($row,"comment","HTML"));
		$x+=$colwidth["comment"];
		if($pdf->GetY()-$pdf->y0>$pdf->maxheight)
			$pdf->maxheight=$pdf->GetY()-$pdf->y0;
//	draw fames
		$x=$leftmargin;
		$pdf->Rect($x,$pdf->y0,$colwidth["id"],$pdf->maxheight);
		$x+=$colwidth["id"];
		$pdf->Rect($x,$pdf->y0,$colwidth["username"],$pdf->maxheight);
		$x+=$colwidth["username"];
		$pdf->Rect($x,$pdf->y0,$colwidth["blogfirstline"],$pdf->maxheight);
		$x+=$colwidth["blogfirstline"];
		$pdf->Rect($x,$pdf->y0,$colwidth["date"],$pdf->maxheight);
		$x+=$colwidth["date"];
		$pdf->Rect($x,$pdf->y0,$colwidth["time"],$pdf->maxheight);
		$x+=$colwidth["time"];
		$pdf->Rect($x,$pdf->y0,$colwidth["rate"],$pdf->maxheight);
		$x+=$colwidth["rate"];
		$pdf->Rect($x,$pdf->y0,$colwidth["comment"],$pdf->maxheight);
		$x+=$colwidth["comment"];
		$pdf->y0+=$pdf->maxheight;
		$i++;
		$row=db_fetch_array($rs);
	}
	$pdf->Output();
}

?>
Return current item: Blogs manager