/**
* The required files
*/
require_once(HTML_MVC_CONTROLLER_PATH.'/Engine.php');
require_once(HTML_DB_BASKET_QUERY_PATH.'/QueryBasket.php');
/**
* The Engine Basket parsing engine
* This is the controller for a Basket
* <code>
* Usage:
* $engine = new EngineBasket($table,$sql,$name);
* print $engine->getHtml();
* Or
* EngineBasket::display($table,$sql,$name);
* </code>
* @package basket
*/
class EngineBasket 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
*/
function EngineBasket($table='',$sql='',$name='') {
$id = Decrypt::it(Request::get(REQUEST_ID));
$sid = Request::get(REQUEST_SID);
if ($sid=='') {
if (defined('LOGIN_SID') && LOGIN_SID!=='') {
$sid = LOGIN_SID;
} else {
$sid = Session::getId('',__FILE__,__LINE__);
}
} else {
// Already defined
}
$translate = $id!=''?false:true;
$theTable = $table!=''?$table:DATABASE_PREFIX.TABLE_NAME_BASKET;
$theSql = $sql !=''?$sql :QueryBasket::get($theTable, $id, $sid, $translate);
$theName = $name !=''?$name :ENGINE_NAME_BASKET;
$this->Engine($theTable,$theSql,$theName);
}
/**
* Display html
* <code>
* Usage:
* EngineBasket::display($table,$sql,$name);
* </code>
* @static
* @param String $table The table to use
* @param String $sql The SQL to excute
* @param String $name The Engine Name to use
*/
function display($table='',$sql='',$name='') {
$html = new EngineBasket($table,$sql,$name);
$html->addHtml();
}
}
?>