moons admin controller

This commit is contained in:
2019-02-15 23:12:57 -06:00
parent 52709e3d01
commit 08dd0981ab
2 changed files with 8 additions and 19 deletions
+3 -14
View File
@@ -6,12 +6,12 @@ use Illuminate\Console\Command;
use Commands\Library\CommandHelper;
use App\Library\Moons\MoonMailer;
use App\Library\Moons\MoonCalc;
use App\Library\Lookups\LookupHelper;
use DB;
use Carbon\Carbon;
use App\Models\Moon\Moon;
use App\Models\Moon\MoonRent;
class MoonMailerCommand extends Command
{
@@ -51,20 +51,9 @@ class MoonMailerCommand extends Command
//Add the entry into the jobs table saying the job has started
$task->SetStartStatus();
//Create class helpers
$lookup = new LookupHelper();
$moonTotal = new MoonCalc();
//Get all of the moon rental contacts
$contacts = DB::table('Moons')->pluck('Contact');
//Cycle through each contact, and get all of the moons for the contact, then
//totalize the cost
$total = 0.00;
$entityType = '';
foreach($contacts as $contact) {
}
//Send a mail to the contact listing the moons, and how much is owed
@@ -40,7 +40,7 @@ class MoonsAdminController extends Controller
return view('moons.admin.updatemoon');
}
public function storeUpdateMoon2(Request $request) {
public function storeUpdateMoon(Request $request) {
$moonCalc = MoonCalc();
$lookup = LookupHelper();
@@ -55,7 +55,7 @@ class MoonsAdminController extends Controller
//Take the contact name and create a character id from it
$contact = $lookup->CharacterNameToId($request->contact);
dd($contact);
//Create the date
$date = new Carbon($request->date . '00:00:01');
//Calculate the moon price
@@ -86,14 +86,14 @@ class MoonsAdminController extends Controller
'Moon' => $request->moon,
'RentalCorp' => $request->renter,
'RentalEnd' => $date,
'Contact' => $request->contact,
'Contact' => $contact,
'Price' => $price,
]);
return redirect('/moons/display')->with('success', 'Moon Updated');
return redirect('/moons/admin/updatemoon')->with('success', 'Moon Updated');
}
public function storeUpdateMoon(Request $request) {
public function storeUpdateMoon2(Request $request) {
$this->validate($request, [
'system' => 'required',
'planet' => 'required',