/**
* The required files
*/
require_once(HTML_MVC_CONTROLLER_PATH.'/EngineObject.php');
//require_once(HTML_DB_LOGIN_QUERY_PATH.'/QueryLogin.php');
/**
* The Engine is the controller for other EngineXyz objects
* This is the controller for a List View or Form View
* where the user may Insert, Update or delete records
* <code>
* Usage:
* $table = DATABASE_PREFIX.TABLE_NAME_LOGIN;
* $sql = 'SELECT * ';
* $name = ENGINE_NAME_LOGIN;
* $view = GRID_LAYOUT_VIEW_LOGIN;
* $engine = new Engine($table,$sql,$name,$view);
* print $engine->getHtml();
* Or
* Engine::display($table,$sql,$name,$view);
* </code>
* @package mvc
*/
class Engine extends EngineObject {
/**
* 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 Engine($table='',$sql='',$name='',$view='') {
$theTable = $table!=''?$table:DATABASE_PREFIX.TABLE_NAME_LOGIN;
$theSql = $sql !=''?$sql :QueryLogin::get($theTable);
$theName = $name !=''?$name :ENGINE_NAME_LOGIN;
$theView = $view !=''?$view :GRID_LAYOUT_VIEW_LOGIN;
$this->EngineObject($theTable,$theSql,$theName,$theView);
}
/**
* Display html
* <code>
* Usage:
* Engine::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 Engine($table,$sql,$name,$view);
$html->addHtml();
}
}
?>