<?php
/**
 * WebEngine CMS
 * https://webenginecms.org/
 * 
 * @version 1.1.0
 * @author Lautaro Angelico <http://lautaroangelico.com/>
 * @copyright (c) 2013-2019 Lautaro Angelico, All Rights Reserved
 * 
 * Licensed under the MIT license
 * http://opensource.org/licenses/MIT
 */

echo "<style>";
	echo ".cc-selector input{ margin:0;padding:0; -webkit-appearance:none; -moz-appearance:none; appearance:none;}";
	echo ".cc-selector input:active +.drinkcard-cc{opacity: .9;}";
	echo ".cc-selector input:checked +.drinkcard-cc{ -webkit-filter: none; -moz-filter: none; filter: none;}";
	echo ".drinkcard-cc{ cursor:pointer; background-size:contain; background-repeat:no-repeat; display:inline-block; width:200px;height:200px; -webkit-transition: all 100ms ease-in; -moz-transition: all 100ms ease-in; transition: all 100ms ease-in; -webkit-filter: brightness(1.8) grayscale(1) opacity(.7); -moz-filter: brightness(1.8) grayscale(1) opacity(.7); filter: brightness(1.8) grayscale(1) opacity(.7); }";
	echo ".drinkcard-cc:hover{ -webkit-filter: brightness(1.2) grayscale(.5) opacity(.9); -moz-filter: brightness(1.2) grayscale(.5) opacity(.9); filter: brightness(1.2) grayscale(.5) opacity(.9); }";
	echo ".MercadoPago{background-image:url(".__PATH_IMG__."donation/mercadopago.png); }";
	echo ".Paypal{background-image:url(".__PATH_IMG__."donation/paypal.png); }";
	echo ".Binance{background-image:url(".__PATH_IMG__."donation/binance.png); }";
echo "</style>";
 switch ($_POST["paquetes"]) {
	case "Paypal":
		$URL = __BASE_URL__ . "donation/paypal";
		break;
	case "MercadoPago":
		$URL = __BASE_URL__ . "donation/mercadopago";
		break;
	case "Binance":
		$URL = __BASE_URL__ . "donation/binance";
		break;	 
 }
 header("Location: " . $URL);
 try {
	 echo '<div class="page-title"><span> Elige tu medio de pago</span></div>';
	 echo '<form action="" method="post">';
		echo '<input type="hidden" name="cuenta" value="' . $_SESSION["username"] . '">';
		echo '<div class="cc-selector">';
			echo '<table style="width: 100%;text-align: center;">';
				echo '<tbody>';
					echo '<tr>';
						echo '<td>';
							echo '<input id="MercadoPago" type="radio" name="paquetes" value="MercadoPago" />';
							echo '<label class="drinkcard-cc MercadoPago" for="MercadoPago"></label>';
							echo '<br/> MercadoPago';
						echo '</td>';
						echo '<td>';
							echo '<input id="Paypal" type="radio" name="paquetes" value="Paypal" />';
							echo '<label class="drinkcard-cc Paypal" for="Paypal"></label>';
							echo '<br/> Paypal';
						echo '</td>';
                        echo '<td>';
							echo '<input id="Binance" type="radio" name="paquetes" value="Binance" />';
							echo '<label class="drinkcard-cc Binance" for="Binance"></label>';
							echo '<br/> Binance Pay';
						echo '</td>';
					echo '</tr>';
				echo '</tbody>';
			echo '</table>';
		echo '<br/><br/>';
		echo '<button class="btn btn-primary">Siguiente</button>';
		echo '</div>';
	 echo '</form>';
 } catch (Exception $ex) {
	 message("error", $ex->getMessage());
 }
 
 ?>