<?php foreach($this->data->lt as $r){ ?>
	<optgroup label="<?php echo $r->nm_kat ?>">
		<?php
		$meja = $this->em->getFindBy("merek", "*", array("kd_kat = '".$r->kd_kat."'"), "kd_merek");
		foreach($meja as $r2){
			$posh = $this->em->getFind('posh', '*', array("control = '0'", "sesi = '".$this->data->sesi."'", "meja = '".$r2->kd_merek."'", "tgl_bill is null"));
			$item = $this->em->getFind("posd", "*", array("model = '".$r2->kd_merek."'", "no_pos = '".$posh->no_pos."'"));
			if(empty($posh->no_pos) && empty($item->no_item)){
		?>
			<option value="<?php echo $r2->kd_merek ?>"><?php echo $r2->nm_merek ?></option>
		<?php }} ?>
	</optgroup>
<?php } ?>