Location: PHPKode > projects > iLP System > Release 2.2/upload/_backend/lib/templates/tpl.events.php
<?php
/**
 * iLP System Template: Ereignisse anzeigen
 * 
 * Autor:		Florian "ApoY2k" Peschka
 * Projekt:		iLP System
 * Paket:		apoy2k.ilp.wrynn.lib.tpl
 * Lizenz:		CreativeCommons (by-nc-sa)
 * Kontakt:		hide@address.com
 * Version:		2.1.1
 */
if (!isset($tpl['url'][1]) || 'show' == $tpl['url'][1])
{
	echo '<h1>'.$lang['events']['navi']['home'].'</h1>';
	
	if (!isset($tpl['events']['error']))
	{
		echo '<div class="blocklist eventList">';
	
		foreach ($tpl['events'] as $row)
		{
			echo '<a href="?ilp='.ilpUrlEncode('events;edit;'.$row['event_id']).'">
					<img src="../images/icons/'.$row['type_icon'].'" alt="eventicon" />
					<span>
						<b>'.$row['type_name'].'</b><br />
						<span class="note">'.$row['event_date'].'</span>
					</span>
				</a>';
		}
		
		echo '</div>';
	}
	
	else
	{
		echo '<div class="info">
				<h1>'.$lang['events']['error']['header'].'</h1>
				<p>
					'.$lang['events']['error']['text'].'
				</p>
			</div>';
	}
}

