Customer Mail, Mails, Views Lead Customer
This commit is contained in:
parent
f1e0900a7a
commit
f53f17f9c1
46 changed files with 2217 additions and 1489 deletions
114
app/Http/Controllers/CustomerMailController.php
Executable file
114
app/Http/Controllers/CustomerMailController.php
Executable file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Customer;
|
||||
use App\Models\CustomerMail;
|
||||
use App\Repositories\CustomerMailRepository;
|
||||
use Carbon;
|
||||
use Request;
|
||||
|
||||
class CustomerMailController extends Controller
|
||||
{
|
||||
|
||||
protected $customerMailRepo;
|
||||
|
||||
public function __construct(CustomerMailRepository $customerMailRepo)
|
||||
{
|
||||
$this->middleware('admin');
|
||||
$this->customerMailRepo = $customerMailRepo;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
|
||||
];
|
||||
return view('customer.mail.index', $data);
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
if($id === "new") {
|
||||
$customer_mail = new CustomerMail();
|
||||
$id = 'new';
|
||||
|
||||
}else{
|
||||
$customer_mail = CustomerMail::findOrFail($id);
|
||||
$id = $customer_mail->id;
|
||||
}
|
||||
$data = [
|
||||
'customer_mail' => $customer_mail,
|
||||
'id' => $id,
|
||||
];
|
||||
return view('customer.mail.detail', $data);
|
||||
|
||||
}
|
||||
|
||||
public function store($id)
|
||||
{
|
||||
return back();
|
||||
/* $data = Request::all();
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('lead_detail', [$lead->id]));*/
|
||||
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
/*
|
||||
\Session()->flash('alert-success', __('Eintrag gelöscht'));
|
||||
return redirect(route('lead_detail', [$lead->id]));*/
|
||||
}
|
||||
|
||||
public function getCustomerMails()
|
||||
{
|
||||
$query = CustomerMail::with('booking')->with('customer');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (CustomerMail $customer_mail) {
|
||||
return '<a href="'.route('customer_mail_detail', [$customer_mail->id]).'" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('id', function (CustomerMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->id.'" href="'.route('customer_mail_detail', [$customer_mail->id]).'" data-id="'.$customer_mail->id.'">'.$customer_mail->id.'</a>';
|
||||
})
|
||||
->addColumn('booking', function (CustomerMail $customer_mail) {
|
||||
$out = $customer_mail->booking->travel_country_id ? $customer_mail->booking->travel_country->name." | " : "- | ";
|
||||
$out .= $customer_mail->booking->travelagenda_id ? $customer_mail->booking->travel_agenda->name."" : "-";
|
||||
return $out;
|
||||
})
|
||||
->addColumn('booking_id', function (CustomerMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->booking_id.'" href="'.route('booking_detail', [$customer_mail->booking_id]).'">'.$customer_mail->booking_id.'</a>';
|
||||
})
|
||||
->addColumn('customer_id', function (CustomerMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->customer_id.'" href="'.route('customer_detail', [$customer_mail->customer_id]).'">'.$customer_mail->customer_id.'</a>';
|
||||
})
|
||||
->addColumn('send', function (CustomerMail $customer_mail) {
|
||||
return $customer_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('booking_id', 'booking_id $1')
|
||||
->orderColumn('customer_id', 'customer_id $1')
|
||||
->orderColumn('send', 'send $1')
|
||||
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('customer_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('customer_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('booking_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('booking_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'send', 'customer_id', 'booking_id', 'id'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue