<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/

$now=time();
$ergebnis=safe_query("SELECT * FROM ".PREFIX."upcoming WHERE date>= $now ORDER BY date LIMIT 0,$maxupcoming");
echo'<table width="100%" cellspacing="2" cellpadding="0">';
while($ds=mysql_fetch_array($ergebnis)) {
    if($ds[type]=="c") {
		$date=date("d.m", $ds[date]);
		$upsquad=getsquadname($ds[squad]);
        
		$upurl='index.php?site=calendar&tag='.date("d", $ds[date]).'&month='.date("m", $ds[date]).'&year='.date("Y", $ds[date]);
	
	    eval ("\$upcomingactions = \"".gettemplate("upcomingactions")."\";");
        echo $upcomingactions;
	}
	else {
		$date=date("d.m", $ds[date]);
		$country="[flag]".$ds[country]."[/flag]";
		$country=flags($country);
			
		$upurl='index.php?site=calendar&tag='.date("d", $ds[date]).'&month='.date("m", $ds[date]).'&year='.date("Y", $ds[date]);
			
	    eval ("\$upcomingevent = \"".gettemplate("upcomingevent")."\";");
        echo $upcomingevent;
	}
}
if(isclanwaradmin($userID)) {
    $challanges = mysql_num_rows(safe_query("SELECT * FROM ".PREFIX."challenge"));
	if($challanges) $anzahl='('.$challanges.')';
}
eval ("\$challenge_link = \"".gettemplate("challenge_link")."\";");
echo $challenge_link;

echo'</table>';
?>