// Ereignis bearbeiten
elseif ('edit' == $tpl['url'][1])
{
	echo '<h1><a href="?ilp='.ilpUrlEncode('events').'">'.$lang['events']['navi']['home'].'</a> | '.$lang['events']['navi']['edit'][0].' <em>'.$tpl['event']['type_name'].'</em> '.$lang['events']['navi']['edit'][1].'</h1>
		<fieldset>
			<legend><img src="../images/icons/cart_put.png" alt="icon" /> '.$lang['events']['loot']['header'].'</legend>
			<table cellpadding="0" cellspacing="1" border="0" class="lootlist">
					<thead>
						<tr>
							<th>
								'.$lang['list']['player'].'
							</th>
							<th>
								'.$lang['list']['item'].'
							</th>
							<th>
								'.$lang['list']['points'].'
							</th>
							<th>
								'.$lang['list']['options'].'
							</th>
						</tr>
					</thead>
					<tfoot>
						<tr>
							<td colspan="4">
								<a href="?ilp='.ilpUrlEncode('events;addloot;'.$tpl['event']['event_id']).'"><img src="../images/icons/cart_add.png" alt="icon" /> '.$lang['events']['addloot']['info'].'</a>
							</td>
						</tr>
					</tfoot>
					<tbody>';
				if (1 <= count($tpl['event']['loots']))
				{
					foreach ($tpl['event']['loots'] as $row)
					{
						echo '<tr>
								<td>
									<img src="../images/icons/'.$row['char']['class'].'.png" alt="wowicon" /><img src="../images/icons/'.$row['char']['class'].$row['char']['spec'].'.png" alt="wowicon" /> <a href="?ilp='.ilpUrlEncode('search;user;'.$row['looter_id']).'" rel="'.getSafeURL('http://armorylite.com/'.$_SESSION['config']['guild_region'].'/'.$_SESSION['config']['guild_realm'].'/'.$row['char']['name']).'" class="class-'.$row['char']['class'].'">'.$row['char']['name'].'</a>
								<td>
									'.getWowheadLink($row['item_id'], $lang['tooltip_locale']).'
								</td>
								<td>
									'.$row['value'].'
								</td>
								<td>
									<a href="?ilp='.ilpUrlEncode('events;deleteloot;'.$row['id'].';'.$tpl['event']['event_id'].';'.$row['looter_id'].';.'.$row['item_id']).'"><img src="../images/icons/cart_delete.png" alt="icon" title="'.$lang['events']['deleteloot']['info'].'" /></a>
								</td>
							</tr>';
					}
				}
				else
				{
					echo '<tr>
							<td colspan="4" class="info">
								'.$lang['error']['noloot']['text'].'
							</td>
						</tr>';
				}
		echo '</tbody>
			</table>
		</fieldset>
		<fieldset>
			<legend><img src="../images/icons/group.png" alt="icon" /> '.$lang['events']['players']['header'].'</legend>
			<table class="itemlist" cellpadding="0" cellspacing="1">
				<thead>
					<tr>
						<th>
							'.$lang['list']['player'].'
						</th>
						<th>
							'.$lang['list']['points'].'
						</th>
						<th>
							'.$lang['list']['options'].'
						</th>
					</tr>
				</thead>
				<tfoot>
					<tr>
						<td colspan="3">';
	if (1 <= count($tpl['event']['attends']))
	{
		echo '<a href="?ilp='.ilpUrlEncode('users;show;addevent;'.$tpl['url'][2]).'"><img src="../images/icons/group_add.png" alt="icon" /> '.$lang['events']['adduser']['header'].'</a>';
	}
	else
	{
		echo '<a href="?ilp='.ilpUrlEncode('events;users;'.$tpl['event']['event_id']).'"><img src="../images/icons/group_add.png" alt="icon" /> '.$lang['events']['adduser']['header'].'</a>';
	}
	echo '</td>
					</tr>
				</tfoot>
				<tbody>';
				
	if (1 <= count($tpl['event']['attends']))
	{
		foreach ($tpl['event']['attends'] as $row)
		{
			echo '<tr>
				<td>
					<a href="?ilp='.ilpUrlEncode('search;user;'.$row['user_id']).'" rel="'.getSafeURL('http://armorylite.com/'.$_SESSION['config']['guild_region'].'/'.$_SESSION['config']['guild_realm'].'/'.$row['char']['name']).'" class="class-'.$row['char']['class'].'"><img src="../images/icons/'.$row['char']['class'].'.png" alt="wowicon" /><img src="../images/icons/'.$row['char']['class'].$row['char']['spec'].'.png" alt="wowicon" /> '.$row['char']['name'].'</a>
				</td>
				<td>
					'.$row['value'].'
				</td>
				<td>
					<a href="?ilp='.ilpUrlEncode('events;deleteuser;'.$row['user_id'].';'.$tpl['event']['event_id']).'"><img src="../images/icons/group_delete.png" alt="icon" /></a>
					<a href="?ilp='.ilpUrlEncode('events;edituser;'.$row['user_id'].';'.$tpl['event']['event_id'].';'.$row['value']).'"><img src="../images/icons/arrow_refresh.png" alt="icon" /></a>
				</td>
			</tr>';
		}
	}
	
	else
	{
		echo '<tr>
			<td colspan="3">
				<span class="info">'.$lang['events']['error']['players'].'</span>
			</td>
		</tr>';
	}
	echo '</tbody>
		</table>
	</fieldset>
	<div id="errorMessage" class="warning">
		<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
		<ul>
			<li><span class="note">'.$lang['error']['note'].'</span></li>
		</ul>
	</div>
	<form method="post" action="?ilp='.ilpUrlEncode('events;edit;do').'" id="editeventform">
		<input type="hidden" name="editevent_event_id" id="editevent_event_id" value="'.$tpl['url'][2].'" />
		<fieldset>
			<legend><img src="../images/icons/date_edit.png" alt="icon" /> '.$lang['events']['navi']['edit'][0].' '.$lang['events']['navi']['edit'][1].'</legend>
			<div class="inputGroup">
				<div class="inputName">
					<label for="editevent_type">
						'.$lang['events']['details']['eventtype'].'
					</label>
				</div>
				<div class="inputField">
					<select name="editevent_type" id="editevent_type" size="1">';

	foreach ($tpl['event']['types'] as $row)
	{
		echo '<option value="'.$row['id'].'"';
		
		if ($tpl['event']['type_id'] == $row['id']) echo ' selected="selected"';
		
		echo '>'.$row['name'].'</option>';
	}
	
	echo '</select>
					<div class="inputDesc">
						<label for="editevent_type">
							'.$lang['events']['details']['typenote'].'
						</label>
					</div>
				</div>
			</div>
			<div class="inputGroup">
				<div class="inputName">
					<label for="editevent_date">
						'.$lang['events']['details']['date'].'
					</label>
				</div>
				<div class="inputField">
					<input type="text" name="editevent_date" id="editevent_date" value="'.$tpl['event']['event_date'].'" />
					<div class="inputDesc">
						<label for="editevent_date">
							'.$lang['events']['details']['datenote'].'
						</label>
					</div>
				</div>
			</div>
			<div class="inputGroup">
				<div class="inputName">
					<label for="editevent_value">
						'.$lang['events']['details']['value'].'
					</label>
				</div>
				<div class="inputField">
					<input type="text" name="editevent_value" id="editevent_value" value="'.$tpl['event']['value'].'" />
					<div class="inputDesc">
						<label for="editevent_value">
							'.$lang['events']['details']['valuenote'].'
						</label>
					</div>
				</div>
			</div>
			<div class="inputGroup">
				<div class="inputName">
					<label for="editevent_comment">
						'.$lang['events']['details']['comment'].'
					</label>
				</div>
				<div class="inputField">
					<textarea cols="45" rows="5" name="editevent_comment" id="editevent_comment">'.$tpl['event']['comment'].'</textarea>
					<div class="inputDesc">
						<label for="editevent_comment">
							'.$lang['events']['details']['commentnote'].'
						</label>
					</div>
				</div>
			</div>
		</fieldset>
		<div>
			<input type="submit" value="'.$lang['events']['navi']['edit'][0].' '.$lang['events']['navi']['edit'][1].'" />
		</div>
	</form>
	<form method="post" action="?ilp='.ilpUrlEncode('events;delete;do').'" id="deleteeventform">
		<input type="hidden" name="deleteevent_event_id" id="deleteevent_event_id" value="'.$tpl['event']['event_id'].'" />
		<fieldset>
			<legend><img src="../images/icons/date_delete.png" alt="icon" /> '.$lang['events']['delete']['header'].'</legend>
			<div class="inputGroup">
				<div class="inputField">
					<input type="text" name="deleteevent_confirm" id="deleteevent_confirm" />
					<div class="inputDesc">
						<label for="deletevent_confirm">
							'.$lang['events']['delete']['confirm'].'
							'.$lang['events']['delete']['note'].'
						</label>
					</div>
				</div>
			</div>
		</fieldset>
		<div>
			<input type="submit" value="'.$lang['events']['delete']['header'].'" />
		</div>
	</form>';
}

