Your IP : 216.73.216.170


Current Path : /var/www/iplanru/data/www/i-plan.ru/modules/mod_zootextfm/tmpl/
Upload File :
Current File : /var/www/iplanru/data/www/i-plan.ru/modules/mod_zootextfm/tmpl/default.php

<?php

// No direct access
defined( '_JEXEC' ) or die;
?>
<div class="module<?php echo $moduleclass_sfx; ?>">

<?php
$option='com_pay';

if(isset($attribs) && isset($attribs['item'])){
$item_id = $attribs['item']->id;}

if (!empty($item_id)){
	$db =&JFactory::getDBO();
	$count='';
	$ret='';
	$field='val';
	$db->setQuery('SELECT c.params val FROM jos_zoo_category_item ci, jos_zoo_category c  
									where ci.category_id=c.id and ci.item_id='.$item_id, 0, $count);
	$rows = $db->loadObjectList();
	if (count($rows)<>0)
	foreach ($rows as $row)
	{
		if ($row->$field<>'') {	$ret=$row->$field;}
	};
	$a=json_decode($ret,true);
	$type_mat=$a['metadata.title'];
}

if ($item_id<>'')
{
	$list = $db->setQuery('SELECT name, elements FROM jos_zoo_item where id='.$item_id)->loadAssoc();						
	$a=json_decode($list['elements'],true);
	$fmid=$a['6e6bfd81-74f2-434c-8306-b80e2287bf44']['item']['0'];
	$prfm=$a['5eea65b2-7504-4863-bae7-7fb95490e156']['option']['0'];
}
 
if ((empty($_GET[category_id])) and ($_GET['item_id']==$item_id))
{
	//matetial
	//бизнес планы
	if ($type_mat=="Бизнес-планы"){			
		if ($fmid<>'' and $prfm=='')
		{
			echo '<a href="'.JRoute::_('bp.php?id='.$fmid).'" >
					<div id="textfm"><span>Посмотреть описание этого бизнес-плана с финансовой моделью</span></div>
				</a>';
		}
	}	

	//Маркетинговые исследования
	if ($type_mat=="Маркетинговые исследования"){
		if ($fmid<>'' and $prfm=='')
		{
			echo '<a href="'.JRoute::_('mi.php?id='.$fmid).'" >
				<div id="textfm"><span>Посмотреть описание этого маркетингового исследования с финансовой моделью</span></div>
			</a>';
		}	
	}
}

?>

</div>