<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  05/01/11, 17:14
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
*/


/* Boucle calcul stat nbr commande, client, etc*/
$customers_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS);
$customers = tep_db_fetch_array($customers_query);
$products_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");
$products = tep_db_fetch_array($products_query);
// $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS);
// $reviews = tep_db_fetch_array($reviews_query);
$whos_online_query = tep_db_query("select * from " . TABLE_WHOS_ONLINE);


/* Init menu */
//     menu::resetInstance();
$masterm_[0]=array('inc'=>array() ,'exc'=>array('commercial','cms','catalog','customers','orders'));
$masterm_[1]=array('inc'=>array() ,'exc'=>array('configuration','modules'));
// $masterm_[2]=array(array('inc'=>array('configuration','modules')) ,array('exc'=>array('configuration','modules')));
if(isset($_GET['mode_menu'])){
  $_SESSION['mode_menu'] = (int)$_GET['mode_menu'];
}
// else {
  if(!isset($_SESSION['mode_menu'])) $_SESSION['mode_menu'] = 1;
// }
$sess=$_SESSION['mode_menu'];

$menu=menu::resetInstance((array)$masterm_[$sess]['exc'],(array)$masterm_[$sess]['inc']); //'commercial'

/* Menu bookmarks */
if(isset($navigation->path[count($navigation->path)-1])) {
  $der=$navigation->path[count($navigation->path)-1];
  $Bookmark[]= array('id' =>$der['get']['page_admin'], 'text' => @constant('HEADING_TITLE') );
}elseif(count($navigation->path) ==0 && isset($_GET['page_admin'])){
  $Bookmark[]= array('id' =>$_GET['page_admin'], 'text' => @constant('HEADING_TITLE') );
}
$Bookmark[]= array('id' =>'index', 'text' => 'Tableau de bord');
$Bookmark[]= array('id' =>'categories', 'text' => 'Categories');
$Bookmark[]= array('id' =>'products', 'text' => 'Produits');
$Bookmark[]= array('id' =>'customers', 'text' => 'Client/membres');


?>