<?php
	$api = new Apiwhmcs();
	$api->api_db_conect(APIHOST, APIUSER, APIPASS, APIDATABASE);

switch ($_SESSION['currency']) {
    case '':
		$currency = 2;
        break;
    case 'usd':
		$currency = 1;
        break;
    case 'gbp':
		$currency = 7;
        break;
    case 'mxn':
		$currency = 2;
        break;
    case 'eur':
		$currency = 3;
        break;
    case 'cop':
		$currency = 9;
        break;
    case 'ars':
		$currency = 10;
        break;
    case 'pen':
		$currency = 11;
        break;
    case 'uyu':
		$currency = 12;
        break;
    case 'clp':
		$currency = 13;
        break;
    case 'vef':
		$currency = 14;
        break;} 

			$query = "SELECT 
					  tbldomainpricing.id,
					  tbldomainpricing.extension,
					  tbldomainpricing.`order`,
					  tblpricing.`type`,
					  tblpricing.relid,
					  tblpricing.msetupfee,
					  tblpricing.currency,
					  tblcurrencies.prefix,
					  tblcurrencies.suffix
					FROM
					 tblpricing
					 RIGHT OUTER JOIN tbldomainpricing ON (tblpricing.relid=tbldomainpricing.id)
					 INNER JOIN tblcurrencies ON (tblcurrencies.id=tblpricing.currency)
					WHERE
					  tblpricing.`type` = 'domainregister' AND (tblpricing.currency = '".$currency."')";
		
			$dominios = $api->ApiDB->QueryToArray($query);

?>
<style>

#domainprices{
    position:relative;
    overflow:hidden;
    max-width:100%;
	margin:0 0px;
    height:auto;
}


#domainprices .items {
    max-width:100%;
    position:relative;
    clear:both;
}



#domainprices .active {
    position:relative;
    cursor:default;
}

#domainprices div.itemwrap{
	margin:0 0px 0 0;
	width:100%;
	list-style:none;
	float:left;
	overflow:hidden;}


#domainprices div.item{
	float:left; 
	width:193px !important; 
	height:61px !important;
	margin-right:1px; 
	background:url('{$TEMPLATE_URL}/img/layer_5_bg.png');
	border-bottom:0px solid #666; 
	}

#domainprices .item div.pic{
	float:left;
	width:48px;
	height:48px;
	padding:0;
	margin:5px 10px;
	border:0px solid #990;
	}
	
#domainprices .item div.pic img{
	border-radius:50%;
	width:48px;
	height:48px;
	}

h5.price{
	font-size:10px !important;
	position:relative;
	margin-left:0px;
	margin-top:5px;
	}	


	h5.price strong{
			margin: 0;
			color:#F00 !important;
			font-size:18px !important;

		}
		
	.dmitem h5.price a{
		margin:10px 0;
			color:#fff;
			font-size:12px;
			text-decoration:none;

		}

	#iconpromo{
	overflow:hidden;
	background:url('{$TEMPLATE_URL}/img/planhosting_iconpromo.png') no-repeat;
	text-align:left;
	font-size:11px !important;
	color:#F00;
	font-weight:bold;
	position:absolute !important;
	margin-top:-55px;
	margin-left:141px !important;
	width:49px !important;
	z-index:200;
	height:49px !important;
	}
	
.apkeyd{
	display:none;}
	
a.nextd2{
	color:#9F0 !important;
	background:url('{$TEMPLATE_URL}/img/layer_autoprev.png');
	padding:0 5px;
	cursor:pointer;
	position:absolute;
	border-left:1px solid #FFF;
	border-right:1px solid #FFF;
	bottom:0px;
	height:100%;
	z-index:1200;
	right:0px;
	}
a.nextd2 img{
	position:relative;
	top:30%;
	margin-top:0px;
	width:auto;
	max-width:20px;
	height:15px;}
	
a.prevd2{
	color:#9F0 !important;
	background:url('{$TEMPLATE_URL}/img/layer_autoprev.png');
	padding:0 5px;
	cursor:pointer;
	position:absolute;
	border-left:1px solid #FFF;
	border-right:1px solid #FFF;
	bottom:0px;
	height:100%;
	z-index:200;
	left:0px;
	}
	
a.prevd2 img{
	position:relative;
	top:30%;
	margin-top:0px;
	width:auto;
	max-width:20px;
	height:15px;}
</style>

<div id="domainprices">
                    <div class="items">
                        <div class="itemwrap">
							<? $i=1; if($dominios != ''): foreach($dominios as $dominio):?>
                            
                            <div class="item">
                                    <div class="pic"><img src="{$TEMPLATE_URL}/img/icon_<?=substr($dominio['extension'], 1)?>.jpg" alt="<?=substr($dominio['extension'], 1)?>" /></div>
                                    <span style="font-size:16px !important; font-weight:bold; margin:0 0 0 0 !important; padding:0 !important; text-align:center; top:12px; position:relative;"><?=$dominio['extension']?></span>
                                    <h5 class="price"><?=$dominio['prefix']?> <strong><?=$dominio['msetupfee']?></strong> <?=$dominio['suffix']?></h5> 		
                            		<? if($promolink[0]['code'] != ''):?><a href="{$SITE_URL}/<?=$promolink[0]['format_seo']?>/<?=$promolink[0]['promocion_id']?>-<?=$promolink[0]['promocion_seo']?>" class="overlayed fancybox.iframe"><div id="iconpromo"></div></a><? endif; ?>
                            </div>       
                                    <? if(($i%6)=='0'):?></div><div class="itemwrap"><? endif; ?>
                            <? $i++; endforeach; endif;?>
                        </div>                    
                    </div>
</div>

