/** * Execute the console command. * * @return mixed */ public function handle() { $qty = $this->ask('How Many Cycle Each Card Line Do You Want for [ RANDOM BOOSTER ] ?!'); if ($this->confirm('Do you wish to continue? [y|N]')) { $this->output->progressStart($qty); $faker = Faker\Factory::create(); $u = $qty; $i = 0; $t = 0; $jk = 0; $q = 0; $k = 0; $a = 0; $ten = Ten::where('active', true)->where('shuffle', false)->lists('link_id')->toArray(); $jack = Jack::where('active', true)->where('shuffle', false)->lists('link_id')->toArray(); $queen = Queen::where('active', true)->where('shuffle', false)->lists('link_id')->toArray(); $king = King::where('active', true)->where('shuffle', false)->lists('link_id')->toArray(); $ace = Ace::where('active', true)->where('shuffle', false)->lists('link_id')->toArray(); while ($i < $u) { try { $this->ten->randomCycle($faker->randomElement($ten)); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { $t++; } try { $this->jack->randomCycle($faker->randomElement($jack)); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { $jk++; } try { $this->queen->randomCycle($faker->randomElement($queen)); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { $q++; } try { $this->king->randomCycle($faker->randomElement($king)); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { $k++; } try { $this->ace->randomCycle($faker->randomElement($ace)); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) { $a++; } $i++; $this->output->progressAdvance(); } $headers = ['Total Random Booster', 'Booster Distributed', 'Ten Failed', 'Jack Failed', 'Queen Failed', 'King Failed', 'Ace Failed']; $rows = [["total" => $u * 5, "consumed" => $u * 5 - ($t + $jk + $q + $k + $a), "ten" => $t, "jack" => $jk, "queen" => $q, "king" => $k, "ace" => $a]]; $this->output->progressFinish(); $this->table($headers, $rows); } }
<link rel="shortcut icon" href="<?php echo Cfg::get('favicon'); ?> " type="image/x-icon"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" > <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> </head> <body> <table width="100%" cellpadding="5" cellspacing="0" class="table table-bordered"> <tr> <td width="100%"> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="100" nowrap="nowrap" valign="top" height="50"> <a href="?"><img alt="Logo" src="<?php echo \App\Jack::logo(); ?> " border=0 height="90"/></a> </td> <td width="100%" nowrap="nowrap" valign="top" align="left"> <h1>Super Administration</h1> </td> </tr> </table> </td> </tr> <tr> <td height="600px" width="100%"> <table class="table table-bordered"> <tr> <td nowrap="nowrap" valign="top">
public function switchToJack($lid) { if (new static() != new Jack()) { $card = static::where('link_id', $lid)->where('shuffle', false)->where('min_direct', '>', $this->min_jack)->where('canSwitch', true)->first(); $cardID = $card->id; $directCount = $card->min_direct; $card->delete(); $cardline = Cardline::where('card_type', $this->cardtype)->where('card_id', $cardID)->delete(); $card = new Jack(); $card->link_id = $lid; $card->min_direct = $directCount; $card->save(); $cardline = new Cardline(); $cardline->link_id = $lid; $card->cardpoints()->save($cardline); return "You Switch to Card Line Jack!"; } return "You Cant Switch Line!"; }