<?php

include_once ("includes/setup.inc.php");
//Header("Content-type: application/xml");
Header("Cache-Control: no-cache");

$num_errors = 0;
$pemilik = fetch_postget_val("pemilik", $_POST, $_GET);

$indicator_Query = 'SELECT id_pemilik_pet AS id, concat(nama_pet, " (", desk_haiwan_peliharaan, ")") as name
					FROM m_pemilik_pet
					JOIN i_haiwan_peliharaan ON m_pemilik_pet.id_haiwan_peliharaan = i_haiwan_peliharaan.id_haiwan_peliharaan
					WHERE id_pemilik = ?
					ORDER BY name';
$PDO_stmt = $PDO->prepare($indicator_Query);
$PDO_stmt->bindValue(1, $pemilik, PDO::PARAM_INT);
$PDO_stmt->execute();
while($result = $PDO_stmt->fetch(PDO::FETCH_ASSOC))
{
	echo '<option value="'.$result['id'].'">'.$result['name'].'</option>';
}

?>