public function store(HourRequest $request) { Hour::create($request->all()); //AFTER the row is added, get the last record to pass to the next page. $hour = Hour::latest()->first(); \Session::flash('flash_message', 'Hours for ' . $hour->employee->first_name . ' were added.'); return redirect('hours'); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $id = $request->id; $hour = Hour::find($id); $hour->hours = $request->hours; $hour->save(); Activity::log('Updated store hours for ' . $hour->day . '.'); $request->session()->flash('status', 'Store hours were successfully updated.'); return Redirect::action('HoursController@index'); }
/** * Show the application dashboard to the user. * * @return Response */ public function index() { $expensesss = Expense::where('project_id', '=', 0)->first(); $expensess = Expense::where('project_id', '=', 0)->orderBy('paid_on', 'desc')->get(); $clients = Client::orderBy('created_at', 'desc')->get(); $projects = Project::orderBy('created_at', 'desc')->get(); $expenses = Expense::where('project_id', '>', 0)->orderBy('paid_on', 'desc')->get(); $payments = Payment::orderBy('created_at', 'desc')->get(); $hours = Hour::where('amount_paid', '<', 0)->orderBy('day_worked', 'desc')->get(); return view('home', compact('projects', 'expenses', 'payments', 'hours', 'clients', 'expensess', 'expensesss')); }
public function run() { Hour::create(['id' => 11, 'name' => '06:00 - 07:00']); Hour::create(['id' => 12, 'name' => '07:00 - 08:00']); Hour::create(['id' => 13, 'name' => '08:00 - 09:00']); Hour::create(['id' => 14, 'name' => '09:00 - 10:00']); Hour::create(['id' => 15, 'name' => '10:00 - 11:00']); Hour::create(['id' => 16, 'name' => '11:00 - 12:00']); Hour::create(['id' => 17, 'name' => '12:00 - 13:00']); Hour::create(['id' => 20, 'name' => '13:00 - 14:00']); Hour::create(['id' => 21, 'name' => '14:00 - 15:00']); Hour::create(['id' => 22, 'name' => '15:00 - 16:00']); Hour::create(['id' => 23, 'name' => '16:00 - 17:00']); Hour::create(['id' => 24, 'name' => '17:00 - 18:00']); Hour::create(['id' => 25, 'name' => '18:00 - 19:00']); Hour::create(['id' => 26, 'name' => '19:00 - 20:00']); Hour::create(['id' => 27, 'name' => '20:00 - 21:00']); Hour::create(['id' => 28, 'name' => '21:00 - 22:00']); }
static function hourList() { $hours = Hour::all(); return $hours; }
</tr> <tr> <td><label>Randevu Tarihi</label></td> <td><input type="date" class="form-control" name="randevuTarihi" min="<?php echo $tarih; ?> " max="<?php echo $maxTarih; ?> " required autofocus/></td> </tr> <tr> <td><label>Saat</label></td> <?php $hours = Hour::all(); ?> <td> <select name="saat" class="form-control"> <?php foreach ($hours as $hour) { echo '<option value="' . $hour->id . '">' . $hour->hours . '</option>'; } ?> </select> </td> </tr> <tr> <td><label>Mesajınız</label></td>