<div class="row">
	<div class="col-xs-10">
		<h2><?php echo $titulo ?></h2>
		<?php 
		if(isset($error)){
			echo $error;
		}
		?>
	</div>
	<div class="col-xs-2 actions">
		<div class="button">
			<?php echo anchor("#", "<img src='".base_url()."assets/img/edit.svg'><br><label>EDIT</label>", array('class' => 'edit-btn', 'onclick' => 'habilitar(event)'));?> 
		</div>
		<div class="button">
			<?php echo anchor(base_url('admin/'.$controlador), "<img src='".base_url()."assets/img/cancel.svg'><br><label>CANCEL</label>") ?> 
		</div>

	</div>
</div>
<form class="form-horizontal" role="form" name="benefit_info" action="<?php echo base_url('admin/'.$controlador.'/update/'.$id)?>" method="post" enctype="multipart/form-data">
	<div class="form-group">
		<label for="username" class="col-sm-3 control-label">Username</label>
		<div class="col-sm-9">
			<input type="text" class="form-control inputDisabled" name="username" placeholder="Username" id="inputUsername" value="<?php echo $detalle->username;?>" onclick="seleccionar(event)" disabled>
			<input type="hidden" class="form-control inputDisabled" name="oldusername" placeholder="Username" id="inputOldUsername" value="<?php echo $detalle->username;?>" onclick="seleccionar(event)" disabled>
		</div>
	</div>
	<div class="form-group">
		<label for="profile" class="col-sm-3 control-label">Profile</label>
		<div class="col-sm-9">
			<select class="form-control inputDisabled" name="profile" disabled>
				<option value="admin" <?php if ($detalle->profile == 'admin') echo 'selected'?>>Administrator</option>
				<option value="editor" <?php if ($detalle->profile == 'editor') echo 'selected'?>>Editor</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label for="username" class="col-sm-3 control-label">Name</label>
		<div class="col-sm-9">
			<input type="text" class="form-control inputDisabled" name="name" placeholder="Name" id="inputName" value="<?php echo $detalle->name;?>" onclick="seleccionar(event)" disabled>
		</div>
	</div>

	<div class="form-group last">	
    	<div class="col-sm-offset-2 col-sm-10">	
			<button type="submit" class="btn btn-success btn-sm inputDisabled" name="guardar" placeholder="Guardar" disabled>Update Info</button>
			<button type="reset" class="btn btn-default btn-sm">Reset</button>
		</div>
	</div>
</form>

<script type="text/javascript">

	function habilitar(e) {
		e.preventDefault();
		var inputs = document.getElementsByClassName('inputDisabled');
		for(var i = 0; i < inputs.length; i++) {
		    inputs[i].disabled = false;
		}
	}

	function seleccionar(e){
		document.getElementById(e.target.id).selectionStart = 0;
	}
</script>
