<?php
/**
 * @package DJ-Catalog2
 * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 */

// no direct access
defined('_JEXEC') or die;

//Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\Factory::getDocument()->getWebAssetManager()->useScript('form.validate');
//Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen', 'select');
?>
<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'combination.cancel' || document.formvalidator.isValid(document.getElementById('combination-form'))) {
			Joomla.submitform(task, document.getElementById('combination-form'));
		}
		else {
			alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
		}
	}
</script>

<form action="<?php echo JRoute::_('index.php?option=com_djcatalog2&view=combination&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="combination-form" class="form-validate" enctype="multipart/form-data">
	<div class="row row-fluid">
		<div class="col-md-12 form-horizontal">
			<fieldset>
			<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.startTabSet', 'myTab', array('recall' => true, 'active' => 'details')); ?>
			<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.addTab', 'myTab', 'details', JText::_('COM_DJCATALOG2_EDIT')); ?>
			
			<?php echo $this->form->renderField('sku'); ?>
			<?php echo $this->form->renderField('price'); ?>
			<?php echo $this->form->renderField('stock'); ?>
			
			<?php echo $this->form->renderField('length'); ?>
			<?php echo $this->form->renderField('width'); ?>
			<?php echo $this->form->renderField('height'); ?>
			<?php echo $this->form->renderField('dimensions_unit'); ?>
			<?php echo $this->form->renderField('weight'); ?>
			<?php echo $this->form->renderField('weight_unit'); ?>
			
			<?php echo $this->form->renderField('id'); ?>
			<?php echo $this->form->renderField('item_id'); ?>
			
			<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.endTab'); ?>
			
			<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.addTab', 'myTab', 'images', JText::_('COM_DJCATALOG2_IMAGES')); ?>
			<div class="row row-fluid">
				<div class="col-md-12">
				<?php echo DJCatalog2ImageHelper::renderInput('combination',JFactory::getApplication()->input->getInt('id', null), (bool)JComponentHelper::getParams('com_djcatalog2')->get('multiple_image_upload', true)); ?>
				</div>
			</div>
			<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.endTab'); ?>
			<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.endTabSet'); ?>
		</fieldset>
		
	<input type="hidden" name="task" value="" />
	<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
	</div>
	<div class="clr"></div>
	</div>
</form>