Mails, Strono, filter

This commit is contained in:
Kevin Adametz 2020-03-26 09:48:19 +01:00
parent f53f17f9c1
commit 62e84637b6
99 changed files with 2409 additions and 474 deletions

View file

@ -4,7 +4,9 @@ namespace App\Http\Controllers;
use App\Models\Booking;
use App\Models\BookingDraftItem;
use App\Models\Customer;
use App\Repositories\BookingRepository;
use App\Repositories\CustomerMailRepository;
use Request;
class BookingController extends Controller
@ -184,6 +186,25 @@ class BookingController extends Controller
}
public function loadModal(){
$data = Request::all();
$ret = "";
if(Request::ajax()){
$data['customers'] = [];
if($data['action'] === "new-customer-mail" && isset($data['booking_id']) && $booking = Booking::find($data['booking_id'])){
$tmp = "";
$tmp .= $booking->customer ? $booking->customer->email." | " : "- | ";
$tmp .= $booking->customer ? $booking->customer->firstname." ".$booking->customer->name." | " : "- | ";
$tmp .= $booking->travel_country_id ? $booking->travel_country->name." | " : "- | ";
$tmp .= $booking->travelagenda_id ? $booking->travel_agenda->name."" : "-";
$data['customers'][$booking->id] = $tmp;
}
$ret = CustomerMailRepository::loadModal($data);
}
return response()->json(['response' => $data, 'html'=>$ret]);
}
public function draftItemDelete($id){
$boking_draft_item = BookingDraftItem::findOrFail($id);
$booking = $boking_draft_item->booking;