<html>
<head>
	<title>LEMBAR @if(!empty($instrumentdetail)) {{$instrumentdetail->instrument}}@endif - TAHUN @if(!empty($filter_tahun)) {{$filter_tahun}}@endif</title>
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
	<style type="text/css">
		table tr td,
		table tr th{
			font-size: 9pt;
			align:center;
		}
	</style>
	<table class='table table-bordered'>

			<thead>
				<th><center><img style="width:70px" src="{{ asset('images/logo_unesa_kuning.png') }}" alt=""></center></th>
				<th colspan="2"><h5 align="center">UNIVERSITAS NEGERI SURABAYA</h5></th>
			
				
			</thead>
			<tbody>
				<tr>
					<td rowspan="3"><h6 align="center">@if(!empty($instrumentdetail)) {{$instrumentdetail->instrument}}@endif</h6></td>
					<td >No. Dokumen </td>
					<td >@if(!empty($no_dokumen)) {{$no_dokumen}}@endif</td>
				</tr>
				<tr>
					
					<td >Revisi </td>
					<td >@if(!empty($revisi)) {{$revisi}}@endif</td>
				</tr>
				<tr>
					
					<td >Tanggal Terbit </td>
					<td >@if(!empty($tanggal_terbit)) {{$tanggal_terbit}}@endif</td>
				</tr>

			</tbody>
	</table>
	<center>
		<h6> <center>LEMBAR @if(!empty($instrumentdetail)) {{$instrumentdetail->instrument}}@endif <br> TAHUN @if(!empty($filter_tahun)) {{$filter_tahun}}@endif</center></h6>
		
	</center>
	<br><br>
	@foreach ($sub_instrument as $dataa)
	<h6>{{ $dataa->sub_instrument }}</h6>   
   
	<table class='table table-bordered'>

                            <thead>
                                <th><font size="2">No. Pernyataan</font></th>
								<th colspan="{{count($fakultas)}}" class="text-center"><font size="2">{{ $dataa->jenis_input->detail }}</font></th>
                               
                            </thead>
							<thead>
                                <th>&nbsp;</th>
								@foreach ($fakultas as $data)
                                <th><font size="2">{{$data->fakultas}}</font></th>
                                @endforeach
 
                            </thead>
                            <tbody>
                              
                               
                                    @php $no = 1; @endphp
                                   
                                    @foreach($pernyataan_instrument as $item)
                                    @if($dataa->id == $item->id_sub_instrument) 
                                    
                                    <tr>
                                        <td>{{ $no++ }}. {{ $item->pernyataan_instrument }} </td>
                                        
                                        @for ($i = 1; $i <= count($fakultas) ; $i++)
                                        <td>
                                       
										<center>{{ isset($arr_hasil[$item->id][''][$i][$filter_tahun]) ? $arr_hasil[$item->id][''][$i][$filter_tahun]->jumlah : '' }}</center>

                                      
                                        </td>
                                        @endfor
                                        
                                    </tr>
                                    @foreach($sub_pernyataan_instrument as $value)

                                    @if($item->id == $value->id_pernyataan_instrument) 
                                    <tr>
                                        <td>{{ $value->sub_peryataan }}</td>
                                        @for ($a = 1; $a <= count($fakultas) ; $a++)
                                        <td>
                                      

										<center>{{ isset($arr_hasil[$item->id][$value->id][$a][$filter_tahun]) ? $arr_hasil[$item->id][$value->id][$a][$filter_tahun]->jumlah : '' }}</center>

                                        </td>
                                        @endfor
                                        
                                       
                                    </tr>
                                    @endif
                                    @endforeach
									
                                    
                                    @endif
                                    @endforeach
								<tr>
                                    
									<td><strong>Jumlah</strong></td>
									@for ($b = 1; $b <= count($fakultas) ; $b++)
									
									<td><center><strong>{{ isset($arr_hasil_total[$dataa->id][$b][$filter_tahun]) ? $arr_hasil_total[$dataa->id][$b][$filter_tahun]->total : '' }}</strong></center></td>
									@endfor          
								</tr>
                                    

                                   
                                
                            </tbody>
              
                       
	</table>
	@endforeach
</body>
</html>










public function cetak_pdf()
{
	$pegawai = Pegawai::all();

	$pdf = PDF::loadview('pegawai_pdf',['pegawai'=>$pegawai]);
	return $pdf->stream();
}
