/**
* The required files
*/
require_once(HTML_MVC_CONTROLLER_PATH.'/Engine.php');
require_once(HTML_DB_CUSTOMER_QUERY_PATH.'/QueryCustomer.php');
/**
* The ListView parsing engine
* This is the controller for a List View
* <code>
* Usage:
* $table = DATABASE_PREFIX.TABLE_NAME_CUSTOMER;
* $sql = 'SELECT * FROM customer';
* $name = ENGINE_NAME_LIST;
* $view = GRID_LAYOUT_VIEW_LIST;
* $engine = new EngineList($table,$sql,$name,$view);
* print $engine->getHtml();
* Or
* EngineList::display($table,$sql,$name,$view);
* </code>
* @package mvc
*/
class EngineList extends Engine {
/**
* Constructor
* @param String $table The table to use
* @param String $sql The SQL to excute
* @param String $name The Engine Name to use
* @param String $view The View to use
*/
function EngineList($table='',$sql='',$name='',$view='') {
$theTable = $table!=''?$table:DATABASE_PREFIX.TABLE_NAME_CUSTOMER;
$translate = false;
$theSql = $sql !=''?$sql :QueryCustomer::get($theTable,'','',$translate);
$theName = $name !=''?$name :ENGINE_NAME_LIST;
$theView = $view !=''?$view :GRID_LAYOUT_VIEW_LIST;
$this->Engine($theTable,$theSql,$theName);
}
/**
* Display html
* <code>
* Usage:
* EngineList::display($table,$sql,$name,$view);
* </code>
* @static
* @param String $table The table to use
* @param String $sql The SQL to excute
* @param String $name The Engine Name to use
* @param String $view The View to use
*/
function display($table='',$sql='',$name='',$view='') {
$html = new EngineList($table,$sql,$name,$view);
$html->addHtml();
}
}
?>