Comments
This commit is contained in:
parent
903ca36b7b
commit
c92b435f65
|
@ -27,11 +27,13 @@ class HomeController extends Controller
|
||||||
foreach (Auth::user()->servers as $server){
|
foreach (Auth::user()->servers as $server){
|
||||||
$usage += $server->product->price;
|
$usage += $server->product->price;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// START OF THE TIME-REMAINING-BOX
|
||||||
if(Auth::user()->Credits() > 0.01 and $usage > 0){
|
if(Auth::user()->Credits() > 0.01 and $usage > 0){
|
||||||
$days = number_format((Auth::user()->Credits()*30)/$usage,2,'.','');
|
$days = number_format((Auth::user()->Credits()*30)/$usage,2,'.','');
|
||||||
$hours = number_format(Auth::user()->Credits()/($usage/30/24),2,'.','');
|
$hours = number_format(Auth::user()->Credits()/($usage/30/24),2,'.','');
|
||||||
|
|
||||||
|
// DEFINE THE BACKGROUND COLOR
|
||||||
if($days >= 15){
|
if($days >= 15){
|
||||||
$bg = "success";
|
$bg = "success";
|
||||||
}elseif ($days >= 8 && $days <= 14){
|
}elseif ($days >= 8 && $days <= 14){
|
||||||
|
@ -39,7 +41,7 @@ class HomeController extends Controller
|
||||||
}elseif ($days <= 7){
|
}elseif ($days <= 7){
|
||||||
$bg = "danger";
|
$bg = "danger";
|
||||||
}
|
}
|
||||||
|
// DEFINE WETHER DAYS OR HOURS REMAIN
|
||||||
if($days < "1"){
|
if($days < "1"){
|
||||||
if($hours < "1"){
|
if($hours < "1"){
|
||||||
$boxText = 'You ran out of Credits ';
|
$boxText = 'You ran out of Credits ';
|
||||||
|
@ -54,7 +56,7 @@ class HomeController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RETURN ALL VALUES
|
||||||
return view('home')->with([
|
return view('home')->with([
|
||||||
'useage' => $usage,
|
'useage' => $usage,
|
||||||
'useful_links' => UsefulLink::all()->sortBy('id'),
|
'useful_links' => UsefulLink::all()->sortBy('id'),
|
||||||
|
|
Loading…
Reference in a new issue