<?
$Habilitacoes = new Produto_Model_Habilitacoes();
?>

<table cellpadding="1" cellspacing="1">
	<? if (count($this->rs) >= 2): ?>
		<? foreach ($this->rs as $id => $name): ?>
			<?
			$count = $Habilitacoes->fetchAll("id_produto = {$this->produto} and id_usuario = {$id}")->count();
			?>
			<? if ($id): ?>
				<tr>
					<td valign="top"><input type="checkbox" name="id_preposto[]" value="<?=$id?>" id="id_preposto_<?=$id?>" class="class_id_preposto" /></td>
					<td valign="top">
						<label for="id_preposto_<?=$id?>"><b><?=$name?></b>
						<? if ($count): ?>
							- <img src="/resources/imagens/edit10_10.png" onclick="editPreposto(<?=$id?>)" />
						<? endif; ?>
						</label>
					</td>
				</tr>
			<? endif; ?>
		<? endforeach; ?>
	<? else: ?>
		<tr>
			<td>Nenhum preposto encontrado</td>
		</tr>
	<? endif; ?>
</table>