/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $user = new Employee();
     $user->name = 'Administrator';
     $user->email = '*****@*****.**';
     $user->password = bcrypt('marktimbol');
     $user->save();
 }
示例#2
0
 /**
  * Deletes employee from database and returns status in json response
  *
  * @param $id
  * @return array
  */
 public function delete($id)
 {
     if ($employee = $this->employee->find($id)) {
         if ($employee->delete()) {
             return ['status' => 200];
         }
         return ['status' => 500];
     }
     return ['status' => 404];
 }
示例#3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['first_name' => 'required|max:100', 'middle_name' => 'required|max:100', 'last_name' => 'required|max:100', 'emp_id' => 'required|max:100', 'card_no' => 'required|max:100']);
     $employee = new Employee();
     $employee->first_name = $request->first_name;
     $employee->middle_name = $request->middle_name;
     $employee->last_name = $request->last_name;
     $employee->emp_id = $request->emp_id;
     $employee->card_no = $request->card_no;
     $employee->active = 1;
     $employee->save();
     Session::flash('flash_message', 'Terminal successfully added!');
     return redirect()->route("employee.index");
 }
示例#4
0
 public function create()
 {
     $input = Input::all();
     $customers = Customer::all();
     $salesmen = Employee::all();
     return view('return.create', compact('input', 'customers', 'salesmen'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $employee = Employee::findOrFail($id);
     $name = $employee->name . " " . $employee->lastname;
     Employee::destroy($id);
     return redirect(route('employees.index'))->with('message', 'Empleado ' . $name . ' eliminado corectamente');
 }
示例#6
0
 public function achievement()
 {
     $AMIds = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
     $MRs = Employee::whereIn('manager_id', $AMIds)->get();
     $dataView = ['MRs' => $MRs];
     return view('sm.line.history.search', $dataView);
 }
示例#7
0
 public function __construct()
 {
     $count = Employee::count();
     $countProj = Project::count();
     $data = Employee::all();
     $YourRole = "";
     if (count(Auth::user()) > 0) {
         $YourRole = Auth::user()->UserRoles->role;
     }
     $Role2 = $this->Role1;
     // Count Unconfirmed
     $cc = 0;
     foreach ($data as $da) {
         if ($da->confirm == 0) {
             $cc++;
         }
     }
     $countConf = $cc;
     // Count Confirmed
     $cc1 = 0;
     foreach ($data as $dat) {
         if ($dat->confirm == 1) {
             $cc1++;
         }
     }
     $countConfirmed = $cc1;
     View::share('countConf', $countConf);
     View::share('YourRole', $YourRole);
     View::share('countConfirmed', $countConfirmed);
     View::share('count', $count);
     View::share('countProj', $countProj);
 }
示例#8
0
 public function search()
 {
     $AMs = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
     $MRs = Employee::whereIn('manager_id', $AMs)->get();
     $dataView = ['MRs' => $MRs];
     return view('sm.search.plans.search', $dataView);
 }
示例#9
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']));
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //
     $transaction = $request->all();
     $empId = $transaction["empId"]['id'];
     $siteId = $transaction["siteId"]['id'];
     $workDate = $transaction["workDate"];
     $day = (double) $transaction["day"];
     $ot = (double) $transaction["ot"];
     $advance = (double) $transaction["advance"];
     //$wage = DB::select(DB::raw("select employee.wage from employee where employee.id=$empId "));
     $wage = Employee::where('id', $empId)->first()->wage;
     //dd($wage);
     $amount = (double) (($day + $ot / 8.0) * $wage);
     $transact = SiteEmployeeRel::create(['siteId' => $siteId, 'empId' => $empId, 'workDate' => $workDate, 'day' => $day, 'ot' => $ot, 'advance' => $advance, 'amount' => $amount, 'advance' => $advance]);
     //return $transact;
     //getting current date
     $currentDate = Carbon::now();
     //getting current year
     $currentYear = $currentDate->year;
     //getting current month
     $currentMonth = $currentDate->month;
     //getting the employee transaction according to current month and year
     $transactions = DB::select(DB::raw("select e.name as empName,e.wage, s.name as siteName, t.workDate, t.day ,t.ot,t.advance,t.amount from siteemployeerel as t\n                        inner join employee as e on t.empId = e.id\n                        inner join site as s on t.siteId = s.id\n                        where year(t.workDate) = {$currentYear} and month(t.workDate) = {$currentMonth}\n                        order by t.created_at;"));
     return json_encode(array('transactions' => $transactions));
 }
示例#11
0
 public function testCanRemoveScope()
 {
     factory(User::class)->create(['type' => null]);
     factory(User::class)->create(['type' => Employee::class]);
     $users = Employee::withoutGlobalScope(\App\SingleTableInheritanceScope::class)->get();
     $this->assertCount(2, $users);
 }
 public function edit($salarySheetId, $salarySheetRecordId)
 {
     $salary_sheet = SalarySheet::find($salarySheetId);
     $employees = Employee::lists('name', 'id')->sort();
     $salary_sheet_record = SalarySheetRecord::find($salarySheetRecordId);
     return view('hr.salary_sheet.edit', compact('salary_sheet', 'employees', 'salary_sheet_record'));
 }
示例#13
0
 public function update($id)
 {
     $task = Task::findOrFail($id);
     $employees = Employee::where('level_id', '<>', 1)->get();
     $dataView = ['task' => $task, 'employees' => $employees];
     return view('admin.task.edit', $dataView);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $employee_ids = Employee::all()->lists('id')->toArray();
     $order_states = OrderState::lists('id')->toArray();
     $products = Product::all();
     $municipalities = Municipality::all();
     factory(App\Customer::class, 50)->create()->each(function ($customer) use($employee_ids, $products, $municipalities, $order_states) {
         shuffle($employee_ids);
         shuffle($order_states);
         $customer->user()->save(factory(User::class, 'customer')->create());
         $customer->city_id = $municipalities->shuffle()->first()->id;
         $customer->save();
         $customer->products()->attach($products->shuffle()->first(), ['vote' => rand(1, 5), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
         $customer->orders()->save(factory(App\Order::class)->create(['acquired_by' => $employee_ids[0], 'state_id' => $order_states[0]]));
     });
     $user = new User();
     $user->name = 'Vid';
     $user->surname = 'Mahovic';
     $user->email = '*****@*****.**';
     $user->password = '******';
     $user->verified = true;
     $user->save();
     $customer = new Customer();
     $customer->street = 'Celovška 21';
     $customer->city_id = $municipalities->shuffle()->first()->id;
     $customer->phone = '+38640850993';
     $customer->save();
     $customer->user()->save($user);
 }
示例#15
0
 public function listAll()
 {
     $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
     $customers = Customer::whereIn('mr_id', $employees)->get();
     $dataView = ['customers' => $customers];
     return view('am.customer.list', $dataView);
 }
示例#16
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('disposition_check', ['use as is', 'ncmr#', 'rework', 'split lot', 'shutdown', 'shipback']);
     $view->with('cod_check', ['production', 'process', 'maintenance', 'facilities', 'quality assurance', 'others']);
     $view->with('approvers', ['production', 'process', 'quality assurance', 'others']);
     $view->with('names', Employee::select('name')->orderBy('name')->where('name', '<>', Auth::User()->employee->name)->get());
 }
示例#17
0
 public function update($id)
 {
     $customer = Customer::findOrFail($id);
     $mrs = Employee::where('level_id', 7)->active()->get();
     $dataView = ['customer' => $customer, 'mrs' => $mrs];
     return view('admin.customer.edit', $dataView);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     $employee = Employee::all();
     $categories = Event::all();
     $userdetails = User::all();
     $targets = Targetassign::all();
     $deals = Deal::all();
     $userData = array();
     $key = 0;
     foreach ($targets as $target) {
         $achieved = 0;
         $userData[$key]['eventcode'] = $target->Eventcode;
         $userData[$key]['event'] = $target->Eventname;
         $userData[$key]['employee'] = $target->Employeeid;
         $userData[$key]['targetVal'] = $target->Targetvalue;
         foreach ($deals as $deal) {
             if ($target->Eventcode == $deal->Eventcode && $target->Employeeid == $deal->Empid) {
                 $achieved = $achieved + $deal->Dealvalue;
             }
         }
         $userData[$key]['achieved'] = $achieved;
         $userData[$key]['variance'] = $achieved - $target->Targetvalue;
         $userData[$key]['cur'] = $target->Currency;
         $key++;
     }
     return View('targetmodule/assigntarget')->with(array('categories' => $categories, 'employee' => $employee, 'userdata' => $userData, 'targets' => $targets, 'eventtable' => $categories));
 }
示例#19
0
 public function search()
 {
     $products = Product::where('line_id', Employee::find(\Auth::user()->id)->line_id)->get();
     $doctors = Customer::where('mr_id', \Auth::user()->id)->get();
     $dataView = ['products' => $products, 'doctors' => $doctors];
     return view('mr.search.sales.search', $dataView);
 }
示例#20
0
 /**
  * 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());
 }
示例#21
0
 public function getIndex()
 {
     $categories = Event::all();
     $employee = Employee::all();
     $invoice = Invoice::all();
     $invnull = Invoice::where('Status', '=', 'Null')->get();
     return View('home2')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull));
 }
示例#22
0
 public function listAll()
 {
     $AMsIds = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
     $MRs = Employee::whereIn('manager_id', $AMsIds)->get();
     $AMs = Employee::where('manager_id', \Auth::user()->id)->get();
     $dataView = ['MRs' => $MRs, 'AMs' => $AMs];
     return view('sm.employee.list', $dataView);
 }
示例#23
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getData()
 {
     if (!\Request::ajax()) {
         \App::abort(404, 'not found naja');
     }
     $data = App\Employee::all();
     return \Response::json($data);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     factory(App\Employee::class, 20)->create()->each(function ($employee) {
         $employee->user()->save(factory(User::class, 'employee')->create());
     });
     $user = new User();
     $user->name = 'Erik';
     $user->surname = 'Drobne';
     $user->email = '*****@*****.**';
     $user->password = '******';
     $user->verified = true;
     $user->save();
     $employee = new Employee();
     $employee->cert_auth = '*****@*****.**';
     $employee->save();
     $employee->user()->save($user);
 }
示例#25
0
 public function search()
 {
     $employeesLines = Employee::select('line_id')->where('manager_id', \Auth::user()->id)->get();
     $products = Product::where('line_id', $employeesLines)->get();
     $MRs = Employee::where('manager_id', \Auth::user()->id)->get();
     $dataView = ['products' => $products, 'MRs' => $MRs];
     return view('am.search.sales.search', $dataView);
 }
示例#26
0
 public function update($id)
 {
     $territory = Territory::findOrFail($id);
     $areas = Area::all();
     $MRs = Employee::where('level_id', 7)->active()->get();
     $dataView = ['territory' => $territory, 'areas' => $areas, 'MRs' => $MRs];
     return view('admin.territory.edit', $dataView);
 }
示例#27
0
 public function update($id)
 {
     $area = Area::findOrFail($id);
     $AMs = Employee::where('level_id', 3)->active()->get();
     $lines = Line::all();
     $dataView = ['area' => $area, 'AMs' => $AMs, 'lines' => $lines];
     return view('admin.area.edit', $dataView);
 }
示例#28
0
 public function index()
 {
     $title = 'HOME';
     $repository = $this->repository;
     $employees = Employee::where('license_expire', '<', Carbon::now()->addDays(30))->orWhere('visa_expire', '<', Carbon::now()->addDays(30))->get();
     $vehicles = Vehicles::where('registration_expire', '<', Carbon::now()->addDays(30))->get();
     return view('pages.home', compact('title', 'employees', 'vehicles', 'repository'));
 }
示例#29
0
 public function search()
 {
     $MRs = Employee::where('level_id', 7)->active()->get();
     $AMs = Employee::where('level_id', 3)->active()->get();
     $SMs = Employee::where('level_id', 2)->active()->get();
     $dataView = ['MRs' => $MRs, 'AMs' => $AMs, 'SMs' => $SMs];
     return view('admin.search.plans.search', $dataView);
 }
示例#30
-1
 public function listAll()
 {
     $employees = Employee::select('line_id')->where('manager_id', \Auth::user()->id)->get();
     $products = Product::whereIn('line_id', $employees)->get();
     $dataView = ['products' => $products];
     return view('am.product.list', $dataView);
 }