Location: PHPKode > projects > iLP System > Release 2.2/upload/_backend/lib/templates/tpl.search.php
<?php
/**
 * iLP System Template: Suche (Backend)
 * 
 * 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['search']['navi']['home'].'</h1>
		<p>
			'.$lang['search']['home']['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('search;item;do').'" id="itemsearch">
			<fieldset>
				<legend><img src="../images/icons/magnifier.png" alt="icon" /> '.$lang['search']['home']['header'].'</legend>
				<div class="inputGroup">
					<div class="inputField" id="searchField">
						<input type="text" id="searchitem_term" name="searchitem_term" />
						<div class="inputDesc">
							<label for="searchitem_term">
								'.$lang['search']['home']['desc'].'<br />'.$lang['page']['itemidnote'].'
							</label>
						</div>
					</div>
				</div>
			</fieldset>
			<div>
				<input type="submit" value="'.$lang['search']['navi']['home'].'" />
			</div>
		</form>';
}

elseif (isset($tpl['url'][1]))
{
	if ('item' == $tpl['url'][1])
	{
		echo '<h1><a href="?ilp='.ilpUrlEncode('search').'">'.$lang['search']['navi']['home'].'</a> | '.$lang['search']['navi']['items'].' <em>&quot;'.$tpl['search']['term'].'&quot;</em></h1>';
	
		if (isset($tpl['search']['list'][0]))
		{
			echo '<p>
					'.$lang['search']['results']['list'].':
				</p>
				<fieldset>
					<legend><img src="../images/icons/magnifier.png" alt="icon" /> Auf Listen gefunden</legend>
					<table cellpadding="0" cellspacing="1" border="0" class="itemlist">
						<thead>
							<tr>
								<th>
									'.$lang['list']['player'].'
								</th>
								<th>
									'.$lang['list']['item'].'
								</th>
								<th>
									'.$lang['list']['points'].'
								</th>
								<th>
									'.$lang['list']['options'].'
								</th>
							</tr>
						</thead>
						<tbody>';
			
			foreach ($tpl['search']['list'] as $row)
			{
				// Charakterstring in Array umwandeln
				$row['char'] = unserialize($row['char']);
				
				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['user_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>
						<td>
							'.getWowheadLink($row['item_id'], $lang['tooltip_locale']).'
						</td>
						<td>
							'.$row['item_value'].'
						</td>
						<td>
							<a href="?ilp='.ilpUrlEncode('events;addloot;0;'.$row['user_id'].';'.$row['item_id']).'" title="'.$lang['events']['addloot']['info'].'"><img src="../images/icons/cart_add.png" alt="icon" /></a>
						</td>
					</tr>';
			}
			
			echo '</tbody>
				</table>
				</fieldset>';
		}
		
		if (isset($tpl['search']['loot'][0]))
		{
			echo '<p>
					'.$lang['search']['results']['loot'].':
				</p>
				<fieldset>
					<legend><img src="../images/icons/magnifier.png" alt="icon" /> In Ereignissen gefunden</legend>
					<table cellpadding="0" cellspacing="1" border="0" class="lootlist">
						<thead>
							<tr>
								<th>
									'.$lang['list']['player'].'
								</th>
								<th>
									'.$lang['list']['event'].'
								</th>
								<th>
									'.$lang['list']['date'].'
								</th>
								<th>
									'.$lang['list']['item'].'
								</th>
								<th>
									'.$lang['list']['points'].'
								</th>
								<th>
									'.$lang['list']['options'].'
								</th>
							</tr>
						</thead>
						<tbody>';
			
			foreach ($tpl['search']['loot'] as $row)
			{
				// Charakterstring in Array umwandeln
				$row['char'] = unserialize($row['char']);
				
				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>
						<td>
							<a href="?ilp='.ilpUrlEncode('start;events;detail;'.$row['event_id']).'">'.$row['name'].'</a>
						</td>
						<td>
							'.$row['date'].'
						</td>
						<td>
							'.getWowheadLink($row['item_id'], $lang['tooltip_locale']).'
						</td>
						<td>
							'.$row['value'].'
						</td>
						<td>
							<a href="?ilp='.ilpUrlEncode('events;deleteloot;'.$row['id'].';'.$row['event_id']).'" title="'.$lang['events']['addloot']['info'].'"><img src="../images/icons/cart_delete.png" alt="icon" /></a>
					</tr>';
			}
			
			echo '</table>
				</fieldset>';
		}
	}
	
	// Benutzerprofil anzeigen
	elseif ('user' == $tpl['url'][1])
	{
		echo '<h1>'.$lang['search']['user']['header'].' '.$tpl['search']['user']['char']['name'].'</h1>
		<div id="statistics">
			'.$tpl['search']['user']['charinfo'].'
			<div id="stats">
				<b>'.$lang['statistics']['attendance'].':</b> <span class="percent ';
				
				if (33 >= $tpl['search']['user']['stats']['attendance'])
				{
					echo 'low';
				}
				elseif (66 >= $tpl['search']['user']['stats']['attendance'])
				{
					echo 'middle';
				}
				else {
					echo 'high';
				}
				
				echo '" style="float: right;">'.getProgressBar(100, $tpl['search']['user']['stats']['attendance']).' '.$tpl['search']['user']['stats']['attendance'].'%</span><br />
				<b>'.$lang['statistics']['ninja'].':</b> <span class="percent ';
				
				if (33 >= $tpl['search']['user']['stats']['ninja'])
				{
					echo 'low';
				}
				elseif (66 >= $tpl['search']['user']['stats']['ninja'])
				{
					echo 'middle';
				}
				else {
					echo 'high';
				}
				
				echo '" style="float: right;">'.getProgressBar(100, $tpl['search']['user']['stats']['ninja']).' '.$tpl['search']['user']['stats']['ninja'].'%</span><br />
				<b>'.$lang['statistics']['tea'].':</b><span class="percent ';
				
				if (33 >= $tpl['search']['user']['stats']['tea'])
				{
					echo 'low';
				}
				elseif (66 >= $tpl['search']['user']['stats']['tea'])
				{
					echo 'middle';
				}
				else {
					echo 'high';
				}
				
				echo '" style="float: right;">'.getProgressBar(100, $tpl['search']['user']['stats']['tea']).' '.$tpl['search']['user']['stats']['tea'].'%</span><br />
				<b>'.$lang['statistics']['events'].':</b> '.$tpl['search']['user']['stats']['event_count'].'<br />
				<b>'.$lang['statistics']['loot'].':</b> '.$tpl['search']['user']['stats']['loot_count'].'<br />
				<b>'.$lang['statistics']['gained'].':</b> '.$tpl['search']['user']['stats']['event_value'].'<br />
				<b>'.$lang['statistics']['spent'].':</b> '.$tpl['search']['user']['stats']['loot_value'].'
			</div>
		</div>
		<table cellpadding="0" cellspacing="1" border="0" class="itemlist">
			<thead>
				<tr>
					<th>
						'.$lang['list']['item'].'
					</th>
					<th>
						'.$lang['list']['points'].'
					</th>
					<th>
						'.$lang['list']['options'].'
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="3">';
			
		if ($_SESSION['config']['default_slots'] <= $tpl['list_length'])
		{
			echo '<span class="warning"><img src="../images/icons/cross.png" alt="icon" /> '.$lang['list']['home']['full'].'</span>';
		}
		else
		{
			echo '<a href="?ilp='.ilpUrlEncode('users;list;add;'.$tpl['search']['user']['user_id']).'"><img src="../images/icons/add.png" alt="icon" /> '.$lang['list']['navi']['add'].'</a>';
		}
	
		echo '</td>
				</tr>';
				
		if (1 == $tpl['search']['user']['locked'])
		{
			echo '<tr>
					<td colspan="3" class="listLocked">
						<a href="?ilp='.ilpUrlEncode('users;list;unlock;'.$tpl['search']['user']['user_id']).'"><img src="../images/icons/lock_open.png" alt="icon" /> '.$lang['search']['user']['islocked']['unlock'].'</a>
					</td>
				</tr>';
		}
		else
		{
			echo '<tr>
					<td colspan="3" class="listUnlocked">
						<a href="?ilp='.ilpUrlEncode('users;list;lock;'.$tpl['search']['user']['user_id']).'"><img src="../images/icons/lock.png" alt="icon" /> '.$lang['search']['user']['unlocked']['lock'].'</a>
					</td>
				</tr>';
		}
			echo '</tfoot>
			<tbody>';
	
		if (1 <= count($tpl['search']['user']['list']))
		{
			foreach ($tpl['search']['user']['list'] as $row)
			{
				echo '<tr>
						<td>
							'.getWowHeadLink($row['item_id'], $lang['tooltip_locale']).'
						</td>
						<td>
							'.$row['item_value'].'
						</td>
						<td>
							<a href="?ilp='.ilpUrlEncode('users;list;delete;'.$row['id'].';'.$row['item_id'].';'.$tpl['search']['user']['user_id']).'"><img src="../images/icons/delete.png" alt="icon" title="'.$lang['list']['navi']['delete'].'" /></a>
							<a href="?ilp='.ilpUrlEncode('users;list;edit;'.$row['id'].';'.$row['item_id'].';'.$tpl['search']['user']['user_id'].';'.$row['item_value']).'"><img src="../images/icons/arrow_refresh.png" alt="icon" title="'.$lang['list']['navi']['change'].'" /></a>
							<a href="?ilp='.ilpUrlEncode('events;addloot;0;'.$tpl['search']['user']['user_id'].';'.$row['item_id']).'" title="'.$lang['events']['addloot']['info'].'"><img src="../images/icons/cart_add.png" alt="icon" /></a>
						</td>
					</tr>';
			}
		}
		else
		{
			echo '<tr>
					<td colspan="3" class="info">
						'.$lang['error']['noitems']['text'].'
					</td>
				</tr>';
		}
		echo '
				</tbody>
			</table>
			<fieldset>
				<legend><img src="../images/icons/magnifier.png" alt="icon" /> '.$tpl['search']['user']['char']['name'].' '.$lang['search']['user']['events'].'</legend>
				<div class="blocklist eventList">';
		
		foreach ($tpl['search']['user']['events'] as $row)
		{
			echo '<a href="?ilp='.ilpUrlEncode('events;edit;'.$row['event_id']).'">
					<img src="../images/icons/'.$row['icon'].'" alt="icon" />
					<span>
						<b>'.$row['name'].'</b><br />
						<span class="note">'.$row['date'].'</span>
					</span>
				</a>';
		}
		
		if (1 <= $tpl['search']['check_events'])
		{
			echo '<br /><a href="?ilp='.ilpUrlEncode('users;events;add;'.$tpl['search']['user']['user_id']).'">
					<img src="../images/icons/group_add.png" alt="icon" />
					<span>
						<b>'.$lang['search']['user']['addevent'].'</b>
					</span>
				</a>';
		}
		else
		{
			echo '<span class="info">'.$lang['search']['user']['events_error'].'</span>';
		}
		
		echo '</div>
				</fieldset>
				<fieldset>
					<legend><img src="../images/icons/magnifier.png" alt="icon" /> '.$tpl['search']['user']['char']['name'].' '.$lang['search']['user']['loots'].'</legend>
					<table cellpadding="0" cellspacing="1" border="0" class="lootlist">
						<thead>
							<tr>
								<th>
									'.$lang['list']['event'].'
								</th>
								<th>
									'.$lang['list']['date'].'
								</th>
								<th>
									'.$lang['list']['item'].'
								</th>
								<th>
									'.$lang['list']['points'].'
								</th>
								<th>
									'.$lang['list']['options'].'
								</th>
							</tr>
						</thead>';
		if (1 <= $tpl['search']['check_events'])
		{
			echo '<tfoot>
							<tr>
								<td colspan="5">
									<a href="?ilp='.ilpUrlEncode('events;addloot;0;'.$tpl['search']['user']['user_id']).'"><img src="../images/icons/cart_add.png" alt="icon" /> '.$lang['events']['addloot']['info'].'</a>
								</td>
							</tr>
						</tfoot>';
		}
		
		echo '<tbody>';
		
				if (1 <= count($tpl['search']['user']['loots']))
				{
					foreach ($tpl['search']['user']['loots'] as $row)
					{
						echo '<tr>
								<td>
									<a href="?ilp='.ilpUrlEncode('events;edit;'.$row['event_id']).'">'.$row['name'].'</a>
								</td>
								<td>
									'.$row['date'].'
								</td>
								<td>
									'.getWowheadLink($row['item_id'], $lang['tooltip_locale']).'
								</td>
								<td>
									'.$row['value'].'
								</td>
								<td>
									<a href="?ilp='.ilpUrlEncode('events;deleteloot;'.$row['id'].';'.$row['event_id'].';'.$row['looter_id'].';'.$row['item_id']).'"><img src="../images/icons/cart_delete.png" alt="icon" title="'.$lang['list']['navi']['delete'].'" /></a>
								</td>
							</tr>';
					}
				}
				else
				{
					echo '<tr>
							<td colspan="5" class="info">
								'.$lang['error']['noloot']['text'].'
							</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('users;edit;settings').'" id="userform">
			<input type="hidden" name="settings_user_id" id="settings_user_id" value="'.$tpl['search']['user']['user_id'].'" />
			<fieldset>
				<legend><img src="../images/icons/cog.png" alt="icon" /> '.$lang['settings']['navi']['home'].'</legend>
				<div class="inputGroup">
					<div class="inputName">
						<label for="settings_login">
							'.$lang['search']['user']['settings']['username'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="settings_login" id="settings_login" value="'.$tpl['search']['user']['login'].'" />
						<div class="inputDesc">
							<label for="settings_login">
								'.$lang['search']['user']['settings']['usernote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="settings_new_password">
							'.$lang['search']['user']['settings']['new_pw'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="settings_new_password" id="settings_new_password" />
						<div class="inputDesc">
							<label for="settings_new_password">
								'.$lang['search']['user']['settings']['pwnote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="settings_new_password_confirm">
							'.$lang['settings']['pw_confirm'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="settings_new_password_confirm" id="settings_new_password_confirm" />
						<div class="inputDesc">
							<label for="settings_new_password_confirm">
								'.$lang['settings']['pw_confirmnote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="settings_new_email">
							'.$lang['search']['user']['settings']['email'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="settings_new_email" id="settings_new_email" value="'.$tpl['search']['user']['email'].'" />
						<div class="inputDesc">
							<label for="settings_new_email">
								'.$lang['search']['user']['settings']['mailnote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="settings_officer">
							'.$lang['search']['user']['settings']['officer'].'
						</label>
					</div>
					<div class="inputField">
						<select name="settings_officer" id="settings_officer">
							<option value="0"';
		if (0 == $tpl['search']['user']['officer']) echo ' selected="selected"';
		echo '>'.$lang['page']['no'].'</option>
							<option value="1"';
		if (1 == $tpl['search']['user']['officer']) echo ' selected="selected"';
		echo '>'.$lang['page']['yes'].'</option>
						</select>
						<div class="inputDesc">
							<label for="settings_officer">
								'.$lang['search']['user']['settings']['officernote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						'.$lang['search']['user']['settings']['char']['current'].'
					</div>
					<div class="inputField">
						<span>
							<img src="../images/icons/'.$tpl['search']['user']['char']['class'].'.png" alt="wowicon" /><img src="../images/icons/'.$tpl['search']['user']['char']['class'].$tpl['search']['user']['char']['spec'].'.png" alt="wowicon" /> <a href="?ilp='.ilpUrlEncode('search;user;'.$tpl['user']['id']).'" rel="'.getSafeURL('http://armorylite.com/'.$_SESSION['config']['guild_region'].'/'.$_SESSION['config']['guild_realm'].'/'.$tpl['search']['user']['char']['name']).'" class="class-'.$tpl['search']['user']['char']['class'].'">'.$tpl['search']['user']['char']['name'].'</a>
						</span>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="settings_char_class">
							'.$lang['search']['user']['settings']['char']['newclass'].'
						</label>
					</div>
					<div class="inputField">
						<select name="settings_char_class" id="settings_char_class">';
		
		foreach ($lang['class'] as $key => $row)
		{
			echo '<optgroup label="'.$row['title'].'">';
			
			for ($i=1;$i<=3;$i++)
			{
				echo '<option ';
				
				if ($key.$i == $tpl['search']['user']['char']['class'].$tpl['search']['user']['char']['spec'])
				{
					echo 'selected="selected" ';
				}
				
				echo 'value="'.$key.$i.'">'.$row[$key.$i].'</option>';
			}
			
			echo '</optgroup>';
		}
		
						echo '</select>
						<div class="inputDesc">
							<label for="settings_char_class">
								'.$lang['search']['user']['settings']['char']['classnote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="settings_char_name">
							'.$lang['search']['user']['settings']['char']['newname'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="settings_char_name" id="settings_char_name" value="'.$tpl['search']['user']['char']['name'].'" />
						<div class="inputDesc">
							<label for="settings_char_name">
								'.$lang['search']['user']['settings']['char']['namenote'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputName">
						<label for="settings_correction">
							'.$lang['search']['user']['settings']['correction'].'
						</label>
					</div>
					<div class="inputField">
						<input type="text" name="settings_correction" id="settings_correction" />
						<div class="inputDesc">
							<label for="settings_correction">
								'.$lang['search']['user']['settings']['correctionnote'].'
							</label>
						</div>
					</div>
				</div>
			</fieldset>
			<div>
				<input type="submit" value="'.$lang['search']['user']['settings']['submit'].'" />
			</div>
		</form>
		<form method="post" action="?ilp='.ilpUrlEncode('users;delete;'.$tpl['search']['user']['user_id']).'">
			<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['search']['user']['user_id'].'" />
			<fieldset>
				<legend><img src="../images/icons/user_delete.png" alt="icon" /> '.$lang['search']['user']['deleteuser'].'</legend>
				<div class="inputGroup">
					<div class="inputField">
						<input type="text" name="deleteuser_confirm" id="deleteuser_confirm" />
						<div class="inputDesc">
							<label for="deleteuser_confirm">
								'.$lang['search']['user']['delete']['confirm']['note'].'
							</label>
						</div>
					</div>
				</div>
				<div class="inputGroup">
					<div class="inputField">
						<input type="checkbox" name="deleteuser_complete" id="deleteuser_complete" /> '.$lang['search']['user']['delete']['complete'].'
						<div class="inputDesc">
							<label for="deleteuser_complete">
								'.$lang['search']['user']['delete']['completenote'].'
							</label>
						</div>
					</div>
				</div>
			</fieldset>
			<div>
				<input type="submit" value="'.$lang['search']['user']['deleteuser'].'" />
			</div>
		</form>';
	}
}

if (isset($tpl['search']['error']) && 2 == $tpl['search']['error'])
{
	echo '<div class="info">
			<h1>'.$lang['search']['error']['header'].'</h1>
			<p>
				'.$lang['search']['error']['text'].'
			</p>
			<p>
				<a href="?ilp='.ilpUrlEncode('search').'">&lt;&lt; '.$lang['page']['back'].'</a>
			</p>
		</div>';
}
?>
Return current item: iLP System