<?php $this->load->view('templates_admin/_header'); ?>

<?php $this->load->view('templates_admin/_sidebar'); ?>

<div class="col-md-8">

<section class="panel panel-default">
	<div class="panel-body">

<?php
	$form_attributes = array('class' => 'form-horizontal login-form');
	echo form_open(base_url().'admin/login', $form_attributes);
?>

	<div class="form-group">
		<div class="col-sm-offset-3 col-sm-9">
			<h2>Login</h2>

			<?php echo validation_errors('<div class="alert alert-danger">', '</div>'); ?>

			<?php
			if( $login_message ){
				echo '<div class="alert alert-danger">'.$login_message.'</div>';
			}
			?>

		</div>
	</div>
	<div class="form-group">
		<?php
		$label_username_attributes = array(
			'class' => 'col-sm-3 control-label'
		);
		echo form_label('Username', 'id_username', $label_username_attributes);
		?>
		<div class="col-sm-9">
			<?php
			$input_username_attributes = array(
				'class' => 'form-control input-lg',
				'name' => 'username',
				'id' => 'id_username',
				'value' => set_value('username'), // get value from POST array
				'maxlength' => '100',
				'required' => 'true'
			);
			echo form_input($input_username_attributes);
			?>
		</div>
	</div>
	<div class="form-group">
		<?php
		$label_password_attributes = array(
			'class' => 'col-sm-3 control-label'
		);
		echo form_label('Password', 'id_password', $label_password_attributes);
		?>
		<div class="col-sm-9">
			<?php
			$input_password_attributes = array(
				'class' => 'form-control input-lg',
				'name' => 'password',
				'id' => 'id_password',
				'value' => set_value('password'), // get value from POST array
				'maxlength' => '100',
				'required' => 'true',
				'onfocus' => "this.type='text'",
				'onclick' => "this.type='text'",
				'onblur' => "this.type='password'"
			);
			echo form_password($input_password_attributes);
			?>
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-offset-3 col-sm-9">
			<?php
			$input_submit_attributes = array(
				'class' => 'btn btn-lg btn-primary btn-block',
				'name' => 'submit',
				'value' => 'Login'
			);
			echo form_submit($input_submit_attributes);
			?>
		</div>
	</div>

<?php
	echo form_close();
?>

	</div>
</section>

</div>

<?php $this->load->view('templates_admin/_footer'); ?>