Location: PHPKode > projects > iLP System > Release 2.2/upload/_backend/lib/templates/tpl.users.php
<?php
/**
 * iLP System Template: Benutzerprofil und -einstellungen
 * 
 * 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['users']['navi']['home'].'</h1>';
	
	if (!isset($tpl['users']['error']))
	{
		echo '<div class="blocklist">';
		
		foreach ($tpl['users'] as $row)
		{
		
			// Check, if a clicked user should be added to an already existing event
			if (isset($tpl['url'][2]) && 'addevent' == $tpl['url'][2])
			{
				$href = ilpUrlEncode('users;events;add;'.$row['user_id'].';'.$tpl['url'][3]);
			}
			
			// Otherwise, link to his profile
			else
			{
				$href = ilpUrlEncode('search;user;'.$row['user_id']);
			}
			
			echo '<a href="?ilp='.$href.'" 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>';
		}
		
		echo '</div>';
	}
	else
	{
		echo '<div class="info">
				<h1>'.$lang['users']['show']['error']['header'].'</h1>
				<p>
					'.$lang['users']['show']['error']['text'].'
				</p>
			</div>';
	}
}

// Benutzer erstellen
elseif (isset($tpl['url'][1]) && 'create' == $tpl['url'][1])
{
	echo '<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('users;create;do').'" id="createuserform">
			<fieldset>
				<legend><img src="../images/icons/user_add.png" alt="icon" /> '.$lang['page']['menu']['create_user'].'</legend>
				<div class="inputGroup">
					<div class="inputName">
						<label for="createuser_login">
							'.$lang['search']['user']['settings']['username'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="createuser_login" id="createuser_login" />
						<div class="inputDesc">
							<label for="createuser_login">
								'.$lang['search']['user']['settings']['usernote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label>
							'.$lang['users']['create']['pw'].'
						</label>
					</div>
					<div class="inputField">
						<span class="note">'.$lang['users']['create']['pwnote'].'</span>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="createuser_email">
							'.$lang['search']['user']['settings']['email'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="createuser_email" id="createuser_email" />
						<div class="inputDesc">
							<label for="createuser_email">
								'.$lang['search']['user']['settings']['mailnote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="createuser_officer">
							'.$lang['search']['user']['settings']['officer'].'
						</label>
					</div>
					<div class="inputField">
						<select name="createuser_officer" id="createuser_officer">
							<option value="0">'.$lang['page']['no'].'</option>
							<option value="1">'.$lang['page']['yes'].'</option>
						</select>
						<div class="inputDesc">
							<label for="createuser_officer">
								'.$lang['search']['user']['settings']['officernote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="createuser_char_class">
							'.$lang['users']['create']['char']['class'].'
						</label>
					</div>
					<div class="inputField">
						<select name="createuser_char_class" id="createuser_char_class">';
		
		foreach ($lang['class'] as $key => $row)
		{
			echo '<optgroup label="'.$row['title'].'">';
			
			for ($i=1;$i<=3;$i++)
			{
				echo '<option value="'.$key.$i.'">'.$row[$key.$i].'</option>';
			}
			
			echo '</optgroup>';
		}
		
						echo '</select>
						<div class="inputDesc">
							<label for="createuser_char_class">
								'.$lang['users']['create']['char']['classnote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="createuser_char_name">
							'.$lang['users']['create']['char']['name'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="createuser_char_name" id="createuser_char_name" />
						<div class="inputDesc">
							<label for="createuser_char_name">
								'.$lang['users']['create']['char']['namenote'].'
							</label>
						</div>
					</div>
				</div>
			</fieldset>
			<div>
				<input type="submit" value="'.$lang['page']['menu']['create_user'].'" />
			</div>
		</form>';
}

// Gegenstand zu einer Liste hinzufügen
elseif (isset($tpl['url'][1]) && 'list' == $tpl['url'][1])
{
	if (isset($tpl['url'][2]))
	{
		
		// Gegenstand hinzufügen
		if ('add' == $tpl['url'][2])
		{
			echo '<h1><a href="?ilp='.ilpUrlEncode('search;user;'.$tpl['url'][3]).'">'.$lang['users']['navi']['home'].'</a> | '.$lang['list']['navi']['add'].'</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 action="?ilp='.ilpUrlEncode('users;list;add;do').'" method="post" id="additemForm">
				<input type="hidden" name="additem_user_id" value="'.$tpl['url'][3].'" />
				<fieldset>
					<legend>
						<img src="../images/icons/add.png" alt="icon" /> '.$lang['list']['navi']['add'].'
					</legend>
					<div class="inputGroup">
						<div class="inputName">
							<label for="additem_item_id">
								'.$lang['page']['itemid'].'
							</label>
						</div>
						<div class="inputField">
							<input type="text" id="additem_item_id" name="additem_item_id" />
							<div class="inputDesc">
								<label for="additem_item_id">
									'.$lang['page']['itemidnote'].'
								</label>
							</div>
						</div>
					</div>
					<div class="inputGroup">
						<div class="inputName">
							<label for="additem_value">
								'.$lang['users']['list']['add']['value'].'
							</label>
						</div>
						<div class="inputField">
							<input type="text" name="additem_value" id="additem_value" value="0" />
							<div class="inputDesc">
								<label for="additem_value">
									'.$lang['users']['list']['add']['valuenote'].'
								</label>
							</div>
						</div>
					</div>
				</fieldset>
				<div>
					<input type="submit" value="'.$lang['list']['navi']['add'].'" />
				</div>
			</form>';
		}
		
		elseif ('delete' == $tpl['url'][2])
		{
			echo '<h1><a href="?ilp='.ilpUrlEncode('search;user;'.$tpl['url'][5]).'">'.$lang['users']['navi']['home'].'</a> | '.$lang['list']['navi']['delete'].'</h1>
			<div class="info">
				<h1>'.$lang['users']['list']['delete']['info']['header'].'</h1>
				<p>
					'.$lang['users']['list']['delete']['info']['text'][0].getWowheadLink($tpl['url'][4], $lang['tooltip_locale']).$lang['users']['list']['delete']['info']['text'][1].'
				</p>
				<p>
					'.$lang['users']['list']['delete']['info']['text'][2].'
				</p>
			</div>
			<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('users;list;delete;do').'" id="deleteitemForm">
				<input type="hidden" name="deleteitem_user_id" value="'.$tpl['url'][5].'" />
				<input type="hidden" name="deleteitem_id" value="'.$tpl['url'][3].'" />
				<input type="hidden" name="deleteitem_item_id" value="'.$tpl['url'][4].'" />
				<input type="hidden" name="deleteitem_confirm_check" id="deleteitem_confirm_check" value="'.$lang['users']['list']['delete']['confirm']['delete'].'" />
				<fieldset>
					<legend><img src="../images/icons/delete.png" alt="icon" /> '.$lang['users']['list']['delete']['confirm']['head'].'</legend>
					<div class="inputGroup">
						<div class="inputField">
							<input type="text" id="deleteitem_confirm" name="deleteitem_confirm" class="required" />
							<div class="inputDesc">
								<label for="deleteitem_confirm">
									'.$lang['users']['list']['delete']['confirm']['note'].'
								</label>
							</div>
						</div>
					</div>
				</fieldset>
				<div>
					<input type="submit" value="'.$lang['list']['navi']['delete'].'" />
				</div>
			</form>';
		}
		
		elseif ('edit' == $tpl['url'][2])
		{
			echo '<h1><a href="?ilp='.ilpUrlEncode('search;user;'.$tpl['url'][5]).'">'.$lang['users']['navi']['home'].'</a> | '.$lang['list']['navi']['change'].'</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('users;list;edit;do').'" id="edititemForm">
					<input type="hidden" name="edititem_user_id" value="'.$tpl['url'][5].'" />
					<input type="hidden" name="edititem_old_value" value="'.$tpl['url'][6].'" />
					<input type="hidden" name="edititem_id" value="'.$tpl['url'][3].'" />
					<input type="hidden" name="edititem_item_id" value="'.$tpl['url'][4].'" />
					<fieldset>
						<legend><img src="../images/icons/arrow_refresh.png" alt="icon" /> '.$lang['list']['navi']['change'].'</legend>
					<div class="inputGroup">
						<div class="inputName">
							<label for="edititem_new_id">
								'.$lang['page']['itemid'].'
							</label>
						</div>
						<div class="inputField">
							<input type="text" id="edititem_new_id" name="edititem_new_id" value="'.$tpl['url'][4].'" />
							<div class="inputDesc">
								<label for="edititem_item_id">
									'.$lang['users']['list']['edit']['note'].'<br />
									'.$lang['page']['itemidnote'].'
								</label>
							</div>
						</div>
					</div>
					<div class="inputGroup">
						<div class="inputName">
							<label for="edititem_value">
								'.$lang['users']['list']['edit']['value'].'
							</label>
						</div>
						<div class="inputField">
							<input type="text" name="edititem_value" id="edititem_value" value="'.$tpl['url'][6].'" />
							<div class="inputDesc">
								<label for="edititem_value">
									'.$lang['users']['list']['edit']['valuenote'].'
								</label>
							</div>
						</div>
					</div>
				</fieldset>
				<div>
					<input type="submit" value="'.$lang['list']['navi']['change'].'" />
				</div>
			</form>';
		}
	}
}

// Ereignisfunktionen
elseif (isset($tpl['url'][1]) && 'events' == $tpl['url'][1])
{
	
	// Teilnahme bei Ereignis hinzufügen
	if (isset($tpl['url'][2]) && 'add' == $tpl['url'][2])
	{
		echo '<h1><a href="?ilp='.ilpUrlEncode('search;user;'.$tpl['url'][3]).'">'.$lang['users']['navi']['home'].'</a> | '.$lang['users']['navi']['addevent'].'</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('users;events;add;do').'" id="addeventform">
				<input type="hidden" name="addevent_user_id" id="addevent_user_id" value="'.$tpl['url'][3].'" />
				<fieldset>
					<legend><img src="../images/icons/group_add.png" alt="icon" /> '.$lang['users']['navi']['addevent'].'</legend>
					<div class="inputGroup">
						<div class="inputName">
							<label for="addevent_eventname">
								'.$lang['users']['events']['add']['eventname'].'
							</label>
						</div>
						<div class="inputField">
							<select name="addevent_eventname" id="addevent_eventname" size="1">';
		
		foreach ($tpl['events'] as $row)
		{
			echo '<option value="'.$row['id'].'"';
			
			if (isset($tpl['url'][4]) && $row['id'] == $tpl['url'][4])
			{
				echo ' selected="selected"';
			}
			
			echo '>'.$row['date'].' – '.$row['name'].'</option>';
		}
		
		echo '</select>
							<div class="inputDesc">
								<label for="addevent_eventname">
									'.$lang['users']['events']['add']['namenote'].'
								</label>							
							</div>
						</div>
					</div>
					<div class="inputGroup">
						<div class="inputName">
							<label for="addevent_points">
								'.$lang['users']['events']['add']['points'].'
							</label>
						</div>
						<div class="inputField">
							<input type="text" name="addevent_points" id="addevent_points" />
							<div class="inputDesc">
								<label for="addevent_points">
									'.$lang['users']['events']['add']['pointnote'].'
								</label>
							</div>
						</div>
					</div>
				</fieldset>
				<div>
					<input type="submit" value="'.$lang['users']['navi']['addevent'].'" />
				</div>
			</form>';
	}
}
?>
Return current item: iLP System