	<?php
$db = new mysqli('localhost', 'kiosbarc_antrian_online' ,'kiosbarc_antrian_online2019', 'kiosbarc_antrian_online');
		
$idcabang = $_GET['idcabang'];
if(substr($idcabang,0,3)=='aal'){
	$nama_user = mysqli_query($db,"SELECT distinct(iduser) FROM transaksi WHERE idcabang in (select id FROM kode_cabang) order by iduser");
}elseif(substr($idcabang,0,3)=='all'){
	$nama_user = mysqli_query($db,"SELECT distinct(iduser) FROM transaksi WHERE idcabang in (select id FROM kode_cabang WHERE kode_wilayah = substring('$idcabang',4)) order by iduser");
	}else{
$nama_user = mysqli_query($db,"SELECT distinct(iduser) FROM transaksi WHERE idcabang = '$idcabang' order by iduser");
}
$arriduser = array();
while ($row_user = mysqli_fetch_assoc($nama_user)) {
	$arriduser [ $row_user['iduser'] ] = $row_user['iduser'];
}

foreach($arriduser as $iduser=>$iduser) {
	echo "<option value='$iduser'>$iduser</option>";
}
?>
<script type="text/javascript">
	$('#iduser').multipleSelect({
		placeholder: "Pilih User",
		filter:true
	});
</script>