<div class="ma_page_content">
	<!-- Reset Box -->
	<div class="reset_page">
		<div class="reset-page">
			<div class="reset-form">
				<h4>{{LANG Reset your password}}</h4>
				<p>{{LANG Enter new password to proceed.}}</p>
				<form action="" method="POST" id="reset-form">
					<div class="alert alert-danger alert-empty" id="output-reset-errors"></div>
					<div class="form-group">
						<input type="password" class="form-control" placeholder="{{LANG New Password}}" autofocus name="password">
					</div>
					<div class="form-group">
						<input type="password" class="form-control" placeholder="{{LANG Confirm Password}}" name="c_password">
					</div>
					<input type="hidden" class="form-control" name="email_code" value="{{email_code}}">
					<button type="submit" class="btn btn-block btn-primary btn-mat" id="btn-reset-submit">{{LANG Reset}}</button>
				</form>
			</div>    
		</div>
	</div>
	<!-- End Reset Box -->
	
	<!-- Footer -->
	<?php echo loadPage('home/footer'); ?>
	<!-- End Footer -->
</div>

<script>
$(document).ready(function() { 
    var options = { 
    	url: "{{CONFIG ajax_url}}/auth/reset-password?hash_id=" + getHashID(),
        beforeSubmit:  function () {
        	$('#output-reset-errors').removeClass("alert-success").addClass('alert-danger');
        	$('#output-reset-errors').empty();
        	$("#btn-reset-submit").text("{{LANG Please wait..}}");
        }, 
        success: function (data) {
        	$("#btn-reset-submit").text("{{LANG Reset}}");
        	if (data.status == 200) {
        		location.href = '{{LINK discover}}';
        	} else if (data.status == 400) {
        		var errros = data.errors.join("<br>");
        		$('#output-reset-errors').html(errros);
        	}
        }
    }; 

    $('#reset-form').ajaxForm(options); 
}); 
</script>