Exemplo n.º 1
0
 public function homeView(Request $request)
 {
     $staffId = explode(":", Crypt::decrypt($request->get("session")));
     $customers = Customers::all();
     $contacts = Contacts::all();
     $activities = DB::table('activities as a')->select('a.id as activityId', 'a.cusId', 'a.date', 'a.outcome', 'a.staffId', 'a.type', 'u.id as staffId', 'u.fullname as staffName')->leftJoin('user as u', 'a.staffId', '=', 'u.id')->get();
     return View::make('home')->with('staffId', $staffId[0])->with('staffName', $staffId[1])->with('customers', $customers)->with('contacts', $contacts->toJson())->with('activities', json_encode($activities));
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getCreate()
 {
     $dc_customers = DcCustomers::all();
     $dc_customer = "";
     $customers = Customers::all();
     $customer = "";
     $locations = DcLocation::all();
     $location = "";
     $service_types = ServiceType::all();
     $service_type = "";
     return view('admin.customers.create_edit_dc_customer', compact('dc_customer', 'dc_customers', 'location', 'locations', 'service_type', 'service_types', 'customers', 'customer'));
 }