<div class="ml-container">
	<?php
	$message = '';
	if(isset($_GET['log_err']))
	{
		switch ($_GET['log_err']) {
			case '100':
				$message = pjSanitize::clean(__('front_label_login_success', true, false));
			break;
			case '101':
				$message = pjSanitize::clean(__('front_label_login_error_1', true, false));
			break;
			case '102':
				$message = pjSanitize::clean(__('front_label_login_error_2', true, false));
			break;
			case '103':
				$message = pjSanitize::clean(__('front_label_login_error_3', true, false));
			break;
			case '104':
				$message = pjSanitize::clean(__('front_label_login_error_4', true, false));
			break;
		}
	} else if(isset($_GET['reg_err'])){
		switch ($_GET['reg_err']) {
			case '100':
				$message = pjSanitize::clean(__('front_label_register_success', true, false));
				break;
			case '102':
				$message = pjSanitize::clean(__('front_label_register_success_2', true, false));
				break;
			case '101':
			case '200':
				$message = pjSanitize::clean(__('front_label_register_error', true, false));
				break;
		}
	}
	?>
	<p class="ml-social-message"><?php echo $message;?></p>
	<?php
	if(isset($tpl['params']))
	{
		if (pjObject::getPlugin('pjPaypal') !== NULL)
		{
			if ($tpl['params']['a3_price'] > 0)
			{
				$controller->requestAction(array('controller' => 'pjPaypal', 'action' => 'pjActionSubscribe', 'params' => $tpl['params']));
			} else {
				$controller->requestAction(array('controller' => 'pjPaypal', 'action' => 'pjActionForm', 'params' => $tpl['params']));
			}
			?>
			<script>
			var payment_form = document.getElementById("ml_memberlogin_paypal_form");
			if (typeof payment_form != 'undefined') {
				payment_form.submit();
			} else {
				window.location.href = "<?php echo $tpl['option_arr']['o_thankyou_page'];?>";
			}
			</script>
			<?php
		}
	} 
	?>
</div>