// Beute löschen
elseif ('deleteloot' == $tpl['url'][1])
{
	echo '<h1><a href="?ilp='.ilpUrlEncode('events;edit;'.$tpl['url'][3]).'">'.$lang['events']['navi']['home'].'</a> | '.$lang['events']['deleteloot']['confirm']['header'].'</h1>
	<div id="errorMessage" class="warning">
		<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
		<ul>
			<li><span class="note">'.$lang['error']['note'].'</span></li>
		</ul>
	</div>
	<form method="post" action="?ilp='.ilpUrlEncode('events;deleteloot;do').'" id="deletelootform">
		<input type="hidden" name="deleteloot_loot_id" id="deleteloot_loot_id" value="'.$tpl['url'][2].'" />
		<input type="hidden" name="deleteloot_event_id" id="deleteloot_event_id" value="'.$tpl['url'][3].'" />
		<input type="hidden" name="deleteloot_looter_id" id="deleteloot_looter_id" value="'.$tpl['url'][4].'" />
		<input type="hidden" name="deleteloot_item_id" id="deleteloot_item_id" value="'.$tpl['url'][5].'" />
		<input type="hidden" name="dleteloot_confirm_check" id="deleteloot_confirm_check" value="'.$lang['page']['delete'].'" />
		<fieldset>
			<legend><img src="../images/icons/cart_delete.png" alt="icon" /> '.$lang['events']['deleteloot']['confirm']['header'].'</legend>
			<div class="inputGroup">
				<div class="inputField">
					<input type="text" name="deleteloot_confirm" id="deleteloot_confirm" />
					<div class="inputDesc">
						<label for="deleteloot_confirm">
							'.$lang['events']['deleteloot']['confirm']['note'].'
						</label>
					</div>
				</div>
			</div>
		</fieldset>
		<div>
			<input type="submit" value="'.$lang['events']['deleteloot']['confirm']['header'].'" />
		</div>
	</form>';
}

