Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Commit

Permalink
Added files for future release
Browse files Browse the repository at this point in the history
  • Loading branch information
Prophet731 committed Dec 27, 2015
1 parent 81eb94e commit 87a626d
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
54 changes: 54 additions & 0 deletions app/bfacp/Commands/InfractionsCleanup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php namespace BFACP\Commands;

use BFACP\Adkats\Infractions\Overall;
use Illuminate\Console\Command;

class InfractionsCleanup extends Command
{

/**
* The console command name.
*
* @var string
*/
protected $name = 'bfacp:infractions-cleanup';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Cleans up infractions';

/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
Overall::with('player', 'servers')->where('total_points', '<', 0)->chunk(1000, function ($infractions) {
foreach ($infractions as $infraction) {
$total = abs($infraction->total_points);

if ($infraction->forgive_points > 0 && $infraction->punish_points == 0) {
$total = $infraction->forgive_points;
} elseif ($infraction->forgive_points > $infraction->punish_points) {
$total = $infraction->forgive_points - $infraction->punish_points;
}

$this->info(sprintf('Deleted %s forgives for %s', $total, $infraction->player->SoldierName));
sleep(0.5);
}
});
}

}
12 changes: 12 additions & 0 deletions public/js/templates/modals/player/groups.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="modal-header">
<h3 class="modal-title"></h3>
</div>

<div class="modal-body"></div>

<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">
<i class="fa fa-spinner fa-pulse" ng-show="working"></i> OK
</button>
<button class="btn btn-warning" ng-click="cancel()">Cancel</button>
</div>

0 comments on commit 87a626d

Please sign in to comment.