<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	$titles = __('error_titles', true);
	$bodies = __('error_bodies', true);
	if (isset($_GET['err']))
	{
		pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]);
	}
	?>
	<?php pjUtil::printNotice(__('infoThemeTitle', true), __('infoThemeDesc', true), false, false); ?>

	<div class="form pj-form">
		<p>
			<label class="title"><?php __('lblSelectProduct');?></label>
			<?php
			$selected_product = 0;
			if(count($tpl['product_arr']) > 0)
			{ 
				?>
				<select name="product_id" id="preview_product_id" class="pj-form-field w200" data-theme="<?php echo $tpl['option_arr']['o_theme'];?>">
					<?php
					foreach ($tpl['product_arr'] as $k => $v)
					{
						if($k == 0)
						{
							$selected_product = $v['id'];
						}
						?><option value="<?php echo $v['id']; ?>"><?php echo $v['name']; ?></option><?php
					}
					?>
				</select>
				<?php
			}else{
				$message = __('lblNoProductsMessage', true);
				$message = str_replace("{STAG}", '<a href="'.$_SERVER['PHP_SELF'].'?controller=pjAdminProducts&amp;action=pjActionCreate">', $message);
				$message = str_replace("{ETAG}", '</a>', $message);
				?><label class="block t5"><?php echo $message;?></label><?php
			} 
			?>
		</p>
	</div>
	<div class="theme-holder pj-loader-outer">
		<?php
		if(count($tpl['product_arr']) > 0) 
		{
			include PJ_VIEWS_PATH . 'pjAdminOptions/elements/theme.php';
		} 
		?>
	</div>
	<div class="clear_both"></div>
	<?php
}
?>