jeudi 28 mars 2019

Show detail of the generated data

I have a problem with how to show the detail data of the student when the user clicked at the student name. This is the flow of my system. First, a user clicks the subject name for example 'S5', it will show the name of the student under 'S5' with 'S5' value = '1'. After that, when the user clicks the student name for example ("HAFIZ BIN SAID"), the system will show a table of a selected student with the data of 'S1','S2','S3','S4','S5'.The problem happens when I want to show the detail of the student after the system shows the student name. Is there a way to show the student detail dynamically because based on my logic like I have to make a link for every student, but in my case, I have 100 students. Do I have to make 100 links for all of them so that when the user clicks at the student name it will show the student detail?

This is my database 's1,s2,s3,s4,s5' is a subject name

This is the code I use to get the student name with S1='1' in Controller

public function KeushawananTeknologiMaklumatdanSeminar(){

    $subject = Matrix::where([
        ['total_subject_left', '<', '10'],
        ['S5', '=', '1']
        ])->get();
    return view ('scsj_subject.Keushawanan Teknologi Maklumat dan Seminar')->with(compact('subject'));
}

And this is my code in blade to get the student name and matrix number

<table>
    <thead>
       <tr>
          <th>Name</th>
          <th>Matrix No.</th>
       </tr>
    </thead>
    <tbody>
        @foreach ($subject as $stud)
           <tr class="gradeX">
             <td></td>
             <td></td>
           </tr>
        @endforeach
    </tbody>
 </table>

Thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire