I have a page here which get all the value that has the same employee_no
. here is my page.
here in my page, see the textbox? that is the data that im fetching and that will be my basis when I fetch all the records that has the same number.
so when i display that employee number, then all the data must be displayed. but on my case, no data is being displayed here take a look.
whereas, the final output should be this.
here is my view
{!! Form::open(['action' => 'Admin\EmployeeFilemController@insertSchedule', 'method' => 'POST']) !!}
{{Form::text('txtEmployeeNo', $employee->employee_no,['class' => 'form-control'])}}
{!! Form::close() !!}
here is my contoller
public function createSchedule(Request $request, $id)
{
$employee = Employeefm::find($id);
$employNum = $request->input('txtEmployeeNo');
$employeeSched = Schedule::where(['employee_no'=>$employNum])->get();
// dd($request->all);
return view('admin.employeemaintenance.createSchedule',compact('employee','employeeSched'));
}
my route
Route::get('/admin/employeemaintenance/{id}/createSchedule', 'Admin\EmployeeFilemController@createSchedule');
P.S I have displayed the data because i change the code $employNum
$employeeSched = Schedule::where(['employee_no'=>$employNum])->get();
to this a fixed number 54232
$employeeSched = Schedule::where(['employee_no'=>`54232'])->get();
and here is how i fetched it
@foreach ($employeeSched as $setTime)
<tr>
<td> {{Form::label('date_today', $setTime->date_today)}}</td>
<td> {{Form::label('time_in', $setTime->time_in)}}</td>
<td> {{Form::label('time_out', $setTime->time_out)}}</td>
</tr>
@endforeach