<?php echo $this->render('admin/header.phtml'); ?>


<script type="text/javascript" language="javascript">

	$(document).ready(function () {

		<?php if( isset( $this->addSuccess ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(admin_element_successdef); ?>");
		<?php } ?>

		<?php if( isset( $this->removeSuccess ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(admin_element_remove_success); ?>");
		<?php } ?>
		
		$(".remove").click(function(){
		
			var link = $(this).attr('link');
			var name = $(this).attr('name');
			alertify.set({ buttonFocus: "none", labels: {ok: "<?php echo @Lib_Lang::translate(admin_confirm_accept); ?>", cancel: "<?php echo @Lib_Lang::translate(admin_confirm_cancel); ?>"}});
			alertify.confirm("<?php echo @Lib_Lang::translate(admin_confirm_remove_element); ?> "+name+"?", function (e) {
				if (e) {
					window.location.href = link;
				} else {
					return false;
				}
			});
		
		});
		
	});

</script>

<div class="container">		

<?php echo $this->render('admin/menu.phtml'); ?>
<?php echo $this->render('admin/productmenu.phtml'); ?>

	
	<div class="row">
		<div class="col-xs-3 col-sm-3 col-md-3">
			<h3><?php echo @Lib_Lang::translate(admin_product_edit_top); ?><br /><small><?php echo$this->ProductInfo['product_name']; ?></small></h3>
			
		</div>
		<div class="col-xs-9 col-sm-9 col-md-9 text-right">
		</div>
	</div>

	<?php echo $this->render('admin/producteditmenu.phtml'); ?>

	

	
	<div class="row">
		<div class="col-xs-3 col-sm-3 col-md-3">
			<h3><?php echo @Lib_Lang::translate(admin_producteditbody_top); ?></h3>
		</div>
		<div class="col-xs-9 col-sm-9 col-md-9 text-right">
			<a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'producteditbodyadd', 'id' => $this->ProductInfo['product_id']), 'default', true); ?>" class="btn btn-default btn-sm"><i class='fa fa-plus'></i> <?php echo @Lib_Lang::translate(admin_producteditelement_menu_add); ?></a>
		</div>
	</div>	
	
	<div class="row"><hr /></div>
	
	<div class="row">
		<div class="col-xs-12 col-sm-12 col-md-12 text-right">
		
			<form method="post">
				<?php echo @Lib_Lang::translate(color_schema_info); ?>
				<select name="color_schema_id">
					<option value="0"><?php echo @Lib_Lang::translate(color_schema_select); ?></option>
					<?php foreach ($this->ColorSchema as $key => $val): ?>
					<option value="<?php echo$val['color_schema_id'];?>" <?php if( $val['color_schema_id'] == $this->ProductInfo['color_schema_id'] )echo'selected';?>><?php echo$val['color_schema_name'];?></option>					
					<?php endforeach; ?>
				</select>
				<input type="submit" name="color_schema" value="<?php echo @Lib_Lang::translate(color_schema_submit); ?>" />
			</form>
		
		</div>
	</div>	
	
	<div class="row"><hr /></div>
	
	<div class="row">
		<div class="col-xs-3 col-sm-3 col-md-3">
			<h3><?php echo @Lib_Lang::translate(admin_producteditbody_top1); ?></h3>
		</div>
		<div class="col-xs-9 col-sm-9 col-md-9 text-right">
		</div>
	</div>	
	<div class="row">
	<?php if( count($this->dataTable) > 0 ){ ?>
	<?php foreach ($this->dataTable as $key => $val): ?>
		<div class="col-xs-3 col-sm-3 col-md-3 text-center">
			<div style="margin:5px;padding:5px;border:1px solid #aaa;">
			<?php if( $val['product_body_image'] ){ ?>
				<img src="<?php echo $this->escape($this->baseUrl); ?>/public/uploads/body/<?php echo$val['product_body_image']; ?>_h100.jpeg" style="border:1px solid #ccc;" />
			<?php }else{ ?>
			
			<?php } ?>
			<br />
			<?php echo$val['product_body_name'];?>
			<br />
				<div class="btn-group">
					<a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'producteditbodyedit', 'id' => $val['product_id'], 'idp' => $val['product_body_id']), 'default', true); ?>" class="btn btn-primary btn-xs"><i class='fa fa-edit'></i> <?php echo @Lib_Lang::translate(admin_category_list_editbutton); ?></a>
					<a name="<?php echo $this->escape($val['product_body_name']) ?>" link="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'producteditbodyremove', 'id' => $val['product_id'], 'idp' => $val['product_body_id']), 'default', true); ?>" class="btn btn-danger btn-xs remove"><i class='fa fa-remove'></i> <?php echo @Lib_Lang::translate(admin_category_list_delbutton); ?></a>			
				</div>
					<br />
					<?php if( $val['product_body_default'] == 1 ){ ?>
						<?php echo @Lib_Lang::translate(admin_element_default); ?>
					<?php }else{ ?>
						<a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'producteditbodydefault', 'id' => $val['product_id'], 'idp' => $val['product_body_id']), 'default', true); ?>" class="btn btn-info btn-xs"><i class='fa fa-edit'></i> <?php echo @Lib_Lang::translate(admin_element_defaultset); ?></a>
					<?php } ?>
			</div>
		</div> 
	<?php endforeach; ?>
	<?php }else{ ?>
	<center><?php echo @Lib_Lang::translate(admin_element_list_0); ?></center>
	<?php } ?>
	</div>
	
	<div class="row"><hr /></div>
	
	<div class="row">
		<div class="col-xs-3 col-sm-3 col-md-3">
			<h3><?php echo @Lib_Lang::translate(admin_producteditbody_top2); ?></h3>
		</div>
		<div class="col-xs-9 col-sm-9 col-md-9 text-right">
		</div>
	</div>	
	<div class="row">
	<?php if( count($this->dataTable2) > 0 ){ ?>
	<?php foreach ($this->dataTable2 as $key => $val): ?>
		<div class="col-xs-3 col-sm-3 col-md-3 text-center">
			<div style="margin:5px;padding:5px;border:1px solid #aaa;">
			<?php if( $val['product_body_image'] ){ ?>
				<img src="<?php echo $this->escape($this->baseUrl); ?>/public/uploads/body/<?php echo$val['product_body_image']; ?>_h100.jpeg" style="border:1px solid #ccc;" />
			<?php }else{ ?>
			
			<?php } ?>
			<br />
			<?php echo$val['product_body_name'];?>
			<br />
				<div class="btn-group">
					<a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'producteditbodyedit', 'id' => $val['product_id'], 'idp' => $val['product_body_id']), 'default', true); ?>" class="btn btn-primary btn-xs"><i class='fa fa-edit'></i> <?php echo @Lib_Lang::translate(admin_category_list_editbutton); ?></a>
					<a name="<?php echo $this->escape($val['product_body_name']) ?>" link="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'producteditbodyremove', 'id' => $val['product_id'], 'idp' => $val['product_body_id']), 'default', true); ?>" class="btn btn-danger btn-xs remove"><i class='fa fa-remove'></i> <?php echo @Lib_Lang::translate(admin_category_list_delbutton); ?></a>
				</div>
					<br />
					<?php if( $val['product_body_default'] == 1 ){ ?><br />
						<?php echo @Lib_Lang::translate(admin_element_default); ?>
					<?php }else{ ?>
						<a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'producteditbodydefault', 'id' => $val['product_id'], 'idp' => $val['product_body_id']), 'default', true); ?>" class="btn btn-info btn-xs"><i class='fa fa-edit'></i> <?php echo @Lib_Lang::translate(admin_element_defaultset); ?></a>
					<?php } ?>
			</div>
		</div> 
	<?php endforeach; ?>
	<?php }else{ ?>
	<center><?php echo @Lib_Lang::translate(admin_element_list_0); ?></center>
	<?php } ?>
	
	
	
	
</div>

	
		
	<div class="row"><hr /></div>
	
</div>

<?php echo $this->render('admin/footer.phtml'); ?>