<?php 
/*
##################################################################
#                       PHP 4&5 MySQL 4&5                        #
##################################################################
#           Copyright (c) 2004-2008 Armia Systems Inc            #
##################################################################
#               This file is part of Cybermatch site             #
##################################################################
#    Developed By: simi (simi@armia.com)                         #

##################################################################
#               Developed On:   03-04-2008                       #
##################################################################
#               Modified By:                                     #
##################################################################
#               Modified On:                                     #
##################################################################
# This script may not be distributed, sold, given away for free  #
# to third party, or used as a part of any internet services 	 #
# such as webdesign etc.                                         #
##################################################################
*/

require_once ("config.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("includes/arrays.inc.php");
require_once ("classes/userside.class.php");
require_once ("classes/misc.class.php");
require_once ("includes/Pager/Pager.php");

$message	= "";
$pages		= "";
$count		= 0;
$page		= isset($_REQUEST['page'])	?	trim($_REQUEST['page'])	:	"1";
$data		= array();

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objC		= new check();
	$objU		= new userside($objDB);
	$objM		= new misc($objDB);
	$count		= $objM->get_upcoming_events_count('MC');
	$params 	= array(
		'mode'      => 'Sliding',
		'perPage'   => PAGESIZE,
		'urlVar'    => 'page',
		'extraVars' => array(),
		'totalItems' => $count,
		'delta'		=> 7
	);
	$objP 		= & Pager::factory($params);
	if ($count > 0) {
		$data  		= $objM->get_upcoming_events_page(($page-1)*PAGESIZE, PAGESIZE,'MC');
		$pages		= $objP->links;
	} else
		$message	= "No upcoming event(s) found.<br>";		
	$script		= $objU->get_script($message);
	$message	= $objU->remove_script($message);
}
include_once ("title.inc.php");
include_once ("tophtml.inc.php");
?>

<div class="row">
	<div class="eight columns">
		<div class="search-rslts">
			<div class="row"><div class="inenr-hd"><h2>Upcoming Contests</h2></div></div>
			<div class="row">
<!--				<h2 class="headings2">Profile Images</h2>-->
			</div>
			<div class="row">
				<div class="newdesignforinput maintext1">
					<div class="full_row">
						<div class="maintext1 warning">
							<?php if(isset($message) && trim($message)!='')
								{
									echo $message;
								}//end if
							?>
						</div>
					</div>
					
					<?php if (!empty($data)) 
					  { 
						 foreach ($data as $key => $value) 
						 { 
					?>
					<div class="row search-rslts-row">
						<div class="full_row">
							<div class="twelve columns"><b>Date</b> : <?php echo date('m/d/Y',strtotime($value['dDate_Event']))?></div>
						</div>
					
						<div class="full_row">
							<div class="twelve columns"><b><?php echo stripslashes($value['vTitle'])?></b></div>
						</div>
					
						<div class="full_row">
							<div class="twelve columns"><b>Venue</b> : <?php echo $value['vVenue']?></div>
						</div>
					
						<div class="full_row">
							<div class="twelve columns"><b>City</b> : <?php echo $value['vCity']?></div>
						</div>
					
						<div class="full_row">
							<div class="twelve columns"><?php echo nl2br((stripslashes($value['vDescription'])))?></div>
						</div>
					
						<div class="full_row">
							<div class="three columns"></div>
							<div class="five columns margin_R_200">
								
							</div>
						</div>
						
					</div>
					 <?php 	}//end foreach
					 }//end if
					?>
					
					<div class="clear"></div>
					<?php if ($pages <> "") 
					{
					?>
					<div class="full_row pagenation"><?php echo $pages?></div>
					<?php } ?>
					
				</div>
			</div>
		</div>
	</div>
	<div class="four columns search_result_R">
		<?php include_once ("left.inc.php");?>
	</div>
</div>

<?php include_once('bottomhtml.inc.php');?>
