<?php 
	if( count($this->dataCategory) > 0 ){ 
?>
<script type="text/javascript" language="javascript">
	$(document).ready(function () {
			
		$("#category_id<?php echo$this->category_type;?>").val(0);
		$("[name='category_id_<?php echo$this->category_type;?><?php echo$this->idCategory; ?>']").change(function(){
			var idCat = $(this).val();
			$("#category_id<?php echo$this->category_type;?>").val(idCat);
			if( idCat != <?php echo$this->idCategory; ?> ){
				$( "#categoryBox<?php echo$this->category_type;?>_<?php echo$this->idCategory; ?>" ).load( "<?php echo $this->url(array('controller' => 'admin', 'action' => 'coloraddcategory'), 'default', true); ?>", {category_id: idCat, category_type: <?php echo$this->category_type;?><?php if( isset($this->category_edit_id) ){ ?>, category_edit_id: <?php echo$this->category_edit_id; } ?>}, function(){} );
			}else{
				$( "#categoryBox<?php echo$this->category_type;?>_<?php echo$this->idCategory; ?>" ).html('');
				$("#category_id<?php echo$this->category_type;?>").val(0);
			}
		});

	});
</script>

<select class="form-control" class="selectCategory" name="category_id_<?php echo$this->category_type;?><?php echo$this->idCategory; ?>" style="margin-bottom:5px;">
	<option value="<?php echo$this->idCategory; ?>">&rarr; ------</option>
<?php foreach ($this->dataCategory as $key => $val):?>
	<option value="<?php echo $this->escape($val['category_id']); ?>"><?php echo $this->escape($val['category_name']); ?></option>
<?php endforeach; ?>
</select>

<div id="categoryBox<?php echo$this->category_type;?>_<?php echo$this->idCategory; ?>" style="margin-left:15px;"></div>
<?php 
	} 
?>
