Merge branch 'development' into shift-77419

This commit is contained in:
Dennis 2023-01-06 00:13:50 +01:00 committed by GitHub
commit aacbd6780c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 381 additions and 130 deletions

View file

@ -69,31 +69,33 @@ class System
$this->updateIcons($request);
$values = [
'SETTINGS::SYSTEM:REGISTER_IP_CHECK' => 'register-ip-check',
'SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR' => 'server-create-charge-first-hour',
'SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME' => 'credits-display-name',
'SETTINGS::SERVER:ALLOCATION_LIMIT' => 'allocation-limit',
'SETTINGS::USER:FORCE_DISCORD_VERIFICATION' => 'force-discord-verification',
'SETTINGS::USER:FORCE_EMAIL_VERIFICATION' => 'force-email-verification',
'SETTINGS::USER:INITIAL_CREDITS' => 'initial-credits',
'SETTINGS::USER:INITIAL_SERVER_LIMIT' => 'initial-server-limit',
'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD' => 'credits-reward-amount-discord',
'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL' => 'credits-reward-amount-email',
'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD' => 'server-limit-discord',
'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL' => 'server-limit-email',
'SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE' => 'server-limit-purchase',
'SETTINGS::MISC:PHPMYADMIN:URL' => 'phpmyadmin-url',
'SETTINGS::SYSTEM:PTERODACTYL:URL' => 'pterodactyl-url',
'SETTINGS::SYSTEM:PTERODACTYL:PER_PAGE_LIMIT' => 'per-page-limit',
'SETTINGS::SYSTEM:PTERODACTYL:TOKEN' => 'pterodactyl-api-key',
'SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO' => 'enable-login-logo',
'SETTINGS::SYSTEM:PTERODACTYL:ADMIN_USER_TOKEN' => 'pterodactyl-admin-api-key',
'SETTINGS::SYSTEM:ENABLE_UPGRADE' => 'enable-upgrade',
'SETTINGS::SYSTEM:CREATION_OF_NEW_SERVERS' => 'enable-disable-servers',
'SETTINGS::SYSTEM:CREATION_OF_NEW_USERS' => 'enable-disable-new-users',
'SETTINGS::SYSTEM:SHOW_IMPRINT' => 'show-imprint',
'SETTINGS::SYSTEM:SHOW_PRIVACY' => 'show-privacy',
'SETTINGS::SYSTEM:SHOW_TOS' => 'show-tos',
"SETTINGS::SYSTEM:REGISTER_IP_CHECK" => "register-ip-check",
"SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR" => "server-create-charge-first-hour",
"SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME" => "credits-display-name",
"SETTINGS::SERVER:ALLOCATION_LIMIT" => "allocation-limit",
"SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER" => "minimum-credits",
"SETTINGS::USER:FORCE_DISCORD_VERIFICATION" => "force-discord-verification",
"SETTINGS::USER:FORCE_EMAIL_VERIFICATION" => "force-email-verification",
"SETTINGS::USER:INITIAL_CREDITS" => "initial-credits",
"SETTINGS::USER:INITIAL_SERVER_LIMIT" => "initial-server-limit",
"SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD" => "credits-reward-amount-discord",
"SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL" => "credits-reward-amount-email",
"SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD" => "server-limit-discord",
"SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL" => "server-limit-email",
"SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE" => "server-limit-purchase",
"SETTINGS::MISC:PHPMYADMIN:URL" => "phpmyadmin-url",
"SETTINGS::SYSTEM:PTERODACTYL:URL" => "pterodactyl-url",
'SETTINGS::SYSTEM:PTERODACTYL:PER_PAGE_LIMIT' => "per-page-limit",
"SETTINGS::SYSTEM:PTERODACTYL:TOKEN" => "pterodactyl-api-key",
"SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO" => "enable-login-logo",
"SETTINGS::SYSTEM:PTERODACTYL:ADMIN_USER_TOKEN" => "pterodactyl-admin-api-key",
"SETTINGS::SYSTEM:ENABLE_UPGRADE" => "enable-upgrade",
"SETTINGS::SYSTEM:CREATION_OF_NEW_SERVERS" => "enable-disable-servers",
"SETTINGS::SYSTEM:CREATION_OF_NEW_USERS" => "enable-disable-new-users",
"SETTINGS::SYSTEM:SHOW_IMPRINT" => "show-imprint",
"SETTINGS::SYSTEM:SHOW_PRIVACY" => "show-privacy",
"SETTINGS::SYSTEM:SHOW_TOS" => "show-tos",
];
foreach ($values as $key => $value) {

View file

@ -44,25 +44,18 @@ class OverViewController extends Controller
$counters->put('payments', collect());
//Get and save payments from last 2 months for later filtering and looping
$payments = Payment::query()->where('created_at', '>=', Carbon::today()->startOfMonth()->subMonth())->where('status', 'paid')->get();
//Prepare collections and set a few variables
//Prepare collections
$counters['payments']->put('thisMonth', collect());
$counters['payments']->put('lastMonth', collect());
$counters['payments']['thisMonth']->timeStart = Carbon::today()->startOfMonth()->toDateString();
$counters['payments']['thisMonth']->timeEnd = Carbon::today()->toDateString();
$counters['payments']['lastMonth']->timeStart = Carbon::today()->startOfMonth()->subMonth()->toDateString();
$counters['payments']['lastMonth']->timeEnd = Carbon::today()->endOfMonth()->subMonth()->toDateString();
//Prepare subCollection 'taxPayments'
$counters->put('taxPayments', collect());
//Get and save taxPayments from last 2 years for later filtering and looping
$taxPayments = Payment::query()->where('created_at', '>=', Carbon::today()->startOfYear()->subYear())->where('status', 'paid')->get();
//Prepare collections and set a few variables
//Prepare collections
$counters['taxPayments']->put('thisYear', collect());
$counters['taxPayments']->put('lastYear', collect());
$counters['taxPayments']['thisYear']->timeStart = Carbon::today()->startOfYear()->toDateString();
$counters['taxPayments']['thisYear']->timeEnd = Carbon::today()->toDateString();
$counters['taxPayments']['lastYear']->timeStart = Carbon::today()->startOfYear()->subYear()->toDateString();
$counters['taxPayments']['lastYear']->timeEnd = Carbon::today()->endOfYear()->subYear()->toDateString();
//Fill out variables for each currency separately
foreach ($payments->where('created_at', '>=', Carbon::today()->startOfMonth()) as $payment) {
@ -85,11 +78,21 @@ class OverViewController extends Controller
$counters['payments']['lastMonth'][$paymentCurrency]->total += $payment->total_price;
$counters['payments']['lastMonth'][$paymentCurrency]->count++;
}
//sort currencies alphabetically and set some additional variables
$counters['payments']['thisMonth'] = $counters['payments']['thisMonth']->sortKeys();
$counters['payments']['thisMonth']->timeStart = Carbon::today()->startOfMonth()->toDateString();
$counters['payments']['thisMonth']->timeEnd = Carbon::today()->toDateString();
$counters['payments']['lastMonth'] = $counters['payments']['lastMonth']->sortKeys();
$counters['payments']['lastMonth']->timeStart = Carbon::today()->startOfMonth()->subMonth()->toDateString();
$counters['payments']['lastMonth']->timeEnd = Carbon::today()->endOfMonth()->subMonth()->toDateString();
$counters['payments']->total = Payment::query()->count();
foreach ($taxPayments->where('created_at', '>=', Carbon::today()->startOfYear()->subYear()) as $taxPayment) {
$paymentCurrency = $payment->currency_code;
if (! isset($counters['taxPayments']['thisYear'][$paymentCurrency])) {
foreach($taxPayments->where('created_at', '>=', Carbon::today()->startOfYear()) as $taxPayment){
$paymentCurrency = $taxPayment->currency_code;
if(!isset($counters['taxPayments']['thisYear'][$paymentCurrency])){
$counters['taxPayments']['thisYear']->put($paymentCurrency, collect());
$counters['taxPayments']['thisYear'][$paymentCurrency]->total = 0;
$counters['taxPayments']['thisYear'][$paymentCurrency]->count = 0;
@ -101,9 +104,11 @@ class OverViewController extends Controller
$counters['taxPayments']['thisYear'][$paymentCurrency]->price += $taxPayment->price;
$counters['taxPayments']['thisYear'][$paymentCurrency]->taxes += $taxPayment->tax_value;
}
foreach ($taxPayments->where('created_at', '<', Carbon::today()->startOfYear()) as $taxPayment) {
$paymentCurrency = $payment->currency_code;
if (! isset($counters['taxPayments']['lastYear'][$paymentCurrency])) {
foreach($taxPayments->where('created_at', '>=', Carbon::today()->startOfYear()->subYear())->where('created_at', '<', Carbon::today()->startOfYear()) as $taxPayment){
$paymentCurrency = $taxPayment->currency_code;
if(!isset($counters['taxPayments']['lastYear'][$paymentCurrency])){
$counters['taxPayments']['lastYear']->put($paymentCurrency, collect());
$counters['taxPayments']['lastYear'][$paymentCurrency]->total = 0;
$counters['taxPayments']['lastYear'][$paymentCurrency]->count = 0;
@ -116,6 +121,14 @@ class OverViewController extends Controller
$counters['taxPayments']['lastYear'][$paymentCurrency]->taxes += $taxPayment->tax_value;
}
//sort currencies alphabetically and set some additional variables
$counters['taxPayments']['thisYear'] = $counters['taxPayments']['thisYear']->sortKeys();
$counters['taxPayments']['thisYear']->timeStart = Carbon::today()->startOfYear()->toDateString();
$counters['taxPayments']['thisYear']->timeEnd = Carbon::today()->toDateString();
$counters['taxPayments']['lastYear'] = $counters['taxPayments']['lastYear']->sortKeys();
$counters['taxPayments']['lastYear']->timeStart = Carbon::today()->startOfYear()->subYear()->toDateString();
$counters['taxPayments']['lastYear']->timeEnd = Carbon::today()->endOfYear()->subYear()->toDateString();
$lastEgg = Egg::query()->latest('updated_at')->first();
$syncLastUpdate = $lastEgg ? $lastEgg->updated_at->isoFormat('LLL') : __('unknown');

View file

@ -70,8 +70,61 @@ class PaymentController extends Controller
* @param ShopProduct $shopProduct
* @return RedirectResponse
*/
public function FreePay(Request $request, ShopProduct $shopProduct)
{
//dd($shopProduct);
//check if the product is really free or the discount is 100%
if($shopProduct->getTotalPrice()>0) return redirect()->route('home')->with('error', __('An error ocured. Please try again.'));
//give product
/** @var User $user */
$user = Auth::user();
//not updating server limit
//update User with bought item
if ($shopProduct->type=="Credits") {
$user->increment('credits', $shopProduct->quantity);
}elseif ($shopProduct->type=="Server slots"){
$user->increment('server_limit', $shopProduct->quantity);
}
//skipped the referral commission, because the user did not pay anything.
//not giving client role
//store payment
$payment = Payment::create([
'user_id' => $user->id,
'payment_id' => uniqid(),
'payment_method' => 'free',
'type' => $shopProduct->type,
'status' => 'paid',
'amount' => $shopProduct->quantity,
'price' => $shopProduct->price - ($shopProduct->price*PartnerDiscount::getDiscount()/100),
'tax_value' => $shopProduct->getTaxValue(),
'tax_percent' => $shopProduct->getTaxPercent(),
'total_price' => $shopProduct->getTotalPrice(),
'currency_code' => $shopProduct->currency_code,
'shop_item_product_id' => $shopProduct->id,
]);
event(new UserUpdateCreditsEvent($user));
//not sending an invoice
//redirect back to home
return redirect()->route('home')->with('success', __('Your credit balance has been increased!'));
}
/**
* @param Request $request
* @param ShopProduct $shopProduct
* @return RedirectResponse
*/
public function PaypalPay(Request $request, ShopProduct $shopProduct)
{
if(!$this->checkAmount($shopProduct->getTotalPrice(), strtoupper($shopProduct->currency_code), "paypal")) return redirect()->route('home')->with('error', __('The product you chose can´t be purchased with this payment method. The total amount is too small. Please buy a bigger amount or try a different payment method.'));
$request = new OrdersCreateRequest();
$request->prefer('return=representation');
$request->body = [
@ -271,6 +324,7 @@ class PaymentController extends Controller
*/
public function StripePay(Request $request, ShopProduct $shopProduct)
{
if(!$this->checkAmount($shopProduct->getTotalPrice(), strtoupper($shopProduct->currency_code), "stripe")) return redirect()->route('home')->with('error', __('The product you chose can´t be purchased with this payment method. The total amount is too small. Please buy a bigger amount or try a different payment method.'));
$stripeClient = $this->getStripeClient();
$request = $stripeClient->checkout->sessions->create([
@ -637,6 +691,114 @@ class PaymentController extends Controller
$user->notify(new InvoiceNotification($invoice, $user, $payment));
}
public function checkAmount($amount, $currencyCode, $payment_method)
{
$minimums = [
"USD" => [
"paypal" => 0,
"stripe" => 0.5
],
"AED" => [
"paypal" => 0,
"stripe" => 2
],
"AUD" => [
"paypal" => 0,
"stripe" => 0.5
],
"BGN" => [
"paypal" => 0,
"stripe" => 1
],
"BRL" => [
"paypal" => 0,
"stripe" => 0.5
],
"CAD" => [
"paypal" => 0,
"stripe" => 0.5
],
"CHF" => [
"paypal" => 0,
"stripe" => 0.5
],
"CZK" => [
"paypal" => 0,
"stripe" => 15
],
"DKK" => [
"paypal" => 0,
"stripe" => 2.5
],
"EUR" => [
"paypal" => 0,
"stripe" => 0.5
],
"GBP" => [
"paypal" => 0,
"stripe" => 0.3
],
"HKD" => [
"paypal" => 0,
"stripe" => 4
],
"HRK" => [
"paypal" => 0,
"stripe" => 0.5
],
"HUF" => [
"paypal" => 0,
"stripe" => 175
],
"INR" => [
"paypal" => 0,
"stripe" => 0.5
],
"JPY" => [
"paypal" => 0,
"stripe" => 0.5
],
"MXN" => [
"paypal" => 0,
"stripe" => 10
],
"MYR" => [
"paypal" => 0,
"stripe" => 2
],
"NOK" => [
"paypal" => 0,
"stripe" => 3
],
"NZD" => [
"paypal" => 0,
"stripe" => 0.5
],
"PLN" => [
"paypal" => 0,
"stripe" => 2
],
"RON" => [
"paypal" => 0,
"stripe" => 2
],
"SEK" => [
"paypal" => 0,
"stripe" => 3
],
"SGD" => [
"paypal" => 0,
"stripe" => 0.5
],
"THB" => [
"paypal" => 0,
"stripe" => 10
]
];
return $amount >= $minimums[$currencyCode][$payment_method];
}
/**
* @return JsonResponse|mixed
*
@ -647,9 +809,11 @@ class PaymentController extends Controller
$query = Payment::with('user');
return datatables($query)
->editColumn('user', function (Payment $payment) {
return
($payment->user) ? '<a href="'.route('admin.users.show', $payment->user->id).'">'.$payment->user->name.'</a>' : __('Unknown user');
->addColumn('user', function (Payment $payment) {
return
($payment->user)?'<a href="'.route('admin.users.show', $payment->user->id).'">'.$payment->user->name.'</a>':__('Unknown user');
})
->editColumn('price', function (Payment $payment) {
return $payment->formatToCurrency($payment->price);
@ -665,7 +829,8 @@ class PaymentController extends Controller
})
->editColumn('created_at', function (Payment $payment) {
return $payment->created_at ? $payment->created_at->diffForHumans() : '';
return ['display' => $payment->created_at ? $payment->created_at->diffForHumans() : '',
'raw' => $payment->created_at ? strtotime($payment->created_at) : ''];
})
->addColumn('actions', function (Payment $payment) {
return '<a data-content="'.__('Download').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('admin.invoices.downloadSingleInvoice', 'id='.$payment->payment_id).'" class="btn btn-sm text-white btn-info mr-1"><i class="fas fa-file-download"></i></a>';

View file

@ -229,6 +229,9 @@ class ProductController extends Controller
</form>
';
})
->editColumn('minimum_credits', function (Product $product) {
return $product->minimum_credits==-1 ? config('SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER') : $product->minimum_credits;
})
->editColumn('created_at', function (Product $product) {
return $product->created_at ? $product->created_at->diffForHumans() : '';
})

View file

@ -117,10 +117,14 @@ class TicketsController extends Controller
return '<span class="badge '.$badgeColor.'">'.$tickets->status.'</span>';
})
->editColumn('updated_at', function (Ticket $tickets) {
return $tickets->updated_at ? $tickets->updated_at->diffForHumans() : '';
->editColumn('priority', function (Ticket $tickets) {
return __($tickets->priority);
})
->rawColumns(['category', 'title', 'user_id', 'status', 'updated_at', 'actions'])
->editColumn('updated_at', function (Ticket $tickets) {
return ['display' => $tickets->updated_at ? $tickets->updated_at->diffForHumans() : '',
'raw' => $tickets->updated_at ? strtotime($tickets->updated_at) : ''];
})
->rawColumns(['category', 'title', 'user_id', 'status', 'priority', 'updated_at', 'actions'])
->make(true);
}

View file

@ -100,6 +100,13 @@ class TicketsController extends Controller
return redirect()->back()->with('success', __('Your comment has been submitted'));
}
public function close($ticket_id)
{
$ticket = Ticket::where('user_id', Auth::user()->id)->where("ticket_id", $ticket_id)->firstOrFail();
$ticket->status = "Closed";
$ticket->save();
return redirect()->back()->with('success', __('A ticket has been closed, ID: #') . $ticket->ticket_id);
}
public function dataTable()
{
@ -130,6 +137,9 @@ class TicketsController extends Controller
return '<span class="badge '.$badgeColor.'">'.$tickets->status.'</span>';
})
->editColumn('priority', function (Ticket $tickets) {
return __($tickets->priority);
})
->editColumn('updated_at', function (Ticket $tickets) {
return $tickets->updated_at ? $tickets->updated_at->diffForHumans() : '';
})

View file

@ -117,6 +117,13 @@ class SettingsSeeder extends Seeder
'type' => 'integer',
'description' => 'The maximum amount of allocations to pull per node for automatic deployment, if more allocations are being used than this limit is set to, no new servers can be created!',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER',
], [
'value' => '0',
'type' => 'integer',
'description' => 'The minimum amount of credits user has to have to create a server. Can be overridden by package limits.'
]);
//credits display name
Settings::firstOrCreate([
@ -545,16 +552,27 @@ class SettingsSeeder extends Seeder
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:SHOW_IMPRINT',
], [
'value' => 'true',
'type' => 'boolean',
'description' => 'Enable/disable imprint in footer',
'value' => "false",
'type' => 'boolean',
'description' => 'Enable/disable imprint in footer'
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:SHOW_PRIVACY',
], [
'value' => 'true',
'value' => "false",
'type' => 'boolean',
'description' => 'Enable/disable privacy policy in footer'
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:SHOW_TOS',
], [
'value' => 'false',
'type' => 'boolean',
'description' => 'Enable/disable privacy policy in footer',
'description' => 'Enable/disable Terms of Service in footer',
]);
}
}

View file

@ -56,7 +56,11 @@
</div>
<div class="form-group">
<label for="partner_discount">{{__('Partner discount')}}</label>
<label for="partner_discount">{{__('Partner discount')}}
<i data-toggle="popover" data-trigger="hover"
data-content="{{__('The discount in percent given to the partner at checkout.')}}"
class="fas fa-info-circle"></i>
</label>
<input value="{{old('partner_discount')}}" placeholder="{{__('Discount in percent')}}" id="partner_discount" name="partner_discount"
type="number" step="any" min="0" max="100"
class="form-control @error('partner_discount') is-invalid @enderror">
@ -69,7 +73,11 @@
<div class="form-group">
<label for="registered_user_discount">{{__('Registered user discount')}}</label>
<label for="registered_user_discount">{{__('Registered user discount')}}
<i data-toggle="popover" data-trigger="hover"
data-content="{{__('The discount in percent given to all users registered using the partners referral link.')}}"
class="fas fa-info-circle"></i>
</label>
<div class="input-group">
<input value="{{old('registered_user_discount')}}" placeholder="Discount in percent" id="registered_user_discount" name="registered_user_discount"
type="number" class="form-control @error('registered_user_discount') is-invalid @enderror"

View file

@ -58,7 +58,11 @@
</div>
<div class="form-group">
<label for="partner_discount">{{__('Partner discount')}}</label>
<label for="partner_discount">{{__('Partner discount')}}
<i data-toggle="popover" data-trigger="hover"
data-content="{{__('The discount in percent given to the partner at checkout.')}}"
class="fas fa-info-circle"></i>
</label>
<input value="{{$partner->partner_discount}}" placeholder="{{__('Discount in percent')}}" id="partner_discount" name="partner_discount"
type="number" step="any" min="0" max="100"
class="form-control @error('partner_discount') is-invalid @enderror">
@ -71,7 +75,11 @@
<div class="form-group">
<label for="registered_user_discount">{{__('Registered user discount')}}</label>
<label for="registered_user_discount">{{__('Registered user discount')}}
<i data-toggle="popover" data-trigger="hover"
data-content="{{__('The discount in percent given to all users registered using the partners referral link.')}}"
class="fas fa-info-circle"></i>
</label>
<div class="input-group">
<input value="{{$partner->registered_user_discount}}" placeholder="Discount in percent" id="registered_user_discount" name="registered_user_discount"
type="number" class="form-control @error('registered_user_discount') is-invalid @enderror"

View file

@ -45,7 +45,6 @@
<th>{{ __('Tax Value') }}</th>
<th>{{ __('Tax Percentage') }}</th>
<th>{{ __('Total Price') }}</th>
<th>{{ __('User') }}</th>
<th>{{ __('Payment ID') }}</th>
<th>{{ __('Payment Method') }}</th>
<th>{{ __('Created at') }}</th>
@ -74,20 +73,19 @@
serverSide: true,
stateSave: true,
ajax: "{{ route('admin.payments.datatable') }}",
order: [[ 9, "desc" ]],
order: [[ 10, "desc" ]],
columns: [
{data: 'id',name: 'payments.id'},
{data: 'type'},
{data: 'user', sortable: false},
{data: 'user'},
{data: 'amount'},
{data: 'price'},
{data: 'tax_value'},
{data: 'tax_percent'},
{data: 'total_price'},
{data: 'user'},
{data: 'payment_id'},
{data: 'payment_method'},
{data: 'created_at'},
{data: 'created_at', type: 'num', render: {_: 'display', sort: 'raw'}},
{data: 'actions' , sortable : false},
],
fnDrawCallback: function(oSettings) {

View file

@ -52,6 +52,7 @@
<th>{{__('Backups')}}</th>
<th>{{__('Nodes')}}</th>
<th>{{__('Eggs')}}</th>
<th>{{__('Min Credits')}}</th>
<th>{{__('Servers')}}</th>
<th>{{__('Created at')}}</th>
<th></th>
@ -99,6 +100,7 @@
{data: "backups"},
{data: "nodes", sortable: false},
{data: "eggs", sortable: false},
{data: "minimum_credits"},
{data: "servers", sortable: false},
{data: "created_at"},
{data: "actions", sortable: false}

View file

@ -258,16 +258,16 @@
data-content="{{ __('If a referred user buys credits, the referral-user will get x% of the Credits the referred user bought') }}" class="fas fa-info-circle"></i>
</label>
<input x-model="referral_percentage" id="referral_percentage" name="referral_percentage"
type="number" value="{{ config('SETTINGS::REFERRAL:PERCENTAGE') }}"
class="form-control @error('referral_percentage') is-invalid @enderror">
type="number" min="0" max="99999999" value="{{ config('SETTINGS::REFERRAL:PERCENTAGE') }}"
class="form-control @error('referral_percentage') is-invalid @enderror">
</div>
</div>
<div class="form-group mb-3">
<div class="custom-control p-0">
<label for="referral_reward">{{ __('Referral reward in') }} {{ config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME', 'Credits') }} {{__("(only for sign-up-mode)")}}:</label>
<input x-model="referral_reward" id="referral_reward" name="referral_reward"
type="number" value="{{ config('SETTINGS::REFERRAL::REWARD') }}"
class="form-control @error('referral_reward') is-invalid @enderror">
type="number" min="0" max="99999999" value="{{ config('SETTINGS::REFERRAL::REWARD') }}"
class="form-control @error('referral_reward') is-invalid @enderror">
</div>
</div>
<div class="custom-control mb-3 p-0">

View file

@ -130,7 +130,7 @@
data-content="Tax Value that will be added to the total price of the order. <br><br> Example: 19 results in (19%)"
class="fas fa-info-circle"></i>
</div>
<input x-model="sales-tax" id="sales-tax" name="sales-tax" type="number" step=".01"
<input x-model="sales-tax" id="sales-tax" name="sales-tax" type="number" step="0.01" min="0" max="99999999"
value="{{ config('SETTINGS::PAYMENTS:SALES_TAX') }}"
class="form-control @error('sales-tax') is-invalid @enderror">
</div>

View file

@ -113,7 +113,7 @@
<div class="custom-control mb-3 p-0">
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
<label for="per-page-limit">{{ __('Pterodactyl API perPage limit') }}</label>
<i data-toggle="popover" data-trigger="hover" data-html="true"
<i data-toggle="popover" data-trigger="hover" data-html="true" type="number" min="0" max="99999999"
data-content="{{ __('The Pterodactyl API perPage limit. It is necessary to set it higher than your server count.') }}"
class="fas fa-info-circle"></i>
</div>
@ -189,20 +189,20 @@
<div class="custom-control mb-3 p-0">
<label for="initial-credits">{{ __('Initial Credits') }}</label>
<input x-model="initial-credits" id="initial-credits" name="initial-credits" type="number"
<input x-model="initial-credits" id="initial-credits" name="initial-credits" type="number" min="0" max="99999999"
value="{{ config('SETTINGS::USER:INITIAL_CREDITS') }}"
class="form-control @error('initial-credits') is-invalid @enderror" required>
</div>
<div class="custom-control mb-3 p-0">
<label for="initial-server-limit">{{ __('Initial Server Limit') }}</label>
<input x-model="initial-server-limit" id="initial-server-limit" name="initial-server-limit"
type="number" value="{{ config('SETTINGS::USER:INITIAL_SERVER_LIMIT') }}"
<input x-model="initial-server-limit" id="initial-server-limit" name="initial-server-limit" type="number" min="0" max="99999999"
value="{{ config('SETTINGS::USER:INITIAL_SERVER_LIMIT') }}"
class="form-control @error('initial-server-limit') is-invalid @enderror" required>
</div>
<div class="custom-control mb-3 p-0">
<label for="credits-reward-amount-discord">{{ __('Credits Reward Amount - Discord') }}</label>
<input x-model="credits-reward-amount-discord" id="credits-reward-amount-discord"
name="credits-reward-amount-discord" type="number"
name="credits-reward-amount-discord" type="number" min="0" max="99999999"
value="{{ config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') }}"
class="form-control @error('credits-reward-amount-discord') is-invalid @enderror" required>
</div>
@ -210,28 +210,28 @@
<div class="custom-control mb-3 p-0">
<label for="credits-reward-amount-email">{{ __('Credits Reward Amount - E-Mail') }}</label>
<input x-model="credits-reward-amount-email" id="credits-reward-amount-email"
name="credits-reward-amount-email" type="number"
name="credits-reward-amount-email" type="number" min="0" max="99999999"
value="{{ config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') }}"
class="form-control @error('credits-reward-amount-email') is-invalid @enderror" required>
</div>
<div class="custom-control mb-3 p-0">
<label for="server-limit-discord">{{ __('Server Limit Increase - Discord') }}</label>
<input x-model="server-limit-discord" id="server-limit-discord" name="server-limit-discord"
type="number"
type="number" min="0" max="99999999"
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') }}"
class="form-control @error('server-limit-discord') is-invalid @enderror" required>
</div>
<div class="custom-control mb-3 p-0">
<label for="server-limit-email">{{ __('Server Limit Increase - E-Mail') }}</label>
<input x-model="server-limit-email" id="server-limit-email" name="server-limit-email"
type="number"
type="number" min="0" max="99999999"
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') }}"
class="form-control @error('server-limit-email') is-invalid @enderror" required>
</div>
<div class="custom-control mb-3 p-0">
<label for="server-limit-purchase">{{ __('Server Limit after Credits Purchase') }}</label>
<input x-model="server-limit-purchase" id="server-limit-purchase"
name="server-limit-purchase" type="number"
name="server-limit-purchase" type="number" min="0" max="99999999"
value="{{ config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') }}"
class="form-control @error('server-limit-purchase') is-invalid @enderror" required>
</div>
@ -278,15 +278,26 @@
<div class="form-group">
<div class="custom-control mb-3 p-0">
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
<label for="initial-credits">{{ __('Server Allocation Limit') }}</label>
<label for="allocation-limit">{{ __('Server Allocation Limit') }}</label>
<i data-toggle="popover" data-trigger="hover" data-html="true"
data-content="{{ __('The maximum amount of allocations to pull per node for automatic deployment, if more allocations are being used than this limit is set to, no new servers can be created!') }}"
class="fas fa-info-circle"></i>
</div>
<input x-model="allocation-limit" id="allocation-limit" name="allocation-limit"
type="number" value="{{ config('SETTINGS::SERVER:ALLOCATION_LIMIT') }}"
type="number" min="0" max="99999999" value="{{ config('SETTINGS::SERVER:ALLOCATION_LIMIT') }}"
class="form-control @error('allocation-limit') is-invalid @enderror" required>
</div>
<div class="custom-control mb-3 p-0">
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
<label for="minimum-credits">{{ __('Minimum credits') }}</label>
<i data-toggle="popover" data-trigger="hover" data-html="true"
data-content="{{ __('The minimum amount of credits user has to have to create a server. Can be overridden by package limits.') }}"
class="fas fa-info-circle"></i>
</div>
<input x-model="minimum-credits" id="minimum-credits" name="minimum-credits"
type="number" min="0" max="99999999" value="{{ config('SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER') }}"
class="form-control @error('minimum-credits') is-invalid @enderror" required>
</div>
</div>
</div>

View file

@ -8,7 +8,7 @@
City<br>
Country<br>
Phone: +00 000 000 000<br>
Email: <a href="mailto">[email protected]</a>
Email: PUT YOUR EMAIL HERE</a>
</p>
<p>

View file

@ -40,6 +40,7 @@
<th>{{__('Category')}}</th>
<th>{{__('Title')}}</th>
<th>{{__('User')}}</th>
<th>{{__('Priority')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Last Updated')}}</th>
<th>{{__('Actions')}}</th>
@ -69,12 +70,14 @@
serverSide: true,
stateSave: true,
ajax: "{{route('moderator.ticket.datatable')}}",
order: [[ 4, "desc" ]],
columns: [
{data: 'category'},
{data: 'title'},
{data: 'user_id'},
{data: 'priority'},
{data: 'status'},
{data: 'updated_at'},
{data: 'updated_at', type: 'num', render: {_: 'display', sort: 'raw'}},
{data: 'actions', sortable: false},
],
fnDrawCallback: function( oSettings ) {

View file

@ -312,15 +312,14 @@
</section>
<!-- END CONTENT -->
<script>
document.getElementById("confirmDeleteButton").onclick=async ()=>{
const {value: enterConfirm} = await Swal.fire({
input: 'text',
inputLabel: '{{__("Are you sure you want to permanently delete your account and all of your servers?")}} \n Type "delete my account" in the Box below',
inputPlaceholder: 'delete my account',
inputLabel: '{{__("Are you sure you want to permanently delete your account and all of your servers?")}} \n Type "{{__('Delete my account')}}" in the Box below',
inputPlaceholder: "{{__('Delete my account')}}",
showCancelButton: true
})
if (enterConfirm === "delete my account") {
if (enterConfirm === "{{__('Delete my account')}}") {
Swal.fire("{{__('Account has been destroyed')}}", '', 'error')
$.ajax({
type: "POST",
@ -336,7 +335,7 @@
location.reload();
} else {
Swal.fire("{{__('Account has not been destroyed')}}", '', 'info')
Swal.fire("{{__('Account was NOT deleted.')}}", '', 'info')
}

View file

@ -36,6 +36,13 @@
class="fa fa-plus mr-2"></i>
{{ __('Create Server') }}
</a>
@if (Auth::user()->Servers->count() > 0&&!empty(config('SETTINGS::MISC:PHPMYADMIN:URL')))
<a
href="{{ config('SETTINGS::MISC:PHPMYADMIN:URL') }}" target="_blank"
class="btn btn-secondary ml-2"><i title="manage"
class="fas fa-database mr-2"></i><span>{{ __('Database') }}</span>
</a>
@endif
</div>
<div class="row d-flex flex-row justify-content-center justify-content-md-start">
@ -47,25 +54,6 @@
<div class="d-flex justify-content-between align-items-center">
<h5 class="card-title mt-1">{{ $server->name }}
</h5>
<div class="card-tools mt-1">
<div class="dropdown no-arrow">
<a href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-white-50"></i>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in"
aria-labelledby="dropdownMenuLink">
@if (!empty(config('SETTINGS::MISC:PHPMYADMIN:URL')))
<a href="{{ config('SETTINGS::MISC:PHPMYADMIN:URL') }}"
class="dropdown-item text-info" target="__blank"><i title="manage"
class="fas fa-database mr-2"></i><span>{{ __('Database') }}</span></a>
@endif
<div class="dropdown-divider"></div>
<span class="dropdown-item"><i title="Created at"
class="fas fa-sync-alt mr-2"></i><span>{{ $server->created_at->isoFormat('LL') }}</span></span>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">

View file

@ -113,7 +113,8 @@
</div>
</div>
<div class="card">
<div class="card-header d-flex justify-content-between">
<div class="card-header">
<h5 class="card-title float-right"><i title="Created at" class="fas fa-calendar-alt mr-2"></i><span>{{ $server->created_at->isoFormat('LL') }}</span></h5>
<h5 class="card-title"><i class="fas fa-sliders-h mr-2"></i>{{__('Server Information')}}</h5>
</div>
<div class="card-body">

View file

@ -75,30 +75,33 @@
<div class="row">
<!-- accepted payments column -->
<div class="col-6">
<p class="lead">{{ __('Payment Methods') }}:</p>
@if($total!=0)
<p class="lead">{{ __('Payment Methods') }}:</p>
<div>
@if (config('SETTINGS::PAYMENTS:PAYPAL:SECRET') || config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET'))
<label class="text-center " for="paypal">
<img class="mb-3" height="50"
src="{{ url('/images/paypal_logo.png') }}"></br>
<input x-model="paymentMethod" type="radio" id="paypal" value="paypal"
name="payment_method">
</input>
</label>
@endif
@if (config('SETTINGS::PAYMENTS:STRIPE:TEST_SECRET') || config('SETTINGS::PAYMENTS:STRIPE:SECRET'))
<label class="ml-5 text-center " for="stripe">
<img class="mb-3" height="50"
src="{{ url('/images/stripe_logo.png') }}" /></br>
<input x-model="paymentMethod" type="radio" id="stripe" value="stripe"
name="payment_method">
</input>
</label>
@endif
</div>
<div>
@if (config('SETTINGS::PAYMENTS:PAYPAL:SECRET') || config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET'))
<label class="text-center " for="paypal">
<img class="mb-3" height="50"
src="{{ url('/images/paypal_logo.png') }}"></br>
<input x-model="paymentMethod" type="radio" id="paypal" value="paypal"
name="payment_method">
</input>
</label>
@endif
@if (config('SETTINGS::PAYMENTS:STRIPE:TEST_SECRET') || config('SETTINGS::PAYMENTS:STRIPE:SECRET'))
<label class="ml-5 text-center " for="stripe">
<img class="mb-3" height="50"
src="{{ url('/images/stripe_logo.png') }}" /></br>
<input x-model="paymentMethod" type="radio" id="stripe" value="stripe"
name="payment_method">
</input>
</label>
@endif
</div>
@else
<p class="lead" style="text-align: center">{{ __('This product is free for you') }}.</p>
@endif
</div>
<!-- /.col -->
<div class="col-6">
@ -155,7 +158,7 @@
return {
//loading
paymentMethod: '',
paymentRoute: '',
paymentRoute: ({{ $total }} == 0)?('{{ route('payment.FreePay', $product->id) }}'):'',
setPaymentRoute(provider) {
switch (provider) {
case 'paypal':

View file

@ -41,6 +41,7 @@
<tr>
<th>{{__('Category')}}</th>
<th>{{__('Title')}}</th>
<th>{{__('Priority')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Last Updated')}}</th>
</tr>
@ -61,8 +62,8 @@
class="fas fa-info-circle"></i></h5>
</div>
<div class="card-body">
<p>Can't start your server? Need an additional port? Do you have any other questions? Let us know by
opening a ticket.</p>
<p>{{__("Can't start your server? Need an additional port? Do you have any other questions? Let us know by
opening a ticket.")}}</p>
</div>
</div>
@ -84,6 +85,7 @@
columns: [
{data: 'category'},
{data: 'title'},
{data: 'priority'},
{data: 'status'},
{data: 'updated_at', sortable: false},
],

View file

@ -51,6 +51,17 @@
@endif
</p>
<p><b>Created on:</b> {{ $ticket->created_at->diffForHumans() }}</p>
@if($ticket->status!='Closed')
<form class="d-inline" method="post"
action="{{route('ticket.close', ['ticket_id' => $ticket->ticket_id ])}}">
{{csrf_field()}}
{{method_field("POST") }}
<button data-content="{{__("Close")}}" data-toggle="popover"
data-trigger="hover" data-placement="top"
class="btn btn-sm text-white btn-warning mr-1"><i
class="fas fa-times"></i>{{__("Close")}}</button>
</form>
@endif
</div>
</div>
</div>

View file

@ -94,6 +94,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::get('payment/PaypalSuccess', [PaymentController::class, 'PaypalSuccess'])->name('payment.PaypalSuccess');
Route::get('payment/StripePay/{shopProduct}', [PaymentController::class, 'StripePay'])->name('payment.StripePay');
Route::get('payment/StripeSuccess', [PaymentController::class, 'StripeSuccess'])->name('payment.StripeSuccess');
Route::get('payment/FreePay/{shopProduct}', [PaymentController::class, 'FreePay'])->name('payment.FreePay');
Route::get('payment/Cancel', [PaymentController::class, 'Cancel'])->name('payment.Cancel');
Route::get('users/logbackin', [UserController::class, 'logBackIn'])->name('users.logbackin');
@ -116,6 +117,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::post('ticket/new', [TicketsController::class, 'store'])->middleware(['throttle:ticket-new'])->name('ticket.new.store');
Route::get('ticket/show/{ticket_id}', [TicketsController::class, 'show'])->name('ticket.show');
Route::post('ticket/reply', [TicketsController::class, 'reply'])->middleware(['throttle:ticket-reply'])->name('ticket.reply');
Route::post('ticket/close/{ticket_id}', [TicketsController::class, 'close'])->name('ticket.close');
}
//admin