	<?php 
		if($_POST['followup']=='1'){
			$foll="Rawat Jalan";
		}else if($_POST['followup']=='2'){
			$foll="Rawat Inap";
		}else{
			$foll="Semua";
		}
	ini_set("max_execution_time", 0);
	header("Content-Disposition: attachment; filename=\"Rekap pasien BPJS ".$foll." ".tgl_id_short($_POST['tglawal'])."-".tgl_id_short($_POST['tglakhir']).".xls\"");
	header("Content-type: application/vnd.ms-excel"); 
	?>
	<h3 align="center">Rekap Pasien BPJS <?php echo $foll;?></h3>
	<h4 align="center">Periode <?php echo tgl_id_short($_POST['tglawal']);?> s/d <?php echo tgl_id_short($_POST['tglakhir']);?></h4>
	<table border="1">
		<thead>
			<tr>
				<th>No</th>
				<th>Tgl masuk</th>
				<th>Tgl Pulang</th>
				<th>No RM</th>
				<th>Pasien</th>
				<th>Poli</th>
				<th>No SEP</th>														
				<th>No BPJS</th>														
				<th>Kelas BPJS</th>														
				<th>Jenis</th>														
				<th>Diagnosa</th>														
				<th>Tindakan</th>														
				<th>Petugas TPP</th>														
			</tr>
		</thead>
		
		<?php $no=1;
		foreach($result as $dtk){ 
			if($dtk->FollowUp=='1'){
				$jenis='RJ';
			}elseif($dtk->FollowUp=='2'){
				$jenis='RI';
			}else{
				$jenis='';
			}
		?>
			<tr>
				<td width="3%"><?php echo $no;?></td>
				<td width="8%"><?php echo tgl_id_short($dtk->TanggalMasuk);?></td>
				<td width="8%"><?php echo tgl_id_short($dtk->TanggalKeluar);?></td>
				<td	width="7%"><?php echo $dtk->NoRM;?></td>
				<td width="14%"><?php echo $dtk->Nama;?></td>
				<td width="14%"><?php echo $dtk->PintuMasuk;?></td>
				<td width="10%"><?php echo $dtk->NoSEP_BPJS;?></td>
				<td width="10%"><?php echo $dtk->No_kartu_BPJS;?></td>
				<td width="5%"><?php echo $dtk->kelas;?></td>
				<td width="5%"><?php echo $jenis;?></td>
				<td width="15%"><?php echo $dtk->Diagnosa;?></td>
				<td width="15%"><?php echo $dtk->tindakan;?></td>
				<td width="15%"><?php echo $dtk->user;?></td>

			</tr>
		<?php $no++; } ?>
		
	</table>