コード例 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $suppliers = Supplier::orderBy('name')->get();
     $employees = Employee::orderBy('firstname')->get();
     $customers = Customer::orderBy('name')->get();
     return view('inventory.home', compact(['suppliers', 'employees', 'customers']));
 }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id = null)
 {
     if ($id == null) {
         return Employee::orderBy('id', 'asc')->get();
     } else {
         return $this->show($id);
     }
 }
コード例 #3
0
ファイル: FormOptionComposer.php プロジェクト: rob1121/qdn
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('select_failure_mode', ['Assembly', 'Environment', 'Machine', 'Man', 'Material', 'Method / Process']);
     $view->with('customers', Option::orderBy('customer')->select('customer')->get());
     $view->with('machines', Machine::orderBy('name')->select('name')->get());
     $view->with('stations', Station::select('station')->get());
     $view->with('employees', Employee::orderBy('name')->select('name')->where('name', '<>', Auth::user()->employee->name)->get());
 }
コード例 #4
0
 public function index($id = null)
 {
     if ($id == null) {
         return Employee::orderBy('id', 'ASC')->get();
     } else {
         return Employee::findOrFail($id);
     }
 }
コード例 #5
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $employees = Employee::orderBy('id', 'desc')->get();
     foreach ($employees as $key => $value) {
         $posname = Position::find($value->position_id);
         $employees[$key]->position_name = $posname ? $posname->name : "";
     }
     $positions = Position::all();
     $nationalities = Nationality::all();
     return view('employee.listemployee', compact('employees', 'positions', 'nationalities'));
 }
コード例 #6
0
ファイル: OrderController.php プロジェクト: MangTomas23/tgm
 public function create()
 {
     $input = Input::all();
     $customer = null;
     if ($input != null) {
         $customer = Customer::firstOrNew(['name' => $input['order_by']]);
         $customer->address = $input['address'];
         $customer->save();
     }
     $employees = Employee::orderBy('firstname')->get();
     $customers = Customer::orderBy('name')->get();
     return view('order.create', compact(['employees', 'input', 'customer', 'customers']));
 }
コード例 #7
0
 public function create()
 {
     $salesmen = Employee::orderBy('firstname')->get();
     $input = Input::all();
     return view('badorder.create', compact('salesmen', 'input'));
 }
コード例 #8
0
 /**
  * Grab an array of employees with id => name
  * in order to populate a select dropdown
  *
  * @return array
  * @internal param $fullNames
  * @internal param $empIds
  */
 private function getEmployeesForDropdownList()
 {
     foreach (Employee::orderBy('lastname', 'ASC')->get() as $emp) {
         $fullNames[] = $emp->firstname . ' ' . $emp->lastname;
         $empIds[] = $emp->id;
     }
     $employees = array_combine($empIds, $fullNames);
     return $employees;
 }