Location: PHPKode > projects > Supacart Shopping Cart System > admin.supacart.php
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
*
* @version $Id: admin.supacart.php 836 2007-05-02 13:11:48Z soeren_nb $
* @package SupaCart
* @subpackage core
* See COPYRIGHT.php for copyright notices and details.
* @license GNU/GPL Version 2, see LICENSE.php
* SupaCart is free software, originally derived from Virtuemart. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_supacart/COPYRIGHT.php for copyright notices and details.
*
* http://www.supacart.com
*/

defined( '_PSHOP_ADMIN' ) or define( '_PSHOP_ADMIN', '1' );

$no_menu = mosGetParam( $_REQUEST, 'no_menu', 0 );
global $VM_LANG;
/*** INSTALLER SECTION ***/
include( $mosConfig_absolute_path.'/administrator/components/com_supacart/install.supacart.php' );

if (isset($_REQUEST['install_type']) && file_exists( $mosConfig_absolute_path.'/administrator/components/'.$option.'/install.php' )) {
	supacart_is_installed();
	include( $mosConfig_absolute_path.'/administrator/components/'.$option.'/install.php' );

	/** can be update and newinstall **/
	$install_type = mosgetparam( $_REQUEST, 'install_type', 'newinstall' );

	/** true or false **/
	$install_sample_data = mosgetparam( $_GET, 'install_sample_data', false );
	$sample_data_type = mosgetparam( $_GET, 'sample_data_type', 'uk' );

	installsupacart( $install_type, $install_sample_data, $sample_data_type );
	$error = "";
	$page = "store.index";

	$installfile = dirname( __FILE__ ) . "/install.php";
	if( !@unlink( $installfile ) ) {
		echo "<br /><span class=\"message\">Something went wrong when trying to delete the file <strong>install.php</strong>!<br />";
		echo "You'll have to delete the file manually before being able to use SupaCart!</span>";
	}

}
elseif( file_exists( $mosConfig_absolute_path.'/administrator/components/'.$option.'/install.php' )) {
	supacart_is_installed();
	com_install();
	exit();
	
}
/*** END INSTALLER ***/

/* Load the supacart main parse code */
require_once( $mosConfig_absolute_path.'/components/'.$option.'/supacart_parser.php' );

if( empty( $page )) {
	$page = 'store.index';
}

if (!isset($category_id)) {
	$category_id = 0;
}
if (!isset($product_id)) {
	$product_id = 0;
}

$limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit );
$limitstart = $mainframe->getUserStateFromRequest( "view{$page}{$product_id}{$category_id}limitstart", 'limitstart', 0 );

if (defined('_DONT_VIEW_PAGE') && !isset($install_type) ) {
        echo "<script type=\"text/javascript\">alert('$error. Your permissions: ".$_SESSION['auth']['perms']."')</script>\n";
}

// renew Page-Information
$my_page= explode ( '.', $page );
$modulename = $my_page[0];
$pagename = $my_page[1];

$_SESSION['last_page'] = $page;

if( $no_menu != 1 ) {
	include(ADMINPATH.'header.php');
}
// Include the Stylesheet
echo '<link rel="stylesheet" href="components/'.$option.'/admin.styles.css" type="text/css" />';
echo '<link href="../components/'.$option.'/css/shop.css" type="text/css" rel="stylesheet" media="screen, projection" />';
echo '<script type="text/javascript" src="../components/'.$option.'/js/functions.js"></script>';

// Check for database upgrade script.
if( file_exists( $mosConfig_absolute_path.'/administrator/components/'.$option.'/dbupgrade.php' )) {
	include $mosConfig_absolute_path.'/administrator/components/'.$option.'/dbupgrade.php';	
}

// Load PAGE
if(file_exists(PAGEPATH.$modulename.".".$pagename.".php")) {
	include( PAGEPATH.$modulename.".".$pagename.".php" );
}
else {
	include( PAGEPATH.'store.index.php' );
}
include_once( ADMINPATH. 'version.php' );
if (isset($VMVERSION)) {
if ($page != 'order.order_printdetails') {
	echo '<br style="clear:both;"/><div class="smallgrey" align="center"><a href="http://www.supacart.com" target="_blank">'.$VMVERSION->PRODUCT.' '.$VMVERSION->RELEASE.'</a>';
}
}
if( DEBUG == '1' ) {
        // Load PAGE
	include( PAGEPATH."shop.debug.php" );
}
if( defined( 'vmToolTipCalled')) {
	echo '<script language="Javascript" type="text/javascript" src="'. $mosConfig_live_site.'/components/'.$option.'/js/wz_tooltip.js"></script>';
}
?>
Return current item: Supacart Shopping Cart System