{include file="../head.tpl"}
{if $smarty.request.action == "new"} {include file="bodyonload.tpl"} {/if}

<form name="user" method="post" action="{$form}">
<table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
	<tr>
		<td colspan="2" class="header">
			
			{if $smarty.request.action == "edit"} {$langadmin.edituser} (ID: {$smarty.request.id}){/if}
			{if $smarty.request.action == "new"} {$langadmin.newuser} {/if}
	  </td>
	</tr>
	
	{if $ok != 1}
	<tr>
	<td colspan="2" class="secondrow">
	<span class="errorfont"><b>{$langadmin.error}</b></span>
	<ul>
	{$errormsg}
	</ul>
	</td>
	</tr>
	{/if}
	<tr>
	  <td nowrap class="firstrow">{$langadmin.user_form_title}</td>
	  <td class="secondrow">
	  <select name="title" id="title">
	    <option value="1" {if $row->title==1}selected="selected"{/if}>{$langadmin.title_mr}</option>
	    <option value="2" {if $row->title==2}selected="selected"{/if}>{$langadmin.title_mrs}</option>
      </select></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.user_form_firstname}</td>
	  <td class="secondrow"><input name="name" type="text" id="name" value="{$smarty.request.name|default:$row->name|sslash|escape:"htmlall"|strip_tags|trim}" size="40">
	    </td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.user_form_lastname}</td>
	  <td class="secondrow"><input name="lastname" type="text" id="lastname" value="{$smarty.request.lastname|default:$row->lastname|sslash|escape:"htmlall"|strip_tags|trim}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.user_form_street}</td>
	  <td class="secondrow"><input name="street" type="text" id="street" value="{$smarty.request.street|default:$row->street|sslash|escape:"htmlall"|strip_tags|trim}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.user_form_zip}</td>
	  <td class="secondrow"><input name="zip" type="text" id="zip" value="{$smarty.request.zip|default:$row->zip|sslash|escape:"htmlall"|strip_tags|trim}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.userfrom}</td>
	  <td class="secondrow"><input name="user_from" type="text" id="user_from" value="{$smarty.request.user_from|default:$row->user_from|sslash|escape:"htmlall"|strip_tags|trim}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.user_form_phone}</td>
	  <td class="secondrow"><input name="phone" type="text" id="phone" value="{$smarty.request.phone|default:$row->phone|sslash|escape:"htmlall"|strip_tags|trim}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.user_form_fax}</td>
	  <td class="secondrow"><input name="fax" type="text" id="fax" value="{$smarty.request.fax|default:$row->fax|sslash|escape:"htmlall"|strip_tags|trim}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.user_form_mobile}</td>
	  <td class="secondrow"><input name="phone_mobile" type="text" id="phone_mobile" value="{$smarty.request.phone_mobile|default:$row->phone_mobile|sslash|escape:"htmlall"|strip_tags|trim}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.usermail}</td>
	  <td class="secondrow"><input name="email" type="text" id="email" value="{if !empty($smarty.post.email)}{$smarty.post.email|escape:"htmlall"|strip_tags|trim}{else}{$row->email}{/if}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.userhp}</td>
	  <td class="secondrow"><input name="url" type="text" id="url" value="{if !empty($smarty.post.url)}{$smarty.post.url|escape:"htmlall"}{else}{$row->url|escape:"htmlall"|strip_tags|trim}{/if}" size="40"></td>
    </tr>
	<tr>
	  <td nowrap class="firstrow">{$langadmin.userbd}</td>
	  <td class="secondrow"><input name="dd" type="text" class="feld" id="dd" onKeypress="{$onkeypress}" value="{if !empty($smarty.post.dd)}{$smarty.post.dd}{else}{$birth[0]}{/if}" size="2" maxlength="2">
			/
			<input name="mm" type="text" class="feld" id="mm" onKeypress="{$onkeypress}" value="{if !empty($smarty.post.mm)}{$smarty.post.mm}{else}{$birth[1]}{/if}" size="2" maxlength="2">
			/
	  <input name="yyyy" type="text" class="feld" id="yyyy" onKeypress="{$onkeypress}" value="{if !empty($smarty.post.yyyy)}{$smarty.post.yyyy}{else}{$birth[2]}{/if}" size="7" maxlength="4"></td>
    </tr>
	<tr>
	  <td colspan="2" nowrap class="theader">{$langadmin.login_data}</td>
    </tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.username}
		</td>
		<td class="secondrow">
			<input name="uname" type="text" id="uname" value="{if !empty($smarty.post.uname)}{$smarty.post.uname|escape:"htmlall"|strip_tags|trim}{else}{$row->uname}{/if}" size="40">
		</td>
	</tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.passtext}
		</td>
	  <td class="secondrow">
			<input name="pass" type="text" id="pass" size="40">
		</td>
	</tr>
	<tr>
	  <td colspan="2" nowrap class="theader">{$langadmin.ugroup_once}</td>
    </tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.groupsmain_once}
		</td>
		<td class="secondrow">
			<select name="group" id="group">
			<option value="">{$langadmin.selgroup}</option>
			{foreach from=$selugroup item=group}
			
				<option value="{$group->ugroup}" {if $group->ugroup == $row->ugroup}selected="selected"{/if}>
				{$group->groupname}
				</option>
				{/foreach}
			</select>
		</td>
	</tr>
	<tr>
		<td width="20%" class="firstrow">
			{$langadmin.groups_misc}<br />
			<small>{$langadmin.groups_misc_text}</small>
	  </td>
		<td class="secondrow">
			<select size="5" name="group_misc[]" multiple>
			{foreach from=$selugroup item=group}
				<option value="{$group->ugroup}" {if in_array($group->ugroup, @explode(";", $row->group_id_misc))}selected="selected"{/if}>
				{$group->groupname}
				</option>
				{/foreach}
			</select>
		</td>
	</tr>
	<tr>
	  <td colspan="2" nowrap class="theader">{$langadmin.user_form_other}</td>
    </tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.aim}
		</td>
		<td class="secondrow">
			<input name="user_aim" type="text" id="user_aim" value="{if !empty($smarty.post.user_aim)}{$smarty.post.user_aim|escape:"htmlall"}{else}{$row->user_aim|escape:"htmlall"}{/if}" size="40">
		</td>
	</tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.icq}
		</td>
		<td class="secondrow">
			<input name="user_icq" type="text" id="user_icq" value="{if !empty($smarty.post.user_icq)}{$smarty.post.user_icq|escape:"htmlall"}{else}{$row->user_icq|escape:"htmlall"}{/if}" size="40">
		</td>
	</tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.usersig}
		</td>
		<td class="secondrow">
			<textarea name="user_sig" cols="45" rows="5" id="user_sig">{if !empty($smarty.post.user_sig)}{$smarty.post.user_sig|escape:"htmlall"}{else}{$row->user_sig|escape:"htmlall"}{/if}</textarea>
		</td>
	</tr>
{*
{if $smarty.request.action != "new"}
{/if}
*}
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.isinvisible}
		</td>
		<td class="secondrow">
			<input type="radio" name="invisible" value="yes" {if $row->invisible=="yes"}checked="checked"{/if}>
			{$langadmin.yes}
			<input type="radio" name="invisible" value="no" {if $row->invisible=="no" || $smarty.request.action=="new"}checked="checked"{/if}>
			{$langadmin.no}
		</td>
	</tr>
	{if $smarty.request.action == "edit"}
	<tr>
		
		<td width="20%" nowrap class="firstrow">
			{$langadmin.pncountout}
		</td>
		<td class="secondrow">&nbsp;
			{$pnout}
