Laravel - Display data on page when textbox value is fetch in database

旧城冷巷雨未停 提交于 2020-01-25 08:31:07

问题


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

来源:https://stackoverflow.com/questions/54299763/laravel-display-data-on-page-when-textbox-value-is-fetch-in-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!