Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

The missing data when i show this data on laravel 5.2

willsenwillsen indonesiaMember Posts: 1
edited September 2016 in PHP

`

function editClassCalendar(class_calendar_id) { console.log(class_calendar_id); $.ajax({ url: "/admin/editClassCalendar/"+class_calendar_id, success: function(result) { console.log(result); $("#class-name").val(result.class_name); $("#session-number").val(result.session_no); $("#day").val(result.dow_name); $("#absence-date").val(result.absence_date); $("#room-name").val(result.room_name); $('#trainer-name').val(result.trainer_id); $("#shift-time").val(result.shift_day); $("#class-calendar-id").val(result.class_calendar_id); } }); }
        <table>
        @foreach($datas as $value)  
            <tr>
                <td>{{$value->class_name}}</td>
                <td>{{$value->session_no}}</td>
                <td>{{$value->absence_date}}</td>
                <td>{{$value->dow_name}}</td>
                <td>{{$value->shift_day}}</td>
                <td>{{$value->room_name}}</td>
                <td>{{$value->trainer_name}}</td>

{{$value->class_calendar_id}} // -> THIS DATA SHOW

                <td>
                    <button type="button" onclick="editClassCalendar({{$value->class_calendar_id}})" class="btn btn-info" data-toggle="modal" data-target="#modalTrainer">Edit Trainer</button>

                    <div class="modal fade" id="modalTrainer" role="dialog">
                        <div class="modal-dialog">                          
                          <!-- Modal content-->
                          <div class="modal-content">
                            <div class="modal-header">
                              <button type="button" class="close" data-dismiss="modal">&times;</button>
                              <h4 class="modal-title">Form Edit Class Calendar</h4>
                            </div>

                            <form class="form-horizontal" action="{{URL(action([email protected]'))}}" method="post">
                                <div class="modal-body">

                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <input type="hidden" name="classCalendarId" id="class-calendar-id">

                                    <div class="form-group">
                                      <label class="col-sm-3 control-label">Class Name</label>
                                      <div class="col-sm-8">
                                        <input class="form-control" id="class-name" type="text" disabled>
                                      </div>
                                    </div>

                                    <div class="form-group">
                                      <label class="col-sm-3 control-label">Session Number</label>
                                      <div class="col-sm-8">
                                        <input class="form-control" id="session-number" type="text" disabled>
                                      </div>
                                    </div>     

                                    <div class="form-group">
                                      <label class="col-sm-3 control-label">Absence Date</label>
                                      <div class="col-sm-8">
                                        <input class="form-control" id="absence-date" type="text" disabled>
                                      </div>
                                    </div>   

                                    <div class="form-group">
                                      <label class="col-sm-3 control-label">Day</label>
                                      <div class="col-sm-8">
                                        <input class="form-control" id="day" type="text" disabled>
                                      </div>
                                    </div>

                                    <div class="form-group">
                                      <label class="col-sm-3 control-label">Shift Time </label>
                                      <div class="col-sm-8">
                                        <input class="form-control" id="shift-time" type="text" disabled>
                                      </div>
                                    </div>


                                    <div class="form-group">
                                      <label class="col-sm-3 control-label">Room Name</label>
                                      <div class="col-sm-8">
                                        <input class="form-control" id="room-name" type="text" disabled>
                                      </div>
                                    </div> 

                                    <div class="form-group">
                                      <label class="col-sm-3 control-label">Trainer Name</label>
                                      <div class="col-sm-8 select-trainer">
                                        <select class="selectpicker show-tick form-control form-dow" id="trainer-name" name="trainerName">
                                            @foreach($trainer as $key=>$value)
                                                <option value="{{$value->trainer_id}}">{{$value->trainer_name}}</option>
                                            @endforeach
                                        </select>
                                      </div>
                                    </div>

                                </div>
                                <div class="modal-footer">
                                  <button type="submit" class="btn btn-default">Submit</button>
                                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                </div>
                            </form>
                          </div>

                        </div>
                    </div>
                </td>

                <td>
                    <button type="button" onclick="editAbsenceDate({{$value->class_calendar_id}})" class="btn btn-info" data-toggle="modal" data-target="#modalAbsenceDate">Edit Absence Date</button>

                        <div class="modal fade" id="modalAbsenceDate" role="dialog">
                            <div class="modal-dialog">

                            <!-- Modal content-->
                            <div class="modal-content">
                                <div class="modal-header">
                                  <button type="button" class="close" data-dismiss="modal">&times;</button>
                                  <h4 class="modal-title">Form Edit Class Calendar</h4>
                                </div>

                                <form class="form-horizontal" action="{{URL(action([email protected]'))}}" method="post">
                                    <div class="modal-body">

                                        <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                        <input type="hidden" name="classCalendarId" id="class-calendar-id">

                                        <div class="form-group">
                                          <label class="col-sm-3 control-label">Class Name</label>
                                          <div class="col-sm-8">
                                            <input class="form-control" id="class-name" type="text" disabled>
                                          </div>
                                        </div>

                                        <div class="form-group">
                                          <label class="col-sm-3 control-label">Session Number</label>
                                          <div class="col-sm-8">
                                            <input class="form-control" id="session-number" type="text" disabled>
                                          </div>
                                        </div>     

                                        <div class="form-group">
                                          <label class="col-sm-3 control-label">Absence Date</label>
                                          <div class="col-sm-8">
                                            <input class="form-control" id="absence-date" type="text" disabled>
                                          </div>
                                        </div>   

                                        <div class="form-group">
                                          <label class="col-sm-3 control-label">Day</label>
                                          <div class="col-sm-8">
                                            <input class="form-control" id="day" type="text" disabled>
                                          </div>
                                        </div>

                                        <div class="form-group">
                                          <label class="col-sm-3 control-label">Shift Time </label>
                                          <div class="col-sm-8">
                                            <input class="form-control" id="shift-time" type="text" disabled>
                                          </div>
                                        </div>


                                        <div class="form-group">
                                          <label class="col-sm-3 control-label">Room Name</label>
                                          <div class="col-sm-8">
                                            <input class="form-control" id="room-name" type="text" disabled>
                                          </div>
                                        </div> 

                                        <div class="form-group">
                                          <label class="col-sm-3 control-label">Trainer Name</label>
                                          <div class="col-sm-8 select-trainer">
                                             <input class="form-control" id="trainer-name" type="text" disabled>

                                          </div>
                                        </div>

                                    </div>
                                    <div class="modal-footer">
                                      <button type="submit" class="btn btn-default">Submit</button>
                                      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                    </div>
                                </form>
                            </div>

                            </div>
                        </div>
                </td>
            </tr>   

{{$value->class_calendar_id}} // -> THIS DATA MISSING
@endforeach
`

How did it happen?

Sign In or Register to comment.