<?php

function template_add_warning()
{
	global $context, $settings, $options, $txt, $scripturl, $modSettings;

	echo' 
		<table width="96%" cellspacing="1">
			<tr>
				<td width="100%" class="catbg" align="center" colspan="2">
					<font size="2">' . $txt['visual_warning_management'] . '</font>
				</td>
			</tr>';
	if (!isset($context['previous']))
		echo' 
			<tr>
				<td width="100%" class="windowbg" align="center" colspan="2">
					<font size="2">' . $txt['visual_no_warnings'] . '</font>
				</td>
			</tr>';
	else
	{
	echo'
			<tr>
				<td width="100%" class="windowbg" align="center" colspan="2">
					<font size="2">' . $txt['visual_prev_warning'] . '</font>
				</td>
			</tr>
			<tr>
				<td width="50%" align="right" class="windowbg">
					<font size="2">' . $txt['visual_current_level'] . '</font>
				</td>
				<td width="50%" align="left" class="windowbg">
					<font size="2">';
	if ($context['previous']['level'] == 0)
		echo $txt['visual_none'];
	elseif ($context['previous']['level'] == 1)
		echo $txt['visual_text_warn'];
	elseif ($context['previous']['level'] == 2)
		echo $txt['visual_text_pmod'];
	elseif ($context['previous']['level'] == 3)
		echo $txt['visual_text_mute'];
	else
		echo $txt['visual_text_ban'];
	echo'
					</font>
				</td>
			</tr><tr>
				<td valign="top" width="50%" align="right" class="windowbg">
					<font size="2">' . $txt['visual_topic_raised'] . '</font>
				</td>
				<td width="50%" align="left" class="windowbg" border="2">
					<font size="2">' . $context['previous']['body'] . '</font>
				</td>
			</tr><tr>
				<td width="50%" align="right" class="windowbg">
					<font size="2">' . $txt['visual_time_raised'] . '</font>
				</td>
				<td width="50%" align="left" class="windowbg">
					<font size="2">' . $context['previous']['time'] . '</font>
				</td>
			</tr><tr>
				<td width="50%" align="right" class="windowbg">
					<font size="2">' . $txt['visual_reason_raised'] . '</font>
				</td>
				<td width="50%" align="left" class="windowbg">
					<font size="2">' . $context['previous']['warningtext'] . '</font>
				</td>
			</tr>';
	}
	echo'
		</table>
	<br />
	<form action="' . $scripturl . '?action=warnadd2" method="post" enctype="multipart/form-data">
		<table width="96%" cellpadding="0" cellspacing="0">
			<tr>
				<td class="catbg" width="100%" colspan="2" align="center">
					<font size=2>' . $txt['visual_level_details'] . '</font>
				</td>
			</tr><tr>
				<td class="windowbg" width="50%">
					<font size=2>' . $txt['visual_new_level'] . '</font>
				</td>
				<td class="windowbg" width="50%">
					<input name="level" type="text" value="0" maxlength="2" size="2" />' . $txt['visual_stages'] . '
				</td>
			</tr><tr>
				<td class="windowbg" width="50%">
					<font size=2>' . $txt['visual_lasts'] . ':</font>
				</td>
				<td class="windowbg" width="50%">
					<input name="timelast" type="text" value="" maxlength="2" size="2" />
				</td>
			</tr><tr>
				<td class="windowbg" width="50%" valign="top">
					<font size=2>' . $txt['visual_reason_raised'] . '</font>
				</td>
				<td class="windowbg" width="50%">
					<textarea name="warningmsg" ROWS="8" COLS="64"></textarea>
				</td>
			</tr><tr>
				<td class="windowbg" width="100%" colspan="2" align="center">
					<input type="submit" value="' . $txt['visual_submit'] . '" >
				</td>
			</tr>
			<input type="hidden" name="topic" value="' . $context['topic'] . '">
			<input type="hidden" name="user" value="' . $context['memberID'] . '">
			<input type="hidden" name="msg" value="' . $context['msg'] . '">
			<input type="hidden" name="start" value="' . $context['start'] . '">
			<input type="hidden" name="back" value="' . $context['back'] . '">
			<input type="hidden" name="warnid" value="' . (isset($context['previous']['warnid']) ? $context['previous']['warnid'] : -1) . '">
		</table>
	</form>';	

}

