Your IP : 216.73.216.240


Current Path : /home/j/u/v/juvelize/www/administrator/components/com_acymailing/views/data/tmpl/
Upload File :
Current File : /home/j/u/v/juvelize/www/administrator/components/com_acymailing/views/data/tmpl/sobipro.php

<?php
/**
 * @package	Acymailing for Joomla!
 * @version	4.0.1
 * @author	acyba.com
 * @copyright	(C) 2009-2012 ACYBA S.A.RL. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
	$db = JFactory::getDBO();
	$config = acymailing_config();
	$sobiproInfo = unserialize($config->get('sobipro_import'));

	$query='SELECT a.fid, a.nid, fieldType, section, b.name, filter FROM #__sobipro_field as a JOIN #__sobipro_object as b ON a.section = b.id  WHERE (fieldType = "inbox" AND ( filter = "title" OR filter = "0" OR filter = "")) OR (fieldType = "inbox" AND filter = "email") ORDER BY `section`';
	$db->setQuery($query);
	$nidResult = $db->loadObjectList();

	$section = array();

	foreach($nidResult as $oneResult){
		if(!isset($section[$oneResult->section])) {
			$section[$oneResult->section] = array();
			$section[$oneResult->section]['sectionName'] = $oneResult->name;
			$section[$oneResult->section]['sectionID'] = $oneResult->section;
			$section[$oneResult->section]['email'] = array(JHTML::_('select.option', '','---'));
			$section[$oneResult->section]['name'] = array(JHTML::_('select.option', '','---'));
		}
		if(($oneResult->fieldType=='inbox' && $oneResult->filter=='email')){
			$section[$oneResult->section]['email'][] = JHTML::_('select.option', $oneResult->fid, $oneResult->nid);
		}
		if(($oneResult->fieldType == 'inbox' && (($oneResult->filter == "title") || ($oneResult->filter == "0") || ($oneResult->filter == "")))){
			$section[$oneResult->section]['name'][] = JHTML::_('select.option', $oneResult->fid, $oneResult->nid);
		}
	}
	?>
	<table>
	<?php
	foreach($section as $oneSection){
	?>
		<tr>
			<td><?php echo $oneSection['sectionName']; ?></td>
			<td><?php echo JHTML::_('select.genericlist', $oneSection['email'], 'config['.$oneSection['sectionID'].'][sobiEmail]' , 'size="1"', 'value', 'text', isset($sobiproInfo[$oneSection['sectionID']]['sobiEmail']) ? $sobiproInfo[$oneSection['sectionID']]['sobiEmail'] : ''); ?></td>
			<td><?php echo JHTML::_('select.genericlist', $oneSection['name'], 'config['.$oneSection['sectionID'].'][sobiName]' , 'size="1"', 'value', 'text', isset($sobiproInfo[$oneSection['sectionID']]['sobiName']) ? $sobiproInfo[$oneSection['sectionID']]['sobiName'] : '' ); ?></td>
		</tr>
	<?php
	}
	?>
	</table>