more variables

This commit is contained in:
1day2die 2021-10-26 17:51:15 +02:00
parent c92b435f65
commit fe588c5069

View file

@ -19,19 +19,17 @@ class HomeController extends Controller
/** Show the application dashboard. */ /** Show the application dashboard. */
public function index(Request $request) public function index(Request $request)
{ {
$usage = 0; $usage = Auth::user()->creditUsage();
$credits = Auth::user()->Credits();
$bg=""; $bg="";
$boxText=""; $boxText="";
$unit = ""; $unit = "";
foreach (Auth::user()->servers as $server){
$usage += $server->product->price;
}
// START OF THE TIME-REMAINING-BOX // START OF THE TIME-REMAINING-BOX
if(Auth::user()->Credits() > 0.01 and $usage > 0){ if($credits > 0.01 and $usage > 0){
$days = number_format((Auth::user()->Credits()*30)/$usage,2,'.',''); $days = number_format(($credits*30)/$usage,2,'.','');
$hours = number_format(Auth::user()->Credits()/($usage/30/24),2,'.',''); $hours = number_format($credits/($usage/30/24),2,'.','');
// DEFINE THE BACKGROUND COLOR // DEFINE THE BACKGROUND COLOR
if($days >= 15){ if($days >= 15){