$$loop row as totalskey index as keyindex select * from %%killstablename%%$$
	$$description=ReadTemplateConfig("description_%%killstablename%%_%%totalskey.id%%","No description available")$$
	$$loop row as killscount index as countindex select sum(kills) as kills, sum(teamkills) as teamkills, sum(suicides) as suicides from %%totalstable%%$$
		$$totalkills=killscount.kills$$
		$$totalsuicides=killscount.suicides$$
		$$totalteamkills=killscount.teamkills$$
	$$endloop$$
	$$openfile %%killstablename%%_%%totalskey.id%%.html$$$$updatestatus("%%killstablename%%_%%totalskey.id%%.html")$$
	$$include menu.include$$
	
		<br><br>
		
						
							<table class=style2 border=0 cellspacing=0 align=center>


							       <tr><th><b>$$%%killstablename%%_%%totalskey.idx%%_realname$$</b></th></tr>
								<tr><td>$$if (%%killstablename%%_%%totalskey.idx%%_image !EQUALS "")$$
			<img src="maps/$$%%killstablename%%_%%totalskey.idx%%_image$$"</td></tr>
							$$endif$$
							</table>
						<br><br>

					<table align=center cellspacing=0 border=0 class=style2><tr align=center></tr>

			<td>
		<table class=style2 cellspacing=1 border=0 align=center>
			<tr>
				<th width= "15px">#</th>
				<th width= "180px">Player</th>
				<th width= "80px">Kills</th>
				<th width= "80px">Deaths</th>
			</tr>
			$$playerdisplaydropped="N"$$
			$$loop row as kills index as killsindex select player.playerindex as playeridx,name,dropped,itemindex,%%totalstable%%.kills as totalkills,%%totalstable%%.deaths as totaldeaths,%%totalstable%%.suicides as totalsuicides,%%totalstable%%.teamkills as totalteamkills from %%totalstable%%,player where itemindex='%%totalskey.idx%%' and dropped='N' and player.playerindex=%%totalstable%%.playerindex order by totalkills desc,totaldeaths asc$$
				<tr align=center>
					<th height="27px">$$killsindex$$</th>
					<td align="left"><b>$$playerdisplayplayerindex=kills.playeridx$$$$playerdisplayname=kills.name$$$$include playerdisplay.include$$</b></td>
					<td>$$kills.totalkills$$</td>
					<td>$$kills.totaldeaths$$</td>		
				</tr>
			$$endloop$$
		</table>
			</td>
	$$closefile$$
$$endloop$$
