<?if (is_array($this->municipios)) {?>
	<table cellspacing="1" cellpadding="1" border="0" width="100%">
		<tr>
			<?
			$i = 0;
			foreach ($this->municipios as $item) {
				if($item['ds_nome_municipio'] != '') {
					if ($i % 6 == 0) {
						echo "</tr><tr>";
					}
					
					if ($this->rel){
						$check = in_array($item['id'], $this->rel) ? 'checked="checked"' : '';	
					} else {
						$check = '';
					}
					
					
					$disabled = $item['ds_comerc_munic'] ? 'disabled="disabled"' : '';
					$title = $disabled ? "title=\"Esse município já foi relacionado na comercialização &quot;" . $item['ds_comerc_munic']."&quot; \""  : '';
					?>
					<td width="1%"><input type="checkbox" value="<?=$item['id']?>" class='uf_<?=$item['uf']?>' id="check_<?=$item['id']?>" name="municipios[]" <?=$check?> <?=$disabled?>/></td>
					<td><label for="check_<?=$item['id']?>" <?=$title?>><?=$item['ds_nome_municipio']?></label></td>
					<?
					
					$i++;
				}
			}
			?>
		</tr>
	</table>
<?}?>