2021-03-14 17:31:55 -04:00
< ? php
2021-03-19 16:06:32 -04:00
$mode = $_GET [ 'mode' ] ? ? 'home' ;
2021-03-14 17:31:55 -04:00
2021-03-19 16:06:32 -04:00
$templateVars = [
'mode' => $mode
];
$page_html = parse_template ( 'support/partials/support_navtabs' , $templateVars );
switch ( $mode ) {
case 'home' :
$page_html .= parse_template ( 'support/home' , [
'user' => $user
]);
break ;
case 'donate' :
$wallet_no = substr ( $user -> user_id , - 1 );
$wallet_no_2 = floor ( substr ( $user -> user_id , - 1 ) / 2 );
$page_html .= parse_template ( 'support/donate' , [
'wallet_no' => $wallet_no ,
'wallet_no_2' => $wallet_no_2
]);
break ;
case 'history' :
$transactions = $user -> get_transactions ();
2021-03-14 17:31:55 -04:00
2021-03-19 16:06:32 -04:00
if ( $transactions ) {
$sql -> modify ( 'claim_transaction' , ' UPDATE mangadex_user_transactions SET user_id = ? WHERE user_id = 0 AND email LIKE ? ' , [ $user -> user_id , $transactions [ 0 ][ 'email' ]]);
$memcached -> delete ( " user_ { $user -> user_id } _transactions " );
}
$page_html .= parse_template ( 'support/history' , [
'user' => $user
]);
break ;
case 'affiliates' :
$page_html .= parse_template ( 'support/affiliates' , $templateVars );
break ;
}
2021-03-14 17:31:55 -04:00