<? $this->load->view('template/header_c'); ?>
    <div class="container">
        <div class="row">
         <div class="col-md-6 col-md-offset-3">
            <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">Cambio de Contraseña</h3>
                    </div>
                    <div class="panel-body">
					<?php  
						$this->load->helper('form');
						$attributes = array('role' => 'form','class'=>'form-horizontal');
						echo form_open('main/login_cambio_clave',$attributes); 

						// Motivo cambio clave
						if( $message != "") { 
							echo "<div class='alert alert-warning'>";
							echo $message;
							echo "</div>";
						}
						
						$val_errors = validation_errors();
						if (isset($errors) or $val_errors!='') {
							echo "<div class='alert alert-danger'>";		
							echo $val_errors;
							if (isset($errors)) {foreach ($errors as $a => $b) { echo $b; }}
							echo "</div>";
						}

			
						//echo $this->db->last_query();
						echo"<fieldset>";
						echo "<div class='form-group'>";
						echo "<label class='control-label col-md-4'>Usuario</label>";
						echo "<div class='col-md-8'>";
						echo "<p class='form-control-static'>".$this->session->userdata('usuario_username')."(".$this->session->userdata('usuario_nombre').")</p>";
						echo "</div>";

						echo "<div class='form-group'>";
						echo "<label class='control-label col-md-4'>Contraseña Anterior:</label>";
						echo "<div class='col-md-8'>";
						$data = array('name' => 'password_ant', 'class'=>'form-control', 'placeholder'=>'Ingrese la Contraseña Actual','autofocus');
						echo form_password($data);
						echo"</div> </div>";

						echo "<div class='form-group'>";
						echo "<label class='control-label col-md-4'>Contraseña Nueva:</label>";
						echo "<div class='col-md-8'>";
						$data = array('name' => 'password_nueva', 'class'=>'form-control', 'placeholder'=>'Ingrese la Nueva Contraseña');
						echo form_password($data);
						echo"</div> </div>";

						echo "<div class='form-group'>";
						echo "<label class='control-label col-md-4'>Confirmar Contraseña:</label>";
						echo "<div class='col-md-8'>";
						$data = array('name' => 'password_conf', 'class'=>'form-control', 'placeholder'=>'Confirme la Nueva Contraseña');
						echo form_password($data);
						echo"</div> </div>";

						$data = array('name' => 'cambiar_submit', 'class'=>'btn btn-default btn-primary btn-block', 'value'=>'Cambiar Contraseña');
						echo form_submit($data);
						$data = array('name' => 'cancelar_submit', 'class'=>'btn btn-default btn-primary btn-block', 'value'=>'Cancelar');
						echo form_submit($data);

						echo form_close();
				
                        ?>
                    </div>
                </div>
              </div>
        </div>
    </div>

<? $this->load->view('template/footer_c'); ?>