Commit 8782b60b authored by Petr Balga's avatar Petr Balga

Top-up template done; Top-upping done; Paying done; Generating random payments...

Top-up template done; Top-upping done; Paying done; Generating random payments done; API connected and exchanging; New database password;
parent 119ebd79
......@@ -26,7 +26,7 @@ define( 'DB_NAME', 'creepy_test_bl' );
define( 'DB_USER', 'creepy_test_bl' );
/** MySQL database password */
define( 'DB_PASSWORD', 'Vu99!d8\\I"' );
define( 'DB_PASSWORD', 'Pq9*MgB"3r' );
/** MySQL hostname */
define( 'DB_HOST', 'mariadb103.websupport.sk:3313' );
......
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="7" viewBox="0 0 11 7"><g><g><path fill="#968000" d="M10.246.29a1 1 0 0 0-1.41 0l-3.59 3.54L1.706.29a1 1 0 1 0-1.41 1.42l4.24 4.24a1 1 0 0 0 1.42 0l4.29-4.24a1 1 0 0 0 0-1.42z"/></g></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><g><g><path fill="#ffd300" d="M11.663.576a1.151 1.151 0 0 0-1.605 0L5.972 4.543 1.942.576a1.151 1.151 0 0 0-1.605 0 1.112 1.112 0 0 0 0 1.591L5.163 6.92a1.148 1.148 0 0 0 1.617 0l4.883-4.752a1.112 1.112 0 0 0 0-1.591z"/></g></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6" viewBox="0 0 12 6"><g><g><path fill="#968000" d="M10.996.17a1 1 0 0 0-1.41 0l-3.59 3.54L2.456.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1 1 0 0 0 1.42 0l4.29-4.24a1 1 0 0 0 0-1.42z"/></g></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="54" viewBox="0 0 48 54"><g><g><path fill="#231f20" d="M0 0h43a5 5 0 0 1 5 5v44a5 5 0 0 1-5 5H0z"/></g></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="504" width="720" version="1.0" viewBox="-2100 -1470 4200 2940">
<defs>
<path id="D" fill-rule="evenodd" d="m-31.5 0h33a30 30 0 0 0 30 -30v-10a30 30 0 0 0 -30 -30h-33zm13-13h19a19 19 0 0 0 19 -19v-6a19 19 0 0 0 -19 -19h-19z"/>
<path id="E" transform="translate(-31.5)" d="m0 0h63v-13h-51v-18h40v-12h-40v-14h48v-13h-60z"/>
<path id="e" d="m-26.25 0h52.5v-12h-40.5v-16h33v-12h-33v-11h39.25v-12h-51.25z"/>
<g id="G">
<clipPath id="gcut">
<path d="m-31.5 0v-70h63v70zm31.5-47v12h31.5v-12z"/>
</clipPath>
<use xlink:href="#O" clip-path="url(#gcut)"/>
<rect y="-35" x="5" height="10" width="26.5"/>
<rect y="-35" x="21.5" height="35" width="10"/>
</g>
<path id="M" d="m-31.5 0h12v-48l14 48h11l14-48v48h12v-70h-17.5l-14 48-14-48h-17.5z"/>
<path id="O" fill-rule="evenodd" d="m0 0a31.5 35 0 0 0 0 -70 31.5 35 0 0 0 0 70m0-13a18.5 22 0 0 0 0 -44 18.5 22 0 0 0 0 44"/>
<path id="P" fill-rule="evenodd" d="m-31.5 0h13v-26h28a22 22 0 0 0 0 -44h-40zm13-39h27a9 9 0 0 0 0 -18h-27z"/>
<g id="R">
<use xlink:href="#P"/>
<path d="m28 0c0-10 0-32-15-32h-19c22 0 22 22 22 32"/>
</g>
<path id="S" d="m-15.75-22c0 7 6.75 10.5 16.75 10.5s14.74-3.25 14.75-7.75c0-14.25-46.75-5.25-46.5-30.25 0.25-21.5 24.75-20.5 33.75-20.5s26 4 25.75 21.25h-15.25c0-7.5-7-10.25-15-10.25-7.75 0-13.25 1.25-13.25 8.5-0.25 11.75 46.25 4 46.25 28.75 0 18.25-18 21.75-31.5 21.75-11.5 0-31.55-4.5-31.5-22z"/>
<g id="star" fill="#fff">
<g id="c">
<path id="t" transform="rotate(18 0,-1)" d="m0-1v1h0.5"/>
<use xlink:href="#t" transform="scale(-1,1)"/>
</g>
<use xlink:href="#c" transform="rotate(72)"/>
<use xlink:href="#c" transform="rotate(-72)"/>
<use xlink:href="#c" transform="rotate(144)"/>
<use xlink:href="#c" transform="rotate(216)"/>
</g>
<use id="star1" xlink:href="#star" transform="scale(31.5)"/>
<use id="star2" xlink:href="#star" transform="scale(26.25)"/>
<use id="star3" xlink:href="#star" transform="scale(21)"/>
<use id="star4" xlink:href="#star" transform="scale(15)"/>
<use id="star5" xlink:href="#star" transform="scale(10.5)"/>
</defs>
<rect y="-50%" x="-50%" height="100%" fill="#009b3a" width="100%"/>
<path d="m-1743 0 1743 1113 1743-1113-1743-1113z" fill="#fedf00"/>
<circle r="735" fill="#002776"/>
<clipPath id="band">
<circle r="735"/>
</clipPath>
<path fill="#fff" d="m-2205 1470a1785 1785 0 0 1 3570 0h-105a1680 1680 0 1 0 -3360 0z" clip-path="url(#band)"/>
</svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="600" viewBox="0 0 9600 4800">
<title>Flag of Canada</title>
<path fill="#f00" d="m0 0h2400l99 99h4602l99-99h2400v4800h-2400l-99-99h-4602l-99 99H0z"/>
<path fill="#fff" d="m2400 0h4800v4800h-4800zm2490 4430-45-863a95 95 0 0 1 111-98l859 151-116-320a65 65 0 0 1 20-73l941-762-212-99a65 65 0 0 1-34-79l186-572-542 115a65 65 0 0 1-73-38l-105-247-423 454a65 65 0 0 1-111-57l204-1052-327 189a65 65 0 0 1-91-27l-332-652-332 652a65 65 0 0 1-91 27l-327-189 204 1052a65 65 0 0 1-111 57l-423-454-105 247a65 65 0 0 1-73 38l-542-115 186 572a65 65 0 0 1-34 79l-212 99 941 762a65 65 0 0 1 20 73l-116 320 859-151a95 95 0 0 1 111 98l-45 863z"/>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="900" height="600">
<rect width="900" height="600" fill="#d7141a"/>
<rect width="900" height="300" fill="#fff"/>
<path d="M 450,300 0,0 V 600 z" fill="#11457e"/>
</svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="810" height="540"><desc>European flag</desc>
<defs><g id="s"><g id="c"><path id="t" d="M0,0v1h0.5z" transform="translate(0,-1)rotate(18)"/><use xlink:href="#t" transform="scale(-1,1)"/></g><g id="a"><use xlink:href="#c" transform="rotate(72)"/><use xlink:href="#c" transform="rotate(144)"/></g><use xlink:href="#a" transform="scale(-1,1)"/></g></defs>
<rect fill="#039" width="810" height="540"/><g fill="#fc0" transform="scale(30)translate(13.5,9)"><use xlink:href="#s" y="-6"/><use xlink:href="#s" y="6"/><g id="l"><use xlink:href="#s" x="-6"/><use xlink:href="#s" transform="rotate(150)translate(0,6)rotate(66)"/><use xlink:href="#s" transform="rotate(120)translate(0,6)rotate(24)"/><use xlink:href="#s" transform="rotate(60)translate(0,6)rotate(12)"/><use xlink:href="#s" transform="rotate(30)translate(0,6)rotate(42)"/></g><use xlink:href="#l" transform="scale(-1,1)"/></g>
</svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="19" viewBox="0 0 20 19"><g><g><g transform="rotate(-90 4.5 9.5)"><path fill="#ffd300" d="M13.664 9.577a.836.836 0 0 0-.172-.275L9.4 5.135a.811.811 0 0 0-.794-.216.83.83 0 0 0-.58.591.847.847 0 0 0 .212.808l2.7 2.742H-3.24a.826.826 0 0 0-.819.833c0 .46.366.834.818.834H10.94l-2.7 2.741a.841.841 0 0 0 0 1.184.81.81 0 0 0 1.162 0l4.09-4.167a.836.836 0 0 0 .173-.275.848.848 0 0 0 0-.633z"/></g><g transform="rotate(90 14.5 9.5)"><path fill="#ffd300" d="M22.724 10.211a.836.836 0 0 1-.172.275l-4.091 4.167a.811.811 0 0 1-.794.217.83.83 0 0 1-.58-.592.847.847 0 0 1 .212-.808l2.7-2.742H5.82A.826.826 0 0 1 5 9.895c0-.46.366-.834.818-.834H20L17.3 6.32a.841.841 0 0 1 0-1.184.81.81 0 0 1 1.162 0l4.09 4.167c.075.08.134.173.173.275a.848.848 0 0 1 0 .633z"/></g></g></g></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1235" height="650" viewBox="0 0 7410 3900">
<rect width="7410" height="3900" fill="#b22234"/>
<path d="M0,450H7410m0,600H0m0,600H7410m0,600H0m0,600H7410m0,600H0" stroke="#fff" stroke-width="300"/>
<rect width="2964" height="2100" fill="#3c3b6e"/>
<g fill="#fff">
<g id="s18">
<g id="s9">
<g id="s5">
<g id="s4">
<path id="s" d="M247,90 317.534230,307.082039 132.873218,172.917961H361.126782L176.465770,307.082039z"/>
<use xlink:href="#s" y="420"/>
<use xlink:href="#s" y="840"/>
<use xlink:href="#s" y="1260"/>
</g>
<use xlink:href="#s" y="1680"/>
</g>
<use xlink:href="#s4" x="247" y="210"/>
</g>
<use xlink:href="#s9" x="494"/>
</g>
<use xlink:href="#s18" x="988"/>
<use xlink:href="#s9" x="1976"/>
<use xlink:href="#s5" x="2470"/>
</g>
</svg>
\ No newline at end of file
......@@ -196,38 +196,11 @@ footer {
background-color: #ffd300;
width: calc(100% - 64px);
height: calc( 100% - 160px);
box-shadow: 0 5px 0 rgba(202, 172, 0, 0.88), 0 2px 24px rgba(0, 0, 0, 0.5), 0px 120px 0px 0px rgba(0, 0, 0, 0.15);
border-radius: 0 0 20px 20px;
padding: 71px 32px 0;
position: absolute;
z-index: 999;
box-shadow: 0px 120px 0px 0px rgba(0, 0, 0, 0.15);
/*
.test {
width: 100%;
border-radius: 5px;
background-color: $white;
display: flex;
span {
font-size: 50px;
border: none;
color: $black;
font-size: 36px;
font-weight: 600;
padding: 20px 0 20px 20px;
}
}
.money__dollar {
width: 100%;
font-size: 50px;
border: none;
color: $black;
font-size: 36px;
font-weight: 600;
&:focus {
outline: none;
}
}
*/ }
z-index: 999; }
.top-up h2 {
margin: 0;
color: #231f20;
......@@ -251,31 +224,102 @@ footer {
.top-up .dollar__right {
float: left;
width: 74px;
height: 86px;
height: 40px;
background-color: #ffffff;
border-radius: 0px 5px 5px 0px; }
border-radius: 0px 5px 5px 0px;
background-image: url("./../assets/svg/usa_flag.svg");
background-size: 21px auto;
background-repeat: no-repeat;
background-position: 50% 27px;
padding-top: 46px;
text-align: center;
color: #231f20;
font-size: 12px;
font-weight: 700;
text-transform: uppercase; }
.top-up .reveal {
color: #968000;
font-size: 12px;
font-weight: 500; }
.top-up .select__currency {
width: calc(100% - 44px);
font-weight: 500;
margin-top: 13px;
padding-right: 30px;
background-image: url("./../assets/svg/arrow.svg");
background-repeat: no-repeat;
background-position: top 50% right 0;
text-decoration: none;
float: left; }
.top-up .transfer {
height: 50px;
width: 50px;
border-radius: 50px;
background-color: black;
float: right;
margin-top: 19px;
margin-bottom: -40px;
background-image: url("./../assets/svg/transfer.svg");
background-size: auto 19px;
background-repeat: no-repeat;
background-position: 15px 50%; }
.top-up .input__currency {
width: calc(100% - 44px - 75px);
background-color: transparent;
border-radius: 5px;
border-radius: 5px 0px 0px 5px;
border: 1px solid #968000;
font-size: 36px;
font-weight: 600;
padding: 22px 20px; }
padding: 22px 20px;
float: left;
-webkit-appearance: none; }
.top-up .select__currency {
float: left;
width: 74px;
height: 88px;
border: 1px solid #968000;
border-left: none;
background-color: transparent;
border-radius: 0px 5px 5px 0px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-repeat: no-repeat;
background-position: right 14px top 30px, 20px 24px;
background-size: 11px auto, 21px auto;
padding-left: 20px;
padding-top: 15px;
color: #231f20;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
margin-bottom: 20px; }
.top-up .flag__BRL {
background-image: url("./../assets/svg/arrow.svg"), url("./../assets/svg/brazil_flag.svg"); }
.top-up .flag__CZK {
background-image: url("./../assets/svg/arrow.svg"), url("./../assets/svg/czech_flag.svg"); }
.top-up .flag__EUR {
background-image: url("./../assets/svg/arrow.svg"), url("./../assets/svg/eu_flag.svg"); }
.top-up .flag__USD {
background-image: url("./../assets/svg/arrow.svg"), url("./../assets/svg/usa_flag.svg"); }
.top-up .flag__CAD {
background-image: url("./../assets/svg/arrow.svg"), url("./../assets/svg/canada_flag.svg"); }
.top-up .payment__method {
background-color: #ffffff;
width: calc(100% - 34px);
width: 100%;
border: none;
border-radius: 5px;
height: auto;
padding: 20px 17px;
padding: 20px 20px;
color: #231f20;
font-size: 12px;
font-weight: 500; }
font-weight: 700;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-repeat: no-repeat;
background-position: right 18px top 22px, 100% 0;
background-size: 12px auto, 48px 54px;
padding-left: 20px;
padding-right: 67px;
background-image: url("./../assets/svg/arrow2.svg"), url("./../assets/svg/black-background.svg"); }
.top-up .submit {
width: 100%;
box-shadow: 0 4px 0 #110f0f;
......@@ -288,6 +332,8 @@ footer {
font-size: 18px;
font-weight: 700;
margin-top: 50px; }
.top-up .submit:hover {
cursor: pointer; }
body, html {
background-color: #ffffff;
......
<footer>
<a href='#' class='active'>
<a href='<?php echo get_home_url() ?>' class='active'>
<div class='icon home'></div>
<p>Home</p>
</a>
<a href='#'>
<a href='?random'>
<div class='icon cards'></div>
<p>Cards</p>
</a>
<a href='#'>
<a href='<?php echo get_home_url() . '/topup/'; ?>' >
<div class='icon topup'></div>
<p>Top Up</p>
</a>
......@@ -21,6 +21,42 @@
</a>
<?php wp_footer(); ?>
</footer>
<?php
if(isset($_GET['random'])){
$topics = array('grocery', 'transport', 'entertainment', 'health');
$grocery = array('Lidl', 'Kaufland', 'Billa', 'Albert', 'Uber Eats');
$transport = array('Uber', 'Lyft', 'Taxi', 'Taxify');
$entertainment = array('Cinema', 'Broadway', 'Zoo', 'Park', 'Aqualand');
$health = array('BENU', 'Viktoriamedika', 'Pilulka', 'DrMax');
$randTop = $topics[array_rand($topics)];
switch($randTop){
case 'grocery':
$randShop = $grocery[array_rand($grocery)];
break;
case 'transport':
$randShop = $transport[array_rand($transport)];
break;
case 'entertainment':
$randShop = $entertainment[array_rand($entertainment)];
break;
case 'health':
$randShop = $health[array_rand($health)];
break;
}
$user_id = get_current_user_id();
$min = 0.5;
$max = get_user_meta($user_id, 'balance', true);
$amount = mt_rand ($min*100, $max*100) / 100;
add_transaction($amount, 'account', 'pay', $randTop, $randShop);
header('Location: localhost/creepy/');
}
?>
</div>
</body>
</html>
\ No newline at end of file
......@@ -6,7 +6,8 @@
<div id='user__icon'></div>
<div class='clear'></div>
<p id='info__text'> Your Balance </p>
<h3 id='balance'>4,581</h3>
<?php $user_id = get_current_user_id() ?>
<h3 id='balance'><?php echo get_user_meta($user_id, 'balance', true); ?></h3>
<div id='eye__icon'></div>
</div>
<div class='middle'>
......@@ -65,10 +66,7 @@
<div class='time'>9:12 PM</div>
</div>
</section>
<div id='end'><p>This is the end<br>
Hold your breath and count to ten<br>
Feel the earth move and then<br>
Hear my heart burst again</p></div>
<div id='end'><p>This is the end.</p></div>
</div>
</div>
<!-- div container closed in footer.php -->
......
......@@ -9,17 +9,12 @@ function load_css() {
add_action('wp_enqueue_scripts', 'load_css');
/* Loading JS */ /*
/* Loading JS */
function load_js() {
wp_register_script('mainjs', get_template_directory_uri() . '/js/app.min.js', array(), 1, true);
wp_register_script('mainjs', get_template_directory_uri() . '/js/money.js', array(), 1, true);
wp_enqueue_script('mainjs');
wp_register_script('webfontjs', get_template_directory_uri() . '/js/webfont.min.js');
wp_enqueue_script('webfontjs');
}
add_action('wp_enqueue_scripts', 'load_js');
*/
/* Add post thumbnails support */
add_theme_support( 'post-thumbnails' );
......@@ -98,4 +93,34 @@ function transactions_post_type() {
}
add_action( 'init', 'transactions_post_type', 0 );
function add_transaction($amount, $payment, $action, $category, $title){
$amount = preg_replace("/[^0-9.]/", "", $amount);
$user_id = get_current_user_id();
$post = array(
'post_author' => $user_id,
'post_content' => 'Transaction of $' . $amount . ' was made.',
'post_title' => $title,
'post_status' => 'publish',
'post_type' => 'transaction',
'post_category' => array($category),
'meta_input' => array('amount' => $amount)
);
if(empty(get_user_meta($user_id, 'balance') )){
add_user_meta($user_id, 'balance', 0, true);
}
$money = get_user_meta($user_id, 'balance', true);
if($action == 'topup'){
$money += $amount;
} else {
$money -= $amount;
}
update_user_meta($user_id, 'balance', $money);
wp_insert_post($post);
}
?>
\ No newline at end of file
......@@ -6,13 +6,8 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<?php wp_head(); ?>
<title><?php wp_title("&bull;", "true", "right"); ?>Creepy web</title>
<script>
WebFont.load({
google: {
families: ['Open Sans:300,400,500,600,700,800:latin,latin-ext',]
}
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&display=swap&subset=latin-ext" rel="stylesheet">
</head>
<body <?php body_class(); ?>>
<div class='container'>
$(document).ready(function(){
var parsed;
$.ajax({
url: "https://api.exchangeratesapi.io/latest?base=USD",
type: 'get',
dataType: 'html',
async: false,
success: function(data) {
parsed = JSON.parse(data);
}
});
var prefixes = {
"BRL" : "R$",
"CZK" : "",
"CAD" : "C$",
"EUR" : "",
"USD" : "$",
}
function calculation(action) {
var currency = $('.select__currency').attr('currency');
var dollars = parseInt($('.dollar').val().replace('$', '').replace(',', ''));
var amount = parseInt($('.input__currency').val().replace(prefixes[currency], '').replace(',', ''));
var vypocet = 0;
switch(action){
case 'multiple': //From dollar to other
var vypocet = (dollars*parsed.rates[currency]).toFixed(2);
$('.input__currency').val(prefixes[currency] + vypocet);
$('.dollar').val("$" + dollars);
break;
case 'divide': //From other to dollars
var vypocet = (amount/parsed.rates[currency]).toFixed(2);
$('.dollar').val("$" + vypocet);
$('.input__currency').val(prefixes[currency] + amount);
break;
}
$('.submit').empty().val('Top Up ' + $('.dollar').val());
}
$('.select__currency').click().change(function(){
var currency = $(this).val();
$('.select__currency').removeClass().addClass('select__currency flag__' + currency).attr('currency', currency);
$('#amountToPay').empty().append('Amount to pay in ' + currency);
});
$('.select__currency, .dollar').click().change(function() {
calculation('multiple');
});
$('.input__currency').change(function(){
calculation('divide');
})
});
\ No newline at end of file
......@@ -13,39 +13,76 @@
<div class='top-up'>
<h2>Top Up</h2>
<h3>Amount to top up in USD</h3>
<form action=''>
<input type='text' data-type="currency" class='dollar' value='$1,000'>
<span class='dollar__right'>
</span>
<form method='post'>
<input type='text' class='dollar' name='usd' value='$0'>
<span class='dollar__right'>USD</span>
<div class='clear'></div>
<a href='#' class='reveal' tabindex='-1'>See Calculations</a>
<div class='transfer'></div>
<div class='clear'></div>
<h3 id='amountToPay'>Amount to pay in BRL</h3>
<input type='text' class='input__currency' value='R$0'>
<select class='select__currency flag__BRL' currency="BRL">
<option class='selection' value='BRL'>BRL</option>
<option class='selection' value='CAD'>CAD</option>
<option class='selection' value='CZK'>CZK</option>
<option class='selection' value='EUR'>EUR</option>
<option class='selection' value='USD'>USD</option>
</select>
<div class='clear'></div>
<p class='reveal'>See Calculations</p>
<h3>Amount to pay in BRL</h3>
<input type='text' data-type="currency" class='select__currency' value='R$245,42'>
<h3>Payment method</h3>
<input type='text' class='payment__method' value='Fast transfer – Send money with a TED Ba...'>
<input type='submit' class='submit' value='Top Up $1,000'>
<select class='payment__method' name='payment'>
<option value='fasttransfer'>Fast transfer – Send money with a TED Ba...</option>
<option value='paypal'>PayPal</option>
<option value='eur'>Venmo</option>
<option value='usd'>Airbank</option>
</select>
<input type='submit' class='submit' value='Top Up $1,000' name='submit'>
</form>
</div>
<?php
if (isset($_POST['submit'])) {
$payment = $_POST['payment'];
$amount = preg_replace("/[^0-9.]/", "", $_POST['usd']);
if($amount > 0) {
add_transaction($amount, $payment, 'topup', 'topup', 'Top-Up');
}
}
/*
if (isset($_POST['submit']) ) {
$user_id = get_current_user_id();
$payment = $_POST['payment'];
$amount = preg_replace("/[^0-9.]/", "", $_POST['usd']);
$message = $user_id . 'topped up by $' . $amount . ' using ' . $payment;
$post = array(
'post_author' => $user_id,
'post_content' => 'User ' . $user_id . ' Topped Up their account by $' . $amount . " using " . $payment,
'post_title' => 'Top-Up',
'post_status' => 'publish',
'post_type' => 'transaction',
'post_category' => array('topup'),
'meta_input' => array('amount' => $amount)
);
if(empty(get_user_meta($user_id, 'balance') )){
add_user_meta($user_id, 'balance', 0, true);
}
$money = get_user_meta($user_id, 'balance', true);
$money += $amount;
update_user_meta($user_id, 'balance', $money);
wp_insert_post($post);
}
<?php /*
<form action="">
<label class='test'>
<span>$</span>
<input type='number' class='money__dollar' value='1,000'>
</label>
</form>
*/ ?>
*/
?>
</div>
<!-- div container closed in footer.php -->
<?php get_footer(); ?>
\ No newline at end of file
......@@ -3,27 +3,23 @@
background-color: $yellow;
width: calc(100% - 64px);
height: calc( 100% - 160px );
//box-shadow: 0 5px 0 rgba(202, 172, 0, 0.88), 0 2px 24px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 0 rgba(202, 172, 0, 0.88), 0 2px 24px rgba(0, 0, 0, 0.5), 0px 120px 0px 0px rgba(0,0,0,0.15);
border-radius: 0 0 20px 20px;
padding: 71px 32px 0;
position: absolute;
z-index: 999;
box-shadow: 0px 120px 0px 0px rgba(0,0,0,0.15);
h2 {
margin: 0;
color: $darkgray;
font-size: 24px;
font-weight: 800;
}
h3 {
color: $darkgray;
font-size: 21px;
font-weight: 700;
margin-bottom: 13px;
}
.dollar {
width: calc(100% - 44px - 75px);
border-radius: 5px 0px 0px 5px;
......@@ -38,44 +34,115 @@
.dollar__right {
float: left;
width: 74px;
height: 86px;
height: 40px;
background-color: $white;
border-radius: 0px 5px 5px 0px;
background-image: url('./../assets/svg/usa_flag.svg');
background-size: 21px auto;
background-repeat: no-repeat;
background-position: 50% 27px;
padding-top: 46px;
text-align: center;
color: #231f20;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
}
.reveal {
color: #968000;
color: $darkorange;
font-size: 12px;
font-weight: 500;
margin-top: 13px;
padding-right: 30px;
background-image: url('./../assets/svg/arrow.svg');
background-repeat: no-repeat;
background-position: top 50% right 0;
text-decoration: none;
float: left;
}
.select__currency {
width: calc(100% - 44px) ;
.transfer {
height: 50px;
width: 50px;
border-radius: 50px;
background-color: black;
float: right;
margin-top: 19px;
margin-bottom: -40px;
background-image: url('./../assets/svg/transfer.svg');
background-size: auto 19px;
background-repeat: no-repeat;
background-position: 15px 50%;
}
.input__currency {
width: calc(100% - 44px - 75px);
background-color: transparent;
border-radius: 5px;
border: 1px solid #968000;
border-radius: 5px 0px 0px 5px;
border: 1px solid $darkorange;
font-size: 36px;
font-weight: 600;
padding: 22px 20px;
float: left;
-webkit-appearance: none;
}
.select__currency {
float: left;
width: 74px;
height: 88px;
border: 1px solid $darkorange;
border-left: none;
background-color: transparent;