<?php $this->load->view('admin/error'); ?>
<div class="box box-primary">
	<div class="box-header with-border">
		<h1 class="box-title">User <small>Edit</small></h1>
		<span class="label pull-right">
			<a href="<?php echo site_url('admin/config'); ?>" class="btn btn-danger btn-sm pull-right">Back</a>
        </span>
	</div><!-- /.box-header -->
	<div class="box-body">
	 	<?php foreach ($data as $row) : ?>
		<form action="<?php echo site_url('admin/config/edit_user/'.$row->userid.''); ?>" method="post">
    		<fieldset>
			    <div class="form-group">
			    	<label>Username :</label>
			        <input class="form-control" type="text" name="username" required="required" value="<?php echo $row->username; ?>" >
			    </div>
			    <div class="form-group">
			    	<label>Password :</label>
			        <input class="form-control" type="password" name="password" required="required">
			    </div>
				<div class="form-group">
                <label>Publish :</label>
                <select name="publish" class="form-control" required="required">
                	<option value="1" <?php if ($row->access_level == 1) echo "selected=\"selected\""; ?>>Superadmin</option>                
                    <option value="2" <?php if ($row->access_level == 2) echo "selected=\"selected\""; ?> >Admin</option>               
                 </select>
				</div>
				<hr />
                <div class="form-group">
			    	<label>Realname :</label>
			        <input class="form-control" type="text" name="realname"value="<?php echo $row->realname; ?>">
			    </div>
			    <div class="form-group">
			         <label>Email :</label>
			         <input class="form-control" type="email" name="email"value="<?php echo $row->email; ?>">
			    </div>
			    <div class="form-group">
			         <label>Alamat :</label>
			         <textarea class="form-control" name="address"><?php echo $row->address; ?></textarea>
			    </div>
			    <div class="form-group">
			         <label>Telephone :</label>
			         <input class="form-control" type="text" name="phone"value="<?php echo $row->phone; ?>">
			    </div>
        		<div class="form-group">
					<input type="submit" class="btn btn-primary" name="submit" value="Simpan"></input>
                </div>
			</fieldset>
		</form>
   		<?php endforeach; ?>
        
	</div><!-- /.box-body -->
</div>

