<?php
/*
  osCommerce, Open Source E-Commerce Solutions 
http://www.oscommerce.com 

Copyright (c) 2003 osCommerce 

osCommRes, Services Oline 
http://www.oscommres.com 
Copyright (c) 2005 osCommRes 

Freeway eCommerce 
http://www.zac-ware.com/freeway 
Copyright (c) 2007 ZacWare 

Released under the GNU General Public License
*/
// Check to ensure this file is included in Freeway!
defined('_FEXEC') or die();
?>          
<!-- affiliate_system //-->
<tr>
   <td>
<?php
	$template_html='<tr>
						<td width="{{INITIAL_WIDTH}}"></td><td class="{{CLASS}}">{{SPACER}}{{ICON}}</td><td class="{{CLASS}}"><a href={{LINK_1}}> {{NAME}}</a></td>
					</tr>
					<tr>
						<td height="5"></td>
					</tr>
					';
	$replace_array=array();
	$replace_array["INITIAL_WIDTH"]=$INITIAL_WIDTH;
	$replace_array["CLASS"]="infoBoxNavigation";
	$replace_array["SPACER"]=tep_draw_separator('pixel_trans.gif',10,1);
	$replace_array["ICON"]=$CONTENT_ICON;
	$replace_html=$template_html;
	
	reset($replace_array);
	while(list($key,)=each($replace_array)){
		$replace_html=str_replace("{{" . $key . "}}",$replace_array[$key],$replace_html);
	}
	
	if(!defined('BOX_HEADING_AFFILIATE'))define('BOX_HEADING_AFFILIATE', 'Affiliate Info');
	$info_box_contents = array();
	$info_box_contents[] = array('text'  => BOX_HEADING_AFFILIATE );

	new infoBoxHeading($info_box_contents, true, true);
	$detail_info=array();
	if (tep_session_is_registered('affiliate_id')) {
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL'),BOX_AFFILIATE_SUMMARY);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL'),BOX_AFFILIATE_ACCOUNT);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'),BOX_AFFILIATE_PAYMENT);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'),BOX_AFFILIATE_CLICKRATE);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'),BOX_AFFILIATE_SALES);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_BANNERS),BOX_AFFILIATE_BANNERS);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_CONTACT),BOX_AFFILIATE_CONTACT);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_FAQ),BOX_AFFILIATE_FAQ);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_LOGOUT),BOX_AFFILIATE_LOGOUT);
	} else {
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE_INFO, '', 'SSL'),BOX_AFFILIATE_INFO);
		$detail_info[]=array(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'),BOX_AFFILIATE_LOGIN);
	}
	for ($icnt=0,$n=count($detail_info);$icnt<$n;$icnt++){
		$replace_string=$replace_html;
		$replace_string=str_replace("{{LINK_1}}",$detail_info[$icnt][0],$replace_string);
		$replace_string=str_replace("{{NAME}}",$detail_info[$icnt][1],$replace_string);
		$affiliate_string.=$replace_string;;
	}

 $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                               'text'  => '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . $affiliate_string . '</table>');
  new infoBox($info_box_contents);
  
$info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
								'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
                              );
  new infoboxFooter($info_box_contents, true, true);
?>
            </td>
          </tr>
<!-- affiliate_system_eof //-->
