<?php  
//select.php  
if(isset($_POST["employee_id"]))
{
 $output = '';
 include 'database.php';
 $query = "SELECT * FROM datatamu WHERE id = '".$_POST["employee_id"]."'";
 $result = mysqli_query($conn, $query);
 $output .= '  
      <div class="table-responsive">  
           <table class="table table-bordered" style="font-size:12px; font-family:Cambria;">';
    while($row = mysqli_fetch_array($result))
    {
     $output .= '
     <tr>  
            <td width="40%"><label><i class="fas fa-calendar"></i> Tanggal Permohonan Informasi</label></td>  
            <td width="60%">'.tgl_indo(date("Y-m-d", strtotime($row["checkin"]))).'</td>  
        </tr>
		<tr>  
            <td width="40%"><label><i class="fas fa-user"></i> Nama Pemohon</label></td>  
            <td width="60%">'.$row["nama"].'</td>  
        </tr>
		<tr>  
            <td width="40%"><label><i class="fas fa-briefcase"></i> Pekerjaan</label></td>  
            <td width="60%">'.$row["jabatan"].'</td>  
        </tr>
		<tr>  
            <td width="40%"><label><i class="fas fa-globe"></i> Alamat</label></td>  
            <td width="60%">'.$row["instansi"].'</td>  
        </tr>
		<tr>  
            <td width="40%"><label><i class="fas fa-phone"></i> Telpon/WhatsApp</label></td>  
            <td width="60%">'.$row["telp"].'</td> 
		</tr>
        ';
            $idinformasi = $row['id'];
            $que = "SELECT * FROM tb_informasi WHERE id = '$idinformasi'";
            $res = mysqli_query($koneksi, $que);
               $data = mysqli_fetch_array($res);
               $output .= '
			<tr>  
            <td width="40%"><label> <i class="fas fa-envelope"></i>Email</label></td>  
            <td width="60%">'.$data["email"].'</td>  
        </tr>
        <tr>  
            <td width="40%"><label> <i class="fas fa-book"></i> Rincian Informasi</label></td>  
            <td width="60%">'.$row["kepentingan"].'</td>  
        </tr>
		<tr>  
            <td width="40%"><label> <i class="fas fa-bullseye"></i> Tujuan Memperoleh Informasi</label></td>  
            <td width="60%">'.$data["rincian"].'</td>
        </tr>
		<tr>  
            <td width="40%"><label><i class="fas fa-eye"></i> Cara Memperoleh Informasi</label></td>  
            <td width="60%">'.$data["cara_memperoleh"].'</td>
        </tr>
		<tr>  
            <td width="40%"><label><i class="fas fa-file-alt"></i> Cara Mendapatkan Informasi</label></td>  
            <td width="60%">'.$data["cara_mendapatkan"].'</td>
        </tr>
        <tr>  
            <td width="40%"><label><i class="fas fa-print"></i>Cetak</label></td>  
            <td width="60%"><a href="informasi/cetak_informasi.php/?ID='.$_POST["employee_id"].'" target="_blank"><i class="fas fa-print text-danger p-2" data-toggle="tooltip" title="Cetak Formulir"> Cetak Formulir</i></a></td>
        </tr>
     ';
    }
    $output .= '</table></div>';
    echo $output;
}
?>

<?php
function tgl_indo($tanggal){
	$bulan = array (
		1 =>   'Januari',
		'Februari',
		'Maret',
		'April',
		'Mei',
		'Juni',
		'Juli',
		'Agustus',
		'September',
		'Oktober',
		'November',
		'Desember'
	);
	$pecahkan = explode('-', $tanggal);
	
	// variabel pecahkan 0 = tanggal
	// variabel pecahkan 1 = bulan
	// variabel pecahkan 2 = tahun
 
	return $pecahkan[2] . ' ' . $bulan[ (int)$pecahkan[1] ] . ' ' . $pecahkan[0];
}
?>