本文整理汇总了PHP中app\Employee类的典型用法代码示例。如果您正苦于以下问题:PHP Employee类的具体用法?PHP Employee怎么用?PHP Employee使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Employee类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$user = new Employee();
$user->name = 'Administrator';
$user->email = 'test@email.ae';
$user->password = bcrypt('marktimbol');
$user->save();
}
示例2: store
/**
* 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");
}
示例3: create
public function create()
{
$input = Input::all();
$customers = Customer::all();
$salesmen = Employee::all();
return view('return.create', compact('input', 'customers', 'salesmen'));
}
示例4: destroy
/**
* 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');
}
示例5: achievement
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);
}
示例6: __construct
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);
}
示例7: search
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);
}
示例8: index
/**
* 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']));
}
示例9: store
/**
* 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));
}
示例10: testCanRemoveScope
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);
}
示例11: edit
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'));
}
示例12: update
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);
}
示例13: run
/**
* 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 = 'vid.mahovic@gmail.com';
$user->password = 'vid123';
$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);
}
示例14: listAll
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);
}
示例15: compose
/**
* 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());
}