&nbsp;&nbsp;<a onclick="return confirm('{$langadmin.pndelconfirm}');" href="user.php?action=edit&do=delpn&what=out&id={$smarty.request.id}">
			{$langadmin.pndel}
			</a></td>
	</tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.pncountin}
		</td>
		<td class="secondrow">&nbsp;
			{$pnin}
&nbsp;&nbsp;<a onClick="return confirm('{$langadmin.pndelconfirm}');" href="user.php?action=edit&do=delpn&what=in&id={$smarty.request.id}">
			{$langadmin.pndel}
			</a></td>
	</tr>
	{/if}
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.pnreceive}
		</td>
		<td class="secondrow">
			<input type="radio" name="user_canpn" value="yes" {if $row->user_canpn=="yes" || $smarty.request.action == "new"}checked="checked"{/if}>
			{$langadmin.yes}
			<input type="radio" name="user_canpn" value="no" {if $row->user_canpn=="no"}checked="checked"{/if}>
			{$langadmin.no}
		</td>
	</tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.pnreceiveemail}
		</td>
		<td class="secondrow">
			<input type="radio" name="pntomail" value="yes" {if $row->pntomail=="yes" || $smarty.request.action=="new"}checked="checked"{/if}>
			{$langadmin.yes}
			<input type="radio" name="pntomail" value="no" {if $row->pntomail=="no"} checked="checked"{/if}>
			{$langadmin.no}
		</td>
	</tr>
	<tr>
		<td width="20%" nowrap class="firstrow">
			{$langadmin.userinterr}
		</td>
		<td class="secondrow">
			<input name="user_interests" type="text" id="user_interests" value="{$row->user_interests|escape:"htmlall"}" size="40">
		</td>
	</tr>
	<tr>
		<td colspan="2" nowrap class="secondrow">
			<div align="center">
				<input accesskey="s" type="submit" class="button" value="{if $smarty.request.action !="new"}{$langadmin.send}{else}{$langadmin.newuser}{/if}">
			</div>
	  </td>
	</tr>
	
	{if $smarty.request.action != "new"}
	<tr>
		<th colspan="2" class="theader">
			{$langadmin.emailtouser}
		</th>
	</tr>
	<tr>
		<td nowrap class="firstrow">
			{$langadmin.emailtousersubject}
		</td>
		<td class="secondrow">
			<input name="subject" type="text" id="subject" size="40">
		</td>
	</tr>
	<tr>
		<td valign="top" nowrap class="firstrow">
			{$langadmin.messagetext}
		</td>
		<td valign="top" class="secondrow">
			<table width="100%"  border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
						<textarea name="emailtext" cols="55" rows="10" id="emailtext"></textarea>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="2" valign="top" class="secondrow">
		  <div align="center">
				<input name="page" type="hidden" id="page" value="{$hiddenpage}">
				<input name="send" type="hidden" id="send" value="1">
				<input accesskey="s" type="submit" class="button" value="{$langadmin.send}">
		  </div>
		</td>
	</tr>
	
	{/if}
</table>

</form>
{include file="../foot.tpl"}