Monthly calculation on server index
This commit is contained in:
parent
33b402bdee
commit
9da53bd02f
|
@ -64,9 +64,27 @@ class Product extends Model
|
|||
}
|
||||
}
|
||||
|
||||
public function getDailyPrice()
|
||||
public function getMonthlyPrice()
|
||||
{
|
||||
return $this->price / 30;
|
||||
// calculate the hourly price with the billing period
|
||||
switch($this->billing_period) {
|
||||
case 'hourly':
|
||||
return $this->price * 24 * 30;
|
||||
case 'daily':
|
||||
return $this->price * 30;
|
||||
case 'weekly':
|
||||
return $this->price * 4;
|
||||
case 'monthly':
|
||||
return $this->price;
|
||||
case 'quarterly':
|
||||
return $this->price / 3;
|
||||
case 'half-annually':
|
||||
return $this->price / 6;
|
||||
case 'annually':
|
||||
return $this->price / 12;
|
||||
default:
|
||||
return $this->price;
|
||||
}
|
||||
}
|
||||
|
||||
public function getWeeklyPrice()
|
||||
|
|
|
@ -62,8 +62,8 @@
|
|||
</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') }}"
|
||||
@if (!empty($phpmyadmin_url)))
|
||||
<a href="{{ $phpmyadmin_url }}"
|
||||
class="dropdown-item text-info" target="__blank"><i title="manage"
|
||||
class="fas fa-database mr-2"></i><span>{{ __('Database') }}</span></a>
|
||||
@endif
|
||||
|
@ -194,6 +194,9 @@
|
|||
@elseif($server->product->billing_period == 'hourly')
|
||||
{{ __('per Hour') }}
|
||||
@endif
|
||||
<i data-toggle="popover" data-trigger="hover"
|
||||
data-content="{{ __('Your') ." " . $credits_display_name . " ". __('are reduced') ." ". $server->product->billing_period . ". " . __("This however calculates to ") . number_format($server->product->getMonthlyPrice(),2,",",".") . " ". $credits_display_name . " ". __('per Month')}}"
|
||||
class="fas fa-info-circle"></i>
|
||||
</div>
|
||||
<span>
|
||||
{{ $server->product->price == round($server->product->price) ? round($server->product->price) : $server->product->price }}
|
||||
|
|
Loading…
Reference in a new issue