<?php
/*
	osCommRes, Services Oline 
	http://www.oscommres.com 
	Copyright (c) 2005 osCommRes 
	
	Freeway eCommerce 
	http://www.zac-ware.com/freeway 
	Copyright (c) 2007 ZacWare
	
	Released under the GNU General Public License
*/


// Set flag that this is a parent file
	define( '_FEXEC', 1 );
	
if (!function_exists('tep_db_connect')){
  require('includes/application_top.php');
}
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SESSION_DETAILS);
  $events_id=0;
  if (isset($HTTP_GET_VARS['events_id']) && is_numeric($HTTP_GET_VARS['events_id'])) $events_id=(int)$HTTP_GET_VARS['events_id'];

  $event_check_query = tep_db_query("select count(*) as total from " . TABLE_EVENTS . " e, " . TABLE_EVENTS_DESCRIPTION . " ed where e.events_id = '" . (int)$events_id . "' and ed.events_id = e.events_id and ed.language_id = '" . (int)$languages_id . "' " . EVENTS_CONDITION_STATUS);

 // echo "select count(*) as total from " . TABLE_EVENTS . " e, " . TABLE_EVENTS_DESCRIPTION . " ed where e.events_id = '" . (int)$events_id . "' and ed.events_id = e.events_id and ed.language_id = '" . (int)$languages_id . "' " . EVENTS_CONDITION_STATUS; 
 
  $event_check = tep_db_fetch_array($event_check_query);
  //check attendees
	  $products=$cart->get_products();
	  	  
	  $attendees=true;
	  if(count($products)>0){
	  		for ($i=0, $n=sizeof($products); $i<$n; $i++) {
	  			if($products[$i]['element_type']!='E')	$attendees=false;
	  		}
	  }
	  if(count($products)<=0 || !$attendees){
	  		$cart->attendees=array();
	  } 
  //check attendees
  $content = CONTENT_SESSION_DETAILS;
  $javascript = 'popup_window.js';

  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
