Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

[ask] Rekap Absen Siswa Di laravel

Assalamualaykum kebetulan saya lagi belajar buat absen di laravel tapi 1 kendalanya adalah membuat rekap kehadiran per kelas, saya masih bingung dengan logikanya

ini controllernya
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Kelas; use App\Siswa; use App\Guru; use App\AbsenMasuk; use Illuminate\Support\Facades\DB; use Intervention\Image\ImageManagerStatic as Image; <div class="Quote"></div> class RekapAbsenController extends Controller { public function __construct() { $this->middleware('auth'); } public function get() { $kelas = DB::table('kelas') ->join('gurus','kelas.wali_kelas','=','gurus.id_guru') ->get(); return view('admin_rekap_absen')->with(compact('kelas')); } public function proses($id) { $kelas = DB::table('kelas') ->join('gurus','kelas.wali_kelas','=','gurus.id_guru') ->where('id_kelas',$id) ->first(); return view('admin_proses_rekap_absen',compact('kelas')); } public function tampil($id) { $kelas = Kelas::find($id); $siswa1 = DB::table('kelas') ->join('siswas','kelas.id_kelas','=','siswas.id_kelas') ->where('siswas.id_kelas','=',$id) ->get(); $siswa2 = DB::table('kelas') ->join('siswas','kelas.id_kelas','=','siswas.id_kelas') ->join('absen_masuks','siswas.nik','=','absen_masuks.nik') ->where('siswas.id_kelas','=',$id) ->get(); return view('admin_tampil_rekap_absen',compact('kelas', 'siswa1', 'siswa2')); } } </code ini bladenya <pre class="CodeBlock"><code><h3 align="center">REKAP ABSEN KELAS - {{$kelas->nama_kelas}}</h3> <table border="1" rules="all" align="center"> <tr> <td width="180" rowspan="2" align="center">NIK</td> <td width="180" rowspan="2" align="center">Nama</td> <td rowspan="2" colspan="2" align="center">Waktu</td> <td colspan="31" align="center">Tanggal</td> </tr> <tr> <td width="40px" align="center">1</td> <td width="40px" align="center">2</td> <td width="40px" align="center">3</td> <td width="40px" align="center">4</td> <td width="40px" align="center">5</td> <td width="40px" align="center">6</td> <td width="40px" align="center">7</td> <td width="40px" align="center">8</td> <td width="40px" align="center">9</td> <td width="40px" align="center">10</td> <td width="40px" align="center">11</td> <td width="40px" align="center">12</td> <td width="40px" align="center">13</td> <td width="40px" align="center">14</td> <td width="40px" align="center">15</td> <td width="40px" align="center">16</td> <td width="40px" align="center">17</td> <td width="40px" align="center">18</td> <td width="40px" align="center">19</td> <td width="40px" align="center">20</td> <td width="40px" align="center">21</td> <td width="40px" align="center">22</td> <td width="40px" align="center">23</td> <td width="40px" align="center">24</td> <td width="40px" align="center">25</td> <td width="40px" align="center">26</td> <td width="40px" align="center">27</td> <td width="40px" align="center">28</td> <td width="40px" align="center">29</td> <td width="40px" align="center">30</td> <td width="40px" align="center">31</td> </tr> @foreach ($siswa1 as $siswas) <tr> <td rowspan="2">{{$siswas->nik}}</td> <td rowspan="2">{{$siswas->nama}}</td> <td colspan="2" align="center">Msk</td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> </tr> </tr> <tr> <td colspan="2" align="center">Klr</td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> <td width="40px" align="center"></td> </tr> @endforeach </table>




yang yang sekarang baru siswa per kelas yang tampil saya masih bingung gimana caranya agar tampil rekapan absennya.
ini resultnya


Sign In or Register to comment.