<?php

require(dirname(__FILE__)."/smarty/libs/Smarty.class.php");

class Template extends Smarty
{

	public function assign_md_array($data, $result_name='')
	{
		$results = array();
		while ($row = $data->fetch_assoc())
		{
			$results[] = $row;
		}

		//If a result name was passed in let's assign it to Smarty with that name and also the count of the records 
		if ($result_name != '')
		{
			$this->assign($result_name, $results);
			// $this->assign($result_name.'_count', count($results));
		}
		else
		{
			return $results;
		}
	}

}

?>
