ACC SHELL

Path : /srv/www/vhosts/unitedsolution/admin/user/
File Upload :
Current File : /srv/www/vhosts/unitedsolution/admin/user/add_user.php

<?php

//formular pro noveho uzivatele

if($_POST['button'] == 'ulozit'){
	$admin->add_user($_POST['name'],$_POST['surname'],$_POST['username'],$_POST['pass'],$_POST['pass2'],$_POST['memo'],$_POST['typ']);
}

echo '<h1 class="users_icon">Uživatele</h1>';//nadpis


if($admin->getMsg() != USER_ADDED){//pokud nebyl jeste pridan novy uzivatel
?>
<a id="page_bakc" class="m" href="default.php?page=user/show_user"><img border="0" src="img/Back.jpg" alt="Zpět" title="Zpět" /></a>
<form id="user_form" name="user" method="post" action="default.php?page=user/add_user">
	<div>
		<label for="typ">Typ uživatele:</label>
		<select name="typ" id="typ">
			<?php

				$admin->select_typ();
				
				for($i=0;$i<count($admin->typy_id);$i++){
					
					echo '<option value="'.$admin->typy_id[$i].'" '.(($_POST['typ']==$admin->typy_id[$i])?'selected':'').'>'.$admin->typy_name[$i].'</option>'."\n";
				
				}			
			?>
		</select>
	</div>
	<div>
		<label for="name">Jméno:</label>
		<input type="text" name="name" id="name" <?= !empty($_POST['name']) ? 'value="'.$_POST['name'].'"' : '' ?> />
	</div>
	<div>
		<label for="surname">Příjmeni:</label>
		<input type="text" name="surname" id="surname" <?= !empty($_POST['surname']) ? 'value="'.$_POST['surname'].'"' : '' ?> />
	</div>
	<div>
		<label for="username"><strong>Username: *</strong></label>
		<input type="text" name="username" id="username" <?= !empty($_POST['username']) ? 'value="'.$_POST['username'].'"' : '' ?> />
	</div>
	<div><label for="pass"><strong>Heslo: *</strong></label><input type="password" name="pass" id="pass" /></div>
	<div><label for="pass2"><strong>Heslo znovu: *</strong></label><input type="password" name="pass2" id="pass2" /></div>
	<div>
		<label for="memo">Poznámka:</label>
		<textarea cols="30" rows="5" name="memo" id="memo"><?= !empty($_POST['memo']) ? $_POST['memo'] : '' ?></textarea>
	</div>
	<div><input id="page_b_1" type="submit" name="button" value="ulozit" title="Uložit" /></div>
	<div><strong>* povine položky</strong></div>
</form>	
<?

echo	'<div class="user_msg">'.$admin->getMsg().'</div>';

}
else{//byl-li pridan novy uzivatel

echo	'<div class="page_msg2">'.$admin->getMsg().'</div>';

}

?>

ACC SHELL 2018