function template_list_warnings()
{
	global $context, $settings, $options, $txt, $scripturl, $modSettings;

	echo' 
		<form action="' . $scripturl . '?action=warnlist2" method="post" enctype="multipart/form-data">
			<table border="0" cellspacing="1" cellpadding="5" class="tborder" align="center">
				<tr>
					<td class="titlebg" colspan="5">
						<img src="' . $settings['images_url'] . '/members.gif" alt="" border="0" />
						&nbsp;<font size="2"><b>' . $txt['visual_warning_management'] . '</b></font>
					</td>
				</tr><tr>
					<td colspan="5" class="windowbg">
						<font size="2">' . $txt['visual_list_desc'] . '</font>
					</td>
				</tr>
				<tr>
					<td width="4%" class="catbg" align="center">
					</td>
					<td width="15%" class="catbg" align="center">
						<font size="2">' . $txt['visual_member'] . '</font>
					</td>
					<td width="10%" class="catbg" align="center">
						<font size="2">' . $txt['visual_level'] . '</font>
					</td>
					<td width="45%" class="catbg" align="center">
						<font size="2">' . $txt['visual_reason'] . '</font>
					</td>
					<td width="26%" class="catbg" align="center">
						<font size="2">' . $txt['visual_when'] . '</font>
					</td>
				</tr>';
	foreach ($context['warnings'] as $warning)
	echo'
				<tr>
					<td width="4%" class="windowbg"align="center">
						<input type="checkbox" name="lower[' . $warning['memberID'] . ']" value="lower_' . $warning['memberID'] . '" />
					</td>
					<td width="15%" class="windowbg" align="left">
						<a href="' . $scripturl . '?action=warnadd;user=' . $warning['memberID'] . ';back=warnlist">' . $warning['memberName'] . ' (' . $warning['realName'] . ')</a>
					</td>
					<td width="10%" class="windowbg"align="left">
						<font size="2">' . $warning['level'] . '</font>
					</td>
					<td width="45%" class="windowbg" align="left">
						<font size="2">' . $warning['warningText'] . '</font>
					</td>
					<td width="26%" class="windowbg" align="left">
						<font size="2">' . $warning['time'] . '</font>
					</td>
				</tr>';
	echo'
				<tr>
					<td colspan="5" class="windowbg" align="center">
						<input type="submit" value="' . $txt['visual_submit'] . '" >
					</td>
				</tr>
			</table>
		</form>';	
}

function template_pmod_manager()
{
	global $context, $settings, $options, $txt, $scripturl, $modSettings;

	echo' 
		<form action="' . $scripturl . '?action=warnpmman2" method="post" enctype="multipart/form-data">
			<table border="0" cellspacing="1" cellpadding="5" class="tborder" align="center">
				<tr>
					<td class="titlebg" colspan="3">
						<img src="' . $settings['images_url'] . '/members.gif" alt="" border="0" />
						&nbsp;<font size="2"><b>' . $txt['visual_postmod_manager'] . '</b></font>
					</td>
				</tr><tr>
					<td colspan="3" class="windowbg">
						<font size="2">' . $txt['visual_postmod_awaiting'] . '</font>
					</td>
				</tr><tr>
					<td width="4%" class="catbg" align="center">
					</td>
					<td width="15%" class="catbg" align="center">
						<font size="2">' . $txt['visual_postmod_username'] . '</font>
					</td>
					<td width="81%" class="catbg" align="center">
						<font size="2">' . $txt['visual_postmod_subject'] . '</font>
					</td>
				</tr>';
	foreach ($context['posts'] as $post)
	{
		echo' 
				<tr>
					<td valign="top" width="4%" class="windowbg" align="center">
						<input type="checkbox" name="message[' . $post['ID'] . ']" value="1" />
					</td>
					<td valign="top" width="15%" class="windowbg" align="left">
						<a href="' . $scripturl . '?action=profile;u=' . $post['ID_MEMBER'] . '">' . $post['memberName'] . ' (' . $post['realName'] . ')</a>
					</td>
					<td width="81%" class="windowbg" align="left">
			<table width="100%" cellpadding="2" cellspacing="1">
				<tr>
					<td width="100%" class="windowbg2" align="left">
						<font size="2"><b>' . $post['subject'] . ($post['ID_POLL'] != -1 && $post['ID_POLL'] != 0 ? '(POLL)' : '') . '</b></font>
					</td>
				</tr>
				<tr>
					<td width="100%" class="windowbg" align="left">
						<font size="2">' . $post['body'] . '</font>
					</td>
				</tr>
			</table>
					</td>
				</tr>';
	}
	echo'
				<tr>
					<td colspan="3" class="windowbg" align="center">
						<input type="hidden" name="start" value="' . $context['start'] . '">
						<input type="submit" name="waction" value="' . $txt['visual_postmod_approve'] . '" >
						<input type="submit" name="waction" value="' . $txt['visual_postmod_delete'] . '" >
					</td>
				</tr>
			</table>
		</form>
			<table width="96%">
				<tr>
					<td align="left" width="100%">
						' . $context['pageIndex'] . '
					</td>
				</tr>
			</table>';
}

?>