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

<?php
 
 
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;
} 



?>


<style>


#servidoresvps {
	width:100%;
	height:auto;
	overflow:hidden;
	}
	
.servidoresvps_servidoresvps {
	width:100%;
	height:auto;
	overflow:hidden;
	}
		
#servidoresvps_cont{
	width:100%;
	height:auto;
	overflow:hidden;
}
	
</style>
<div id="servidoresvps">                                                  

 <?php
 

			$query = "SELECT 
					  tblproducts.`type`,
					  tblproducts.gid,
					  tblproducts.name,
					  tblproducts.description,
					  tblproducts.hidden,
					  tblpricing.annually,
					  tblpricing.relid,
					  tblproducts.id,
					  tblpricing.semiannually,
					  tblpricing.quarterly,
					  tblpricing.monthly,
					  tblpricing.`type`,
					  tblcurrencies.prefix,
					  tblcurrencies.suffix,
					  tblpricing.currency
					FROM
					 tblpricing
					 RIGHT OUTER JOIN tblproducts ON (tblpricing.relid=tblproducts.id)
					 INNER JOIN tblcurrencies ON (tblcurrencies.id=tblpricing.currency)
					WHERE
					  (tblproducts.`type` = 'server') AND 
					  (tblpricing.`type` = 'product') AND 
					  (tblproducts.gid IN (26)) AND 
					  (tblproducts.hidden = '') AND

					  (tblpricing.currency = '".$currency."') 

					ORDER BY

					  tblpricing.monthly ASC";

		

			$dservers = $api->ApiDB->QueryToArray($query);

			

?>

                                               

                                                    

<style>
.vps_cont{
	width:100%;
	margin:auto;
	height:auto;
	overflow:hidden;
	background:#e6ecf5;}
	
.vps_cont table{
	border-collapse:collapse;
	width:100%;
	padding:0;
	margin:0;
	height:auto;
	overflow:hidden;}
	

.vps_cont table td{
	border:1px solid #f0f4fa;
	border-bottom:1px solid #d8dfeb;
	text-align:center;
	}

.vpsspecs{
		font-family:Tahoma, Geneva, sans-serif;
		font-size:8pt;
		color:#333;
		padding:0 0px;	
	}
	
.vpsspecsH{
		font-family:Tahoma, Geneva, sans-serif;
		font-size:8pt;
		color:#333;
		padding:0 0px;		
		background-color:#e1ffc8;
	}
	
	.vpsdesc{
		background-color:#e8e8e8;
				}
	
	.vpsdesct{
		width:auto;
		padding:5px 0;
		font-family: 'Roboto Condensed', sans-serif !important;
		font-weight:normal !important;
		font-size:10pt !important;
		background-color:#556379;
		text-shadow:none !important;
		color:#fff !important;
		border-radius:0px;
		}
	
		
	.vpsspecs td{
		font-family:Tahoma, Geneva, sans-serif;
		font-size:8pt;
		padding:0px 0px;		
		}	
		
	.vpsspecsH td{
		font-family:Tahoma, Geneva, sans-serif;
		font-size:8pt;
		padding:0px 0px;		
		}	
		
	.plandesc{
		font-family: 'Ubuntu', sans-serif !important;
		font-size:12px !important;
		font-weight:normal;
		color:;
		padding:0px 0;
		border-radius:0px;
		border-bottom:1px solid #cad2d9;
		}
	
	.vpsprecio strong{
		width:auto;
		font-weight:strong;
		color:#F00 !important;
		font-size:15px !important;
		font-family: 'Play', sans-serif !important;
		}
		
	.vpscaract{
		font-family: 'Roboto Condensed', sans-serif !important;
		font-weight:normal !important;
		font-size:12pt !important;
		background-color:#929fb3;
		text-shadow:none !important;
		color:#fff !important;
		border-radius:0px;
		}
		
	.vpscaract strong{
		color:#fff !important;
		text-shadow:none !important;
		}
	
	.linkitem{
		overflow:hidden;
		width:auto;
		margin:auto;
		text-align:right;
		border:0px solid #0FF;
		text-decoration:none;
		}
	.linkitem h3{
		background:#009cef;
		width:100%;
		overflow:hidden;
		padding:10px 0;
		font-size:16px !important;
		color:#FFF !important;
		text-align:center;
		text-decoration:none !important;}

	.linkitem h3 img{
		position:relative;
		float:right;
		right:20px;
		top:3px;
		}

</style>
                                                    
             <div class="vps_cont">
                <table>
                    <tbody>
                    <tr class="vpsdesc">
                        <td class="vpsdesct">VPS</td>
                        <td class="vpsdesct">RAM</td>
                        <td class="vpsdesct">ESPACIO</td>
                        <td class="vpsdesct">CONEXIÓN</td>
                        <td class="vpsdesct">TRANSFERENCIA</td>
                        <td class="vpsdesct">IP's</td>
                        <td class="vpsdesct">COSTO</td>
                        <td class="vpsdesct">CONFIGURAR</td>
                    </tr>
                    
                    
                    <?php foreach($dservers as $vps):?>
                        <tr class="vpsspecs" onmouseover="this.className='vpsspecsH';" onmouseout="this.className='vpsspecs';">
                        <td class="vpscaract"><?=$vps['name']?></td>
                        <td class="plandesc">	<?=extraer($vps['description'], 1, " ")?></td>
                        <td class="plandesc">	<?=extraer($vps['description'], 3, " ")?></td>
                        <td class="plandesc">	<?=extraer($vps['description'], 5, " ")?></td>
                        <td class="plandesc">	<?=extraer($vps['description'], 7, " ")?></td>
                        <td class="plandesc">	<?=extraer($vps['description'], 9, " ")?></td>
                        <td class="plandesc vpsprecio">desde <?=$vps['prefix']?><strong> <?=$vps['monthly']?></strong> <?=$vps['suffix']?> / Mes. </td>
                        <td class="plandesc"><a class="linkitem" href="https://www.afterfuture.net/clientes/cart.php?a=add&pid=<?=$vps['id']?>&currency=<?=$currency?>&systpl=afnet" target="_self" title="Configurar Servidor"><h3 class="configurar">Configurar <img style="position:relative; margin-top:-5px;"src="{$TEMPLATE_URL}/img/icon_configure.png" /></h3></a></td>
                    </tr>
                    <?php endforeach; ?>
                    
                    
                    </tbody>
                </table>
             </div>
        
        
</div>                            
   
    
{literal}
<script>
	$(document).ready(function() {
		
		  $('.contenido_ajax').show();
		  $('#loading').hide();

		$("#nav ul").tabs("#panes > div", {effect: 'fade', fadeOutSpeed: 200, initialIndex: 0});
	});
</script>
{/literal}