public function add() { if (Auth::check()) { $thnajar = Tahunajar::all(); $siswa = Siswa::all(); $pelanggaran = Pelanggaran::all(); return \View::make('Addons.Pelanggaran.pelanggaranadd')->with("thnajar", $thnajar)->with("siswa", $siswa)->with("pelanggaran", $pelanggaran); } else { return \Redirect::to('login'); } }
?> <div class="table-responsive"> <table class="table table-bordered table-striped table-condensed"> <thead> <tr> <th>Jenis Pelanggaran</th> <th>Bobot Nilai</th> </tr> </thead> <tbody> <?php $sum = 0; ?> @foreach($lists as $list) <?php $bobot = Pelanggaran::bobotnilai($list->id_pelanggaran); $sum += $bobot; ?> <tr> <td>{{ Pelanggaran::nama($list->id_pelanggaran) }}</td> <td>{{ $bobot }}</td> </tr> @endforeach <tr> <td>Subtotal</td> <td>{{ $sum }}</td> </tr> <tr> <td>Bobot nilai tahun {{ $thnajr->thn }}</td> <td>{{Bobotnilai::nilaibyTa($thnajrid)}}</td> </tr>