// Beute hinzufügen
elseif ('addloot' == $tpl['url'][1])
{
	echo '<h1>'.$lang['events']['addloot']['info'].'</h1>
	<div id="errorMessage" class="warning">
		<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
		<ul>
			<li><span class="note">'.$lang['error']['note'].'</span></li>
		</ul>
	</div>
	<form method="post" action="?ilp='.ilpUrlEncode('events;addloot;do').'" id="addlootform">
		<fieldset>
			<legend><img src="../images/icons/cart_add.png" alt="icon" /> '.$lang['events']['addloot']['info'].'</legend>
			<div class="inputGroup">
				<div class="inputName">
					<label for="addloot_item_id">
						'.$lang['page']['itemid'].'
					</label>
				</div>
				<div class="inputField" id="searchField">
					<input type="text" name="addloot_item_id" id="addloot_item_id"';
	if (isset($tpl['url'][4])) echo ' value="'.$tpl['url'][4].'"';
	echo '/>
					<div class="inputDesc">
						<label for="addloot_item_id">
							'.$lang['page']['itemidnote'].'
						</label>
					</div>
				</div>
			</div>
			<div class="inputGroup">
				<div class="inputName">
					<label for="addloot_event">
						'.$lang['events']['addloot']['event'].'
					</label>
				</div>
				<div class="inputField">
					<select name="addloot_event" id="addloot_event" size="1">';
		
		foreach ($tpl['events'] as $row)
		{
			echo '<option value="'.$row['id'].'"';
			if (isset($tpl['url'][2]) && '0' != $tpl['url'][2] && $row['id'] == $tpl['url'][2]) echo ' selected="selected"';
			echo '>'.$row['date'].' – '.$row['name'].'</option>';
		}
		
		echo '</select>
					<div class="inputDesc">
						<label for="addloot_event">
							'.$lang['events']['addloot']['eventnote'].'
						</label>							
					</div>
				</div>
			</div>
			<div class="inputGroup">
				<div class="inputName">
					<label for="addloot_user">
						'.$lang['events']['addloot']['user'].'
					</label>
				</div>
				<div class="inputField">
					<select name="addloot_user" id="addloot_user" size="1">';
		
		foreach ($tpl['users'] as $row)
		{
			echo '<option value="'.$row['user_id'].'"';
			if (isset($tpl['url'][3]) && $row['user_id'] == $tpl['url'][3]) echo ' selected="selected"';
			echo '>'.$row['char']['name'].'</option>';
		}
		
		echo '</select>
					<div class="inputDesc">
						<label for="addloot_user">
							'.$lang['events']['addloot']['usernote'].'
						</label>
					</div>
				</div>
			</div>
		</fieldset>
		<div>
			<input type="submit" value="'.$lang['events']['addloot']['info'].'" />
		</div>
	</form>';
}

// Teilnehmer löschen
elseif ('deleteuser' == $tpl['url'][1])
{
	echo '<h1><a href="?ilp='.ilpUrlEncode('events;edit;'.$tpl['url'][3]).'">'.$lang['events']['navi']['home'].'</a> | '.$lang['events']['deleteuser']['header'].'</h1>
	<div id="errorMessage" class="warning">
		<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
		<ul>
			<li><span class="note">'.$lang['error']['note'].'</span></li>
		</ul>
	</div>
	<form method="post" action="?ilp='.ilpUrlEncode('events;deleteuser;do').'" id="deleteuserform">
		<input type="hidden" name="deleteuser_confirm_check" id="deleteuser_confirm_check" value="'.$lang['page']['delete'].'" />
		<input type="hidden" name="deleteuser_user_id" id="deleteuser_user_id" value="'.$tpl['url'][2].'" />
		<input type="hidden" name="deleteuser_event_id" id="deleteuser_event_id" value="'.$tpl['url'][3].'" />
		<fieldset>
			<legend><img src="../images/icons/group_delete.png" alt="icon" /> '.$lang['events']['deleteuser']['header'].'</legend>
			<div class="inputGroup">
				<div class="inputField">
					<input type="text" name="deleteuser_confirm" id="deleteuser_confirm" />
					<div class="inputDesc">
						<label for="deleteuser_confirm">
							'.$lang['events']['deleteuser']['confirm'].'
							'.$lang['events']['deleteuser']['note'].'
						</label>
					</div>
				</div>
			</div>
		</fieldset>
		<div>
			<input type="submit" value="'.$lang['events']['deleteuser']['header'].'" />
		</div>
	</form>';
}

// Teilnahme bearbeiten
elseif ('edituser' == $tpl['url'][1])
{
	echo '<h1><a href="?ilp='.ilpUrlEncode('events;edit;'.$tpl['url'][3]).'">'.$lang['events']['navi']['home'].'</a> | '.$lang['events']['edituser']['header'].'</h1>
	<div id="errorMessage" class="warning">
		<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
		<ul>
			<li><span class="note">'.$lang['error']['note'].'</span></li>
		</ul>
	</div>
	<form method="post" action="?ilp='.ilpUrlEncode('events;edituser;do').'" id="edituserform">
		<input type="hidden" name="edituser_user_id" id="edituser_user_id" value="'.$tpl['url'][2].'" />
		<input type="hidden" name="edituser_event_id" id="edituser_event_id" value="'.$tpl['url'][3].'" />
		<input type="hidden" name="edituser_old_value" id="edituser_old_value" value="'.$tpl['url'][4].'" />
		<fieldset>
			<legend><img src="../images/icons/arrow_refresh.png" alt="icon" /> '.$lang['events']['edituser']['header'].'</legend>
			<div class="inputGroup">
				<div class="inputField">
					<input type="text" name="edituser_value" id="edituser_value" value="'.$tpl['url'][4].'" />
					<div class="inputDesc">
						<label for="edituser_value">
							'.$lang['events']['edituser']['note'].'
						</label>
					</div>
				</div>
			</div>
		</fieldset>
		<div>
			<input type="submit" value="'.$lang['events']['edituser']['header'].'" />
		</div>
	</form>';
}

// Mehrere Teilnehmer hinzufügen
elseif ('users' == $tpl['url'][1])
{
	echo '<h1><a href="?ilp='.ilpUrlEncode('events;edit;'.$tpl['url'][2]).'">'.$lang['events']['navi']['home'].'</a> | '.$lang['events']['users']['header'].'</h1>
	<p>
		'.$lang['events']['users']['text'].'
	</p>
	<div id="errorMessage" class="warning">
		<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
		<ul>
			<li><span class="note">'.$lang['error']['note'].'</span></li>
		</ul>
	</div>
	<form method="post" action="?ilp='.ilpUrlEncode('events;users;do').'" id="addusersform">
		<input type="hidden" name="event_id" id="event_id" value="'.$tpl['url'][2].'" />
		<fieldset class="blocklist">
			<legend><img src="../images/icons/group_add.png" alt="icon" /> '.$lang['events']['users']['header'].'</legend>';
	
	foreach ($tpl['users'] as $row)
	{
		echo '<label for="'.$row['user_id'].'">
			<input type="checkbox" name="users[]" id="'.$row['user_id'].'" value="'.$row['user_id'].'" /> <a  rel="'.getSafeURL('http://armorylite.com/'.$_SESSION['config']['guild_region'].'/'.$_SESSION['config']['guild_realm'].'/'.$row['char']['name']).'" class="class-'.$row['char']['class'].'"><img src="../images/icons/'.$row['char']['class'].'.png" alt="wowicon" /><img src="../images/icons/'.$row['char']['class'].$row['char']['spec'].'.png" alt="wowicon" /> '.$row['char']['name'].'</a></label>';
	}
	
	echo '</fieldset>
		<div>
			<input type="submit" value="'.$lang['events']['users']['header'].'" />
		</div>
	</form>';
}

// Ereignis hinzufügen
elseif ('create' == $tpl['url'][1])
{
	echo '<h1>'.$lang['page']['menu']['create_event'].'</h1>
		<p>
			'.$lang['events']['create']['note'].'
		</p>
		<div id="errorMessage" class="warning">
			<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
			<ul>
				<li><span class="note">'.$lang['error']['note'].'</span></li>
			</ul>
		</div>
		<form method="post" action="?ilp='.ilpUrlEncode('events;create;do').'" id="createeventform">
			<fieldset>
				<legend><img src="../images/icons/date_add.png" alt="icon" /> '.$lang['page']['menu']['create_event'].'</legend>
				<div class="inputGroup">
					<div class="inputName">
						<label for="createevent_type">
							'.$lang['events']['details']['eventtype'].'
						</label>
					</div>
					<div class="inputField">
						<select name="createevent_type" id="createevent_type" size="1">';
	
	foreach ($tpl['event']['types'] as $row)
	{
		echo '<option value="'.$row['id'].'">'.$row['name'].'</option>';
	}
	
	echo '</select>
						<div class="inputDesc">
							<label for="createevent_type">
								'.$lang['events']['details']['typenote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="createevent_date">
							'.$lang['events']['details']['date'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="createevent_date" id="createevent_date" />
						<div class="inputDesc">
							<label for="createevent_date">
								'.$lang['events']['details']['datenote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="createevent_comment">
							'.$lang['events']['details']['comment'].'
						</label>
					</div>
					<div class="inputField">
						<textarea cols="45" rows="5" name="createevent_comment" id="createevent_comment"></textarea>
						<div class="inputDesc">
							<label for="createevent_comment">
								'.$lang['events']['details']['commentnote'].'
							</label>
						</div>
					</div>
				</div>
			</fieldset>
			<div>
				<input type="submit" value="'.$lang['page']['menu']['create_event'].'" />
			</div>
		</form>';
}
?>
Return current item: iLP System