<? if(isset($_GET['plan_seo'])){
	
	
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;} 
		
	$api = new Apiwhmcs();
	$api->api_db_conect(APIHOST, APIUSER, APIPASS, APIDATABASE);
		
			$query = "SELECT 
					  tblpricing.currency,
					  tblpricing.relid,
					  tblpricing.semiannually,
					  tblpricing.annually,
					  tblpricing.monthly,
					  tblproducts.order, 
					  tblpricing.`type`,
					  tblproducts.id,
					  tblproducts.`type`,
					  tblproducts.gid,
					  tblproducts.name,
					  tblproducts.hidden,
					  tblproducts.configoption1,
					  tblproducts.configoption2,
					  tblproducts.configoption3,
					  tblproducts.configoption4,
					  tblproducts.configoption5,
					  tblproducts.configoption6,
					  tblproducts.configoption7,
					  tblproducts.configoption8,
					  tblproducts.configoption9,
					  tblproducts.configoption10,
					  tblproducts.configoption11,
					  tblproducts.configoption12,
					  tblproducts.configoption13,
					  tblproducts.configoption14,
					  tblproducts.configoption15,
					  tblproducts.configoption16,
					  tblproducts.configoption17,
					  tblproducts.configoption18,
					  tblproducts.configoption19,
					  tblproducts.configoption20,
					  tblproducts.configoption21,
					  tblproducts.configoption22,
					  tblproducts.configoption23,
					  tblproducts.configoption24,
					  tblcurrencies.prefix,
					  tblcurrencies.suffix
					FROM
					 tblpricing
					 RIGHT OUTER JOIN tblproducts ON (tblpricing.relid=tblproducts.id)
					 INNER JOIN tblcurrencies ON (tblcurrencies.id=tblpricing.currency)
					WHERE
					  (tblpricing.currency = '".$currency."') AND 
					  (tblpricing.`type` = 'product') AND 
					  (tblproducts.`gid` = '1') AND
					  (tblproducts.hidden = '') AND 
					  (tblproducts.`type` = 'hostingaccount')
					ORDER BY
						  tblproducts.order ASC";
		
			$planes_hosting = $api->ApiDB->QueryToArray($query);
		
			
			 $query2 = "SELECT * FROM catalogo WHERE catalogo.seo = '".$_GET['plan_seo']."' AND catalogo.status = '1' ORDER BY catalogo.id LIMIT 1";
			 $producto = $engine->DB->QueryToArray($query2);
			 
			 $visitas = $producto[0]['visitas']+1;
			 
			 $query_visitas = "UPDATE catalogo SET visitas = ".$visitas." WHERE catalogo.status = '1' AND catalogo.id =".$producto[0]['id']."";
			 $update_visitas = $engine->DB->QueryToArray($query_visitas);

			$tpl->assign("TITULO",		$producto[0]['titulo']);
			$tpl->assign("SEO",			$producto[0]['seo']);
			$tpl->assign("DESCRIPCION",	$producto[0]['descripcion']);
			$tpl->assign("KEYWORDS",	$producto[0]['keywords']);
			
			if($producto[0]['secure'] == '1' && $_SESSION['log_user'] == '' && $_SESSION['log_session'] == ''):
				$contenido 	= modulo_html(TEMPLATE_DIR.'/plugins/login.php');
				$descripcion 	= '';
				$precio 		= '';
				$btn_compra 	= '';		
				$galeria	= '';
			else:
				$contenido 		= $producto[0]['contenido'];
				$descripcion 	= $producto[0]['descripcion'];
				$precio 		= $producto[0]['precio'];
				$btn_compra 	= $producto[0]['btn_compra'];
				if($producto[0]['pic_portada'] != ''): 
					$tpl->assign("PIC_PORTADA",	'<div style="position:relative; float:left; border:2px solid #fafbfc; margin:0 10px;"><img src="'.SITE_URL.'/media/catalogo/thumbs/'.$producto[0]['pic_portada'].'"></div>');
				endif;
			endif;
			
			$tpl->assign("CONTENIDO",	$tpl->fetch('string:'.$contenido));
			$tpl->assign("DESCRIPCION",	$tpl->fetch('string:'.$descripcion));
			$tpl->assign("PRECIO",		$tpl->fetch('string:'.$precio));
			$tpl->assign("BTN_COMPRA",	$tpl->fetch('string:'.$btn_compra));
			$tpl->assign("GALERIA"	,	$tpl->fetch('string:'.$galeria));
			
	switch($_GET['plan_seo']){
		
		case 'plan-hosting-empresarial';
			$plan_id = '4';
			$plan_storage = substr($planes_hosting[$plan_id]['configoption3'], 0, -3);
			$plan_transfer = 'Ilimitada';
			$plan_uptime = '99.9%';
			$plan_emails = '500';
			$plan_domain = '1';
			$plan_nodomains = '1';
			$plan_activation = '15 Min';
			$plan_warranty = '30 días';
			$plan_ip = '1';
			$plan_ssl = '0';
			$plan_antivirus = '1';
			$plan_firewall = '1';
			$plan_prefix = $planes_hosting[$plan_id]['prefix'];
			$plan_annually = $planes_hosting[$plan_id]['annually'];
			$plan_suffix = $planes_hosting[$plan_id]['suffix'];
			$plan_pic = '{$TEMPLATE_URL}/img/plan_empresarial.png';
		break;
		case 'plan-hosting-corporativo';
			$plan_id = '5';
			$plan_storage = substr($planes_hosting[$plan_id]['configoption3'], 0, -3);
			$plan_transfer = 'Ilimitada';
			$plan_uptime = '99.9%';
			$plan_emails = '1000';
			$plan_domain = '1';
			$plan_nodomains = '3';
			$plan_activation = '15 Min';
			$plan_warranty = '30 días';
			$plan_ip = '1';
			$plan_ssl = '1';
			$plan_antivirus = '1';
			$plan_firewall = '1';
			$plan_prefix = $planes_hosting[$plan_id]['prefix'];
			$plan_annually = $planes_hosting[$plan_id]['annually'];
			$plan_suffix = $planes_hosting[$plan_id]['suffix'];
			$plan_pic = '{$TEMPLATE_URL}/img/plan_corporativo.png';
		break;
		case 'plan-hosting-premium';
			$plan_id = '6';
			$plan_storage = substr($planes_hosting[$plan_id]['configoption3'], 0, -3);
			$plan_transfer = 'Ilimitada';
			$plan_uptime = '99.9%';
			$plan_emails = 'Ilimitado';
			$plan_domain = '1';
			$plan_nodomains = '5';
			$plan_activation = '15 Min';
			$plan_warranty = '30 días';
			$plan_ip = '1';
			$plan_ssl = '1';
			$plan_antivirus = '1';
			$plan_firewall = '1';
			$plan_prefix = $planes_hosting[$plan_id]['prefix'];
			$plan_annually = $planes_hosting[$plan_id]['annually'];
			$plan_suffix = $planes_hosting[$plan_id]['suffix'];
			$plan_pic = '{$TEMPLATE_URL}/img/plan_premium.png';
		break;
		
		}
                
			?>
            
            <style>
            	#producto_cont{
					margin:0px 0;
					padding:20px 0; 
					overflow:hidden;
					border-bottom:2px solid #f0f2f5;
					background:url('{$TEMPLATE_URL}/img/layer_5_bg.png');}
					
				.planinfo{
					width:100%;
					border:1px solid #03C;
					width:auto;
					height:auto;
					overflow:hidden;
					padding:0 25px}
				.planpic_full{
					text-align:center;
					height:199px;
					border:0px solid #999;
					overflow:hidden;
					float:left;}
				.plandesc{
					height:auto;
					border:0px solid #999;
					overflow:hidden;
					float:left;}
					.plandesc h2{
						font-size:38px !important;
						color:#007cc3 !important;}

div.content{
	padding:10px !important;
	margin:10px 0 !important;
}
					
.content *{
	font-size:12px !important;}	
	
	
	.btncompra{
		overflow:hidden;
		width:auto;
		margin:auto;
		text-align:right;
		border:0px solid #0FF;
		text-decoration:none;
		}
	
	.btncompra h3{
		border-radius:7px;
		border:2px solid #FFF;
		background:#86be50;
		width:100%;
		overflow:hidden;
		padding:10px 0;
		font-size:14px !important;
		color:#FFF !important;
		text-align:center;
		text-decoration:none !important;}

	.btncompra h3:hover{
		background:#ff933b !important;
		width:100%;
		overflow:hidden;
		padding:10px 0;
		font-size:14px !important;
		color:#FFF !important;
		text-align:center;
		text-decoration:none !important;}

	.btncompra{
		color:#FFF !important;
		text-decoration:none !important;}
	
	.btncompra:hover{
		color:#FFF !important;
		text-decoration:underline !important;}
	
	
	.plan_details{
		margin:10px 0 0 0;
		}
	
	.plan_caract{
		font-size:14px !important;
		border-bottom:1px solid #d8e2f0;
		text-align:right;
		color:#999 !important;
		padding:10px 5px;
	}	
	
	.plan_detail{
		font-weight:bold !important;
		padding:10px 5px;
		font-size:14px !important;
		border-bottom:1px solid #ecf4ff;
		text-align:left;
		color:#0d9bec !important;}	
	
	.col-md-4{
		margin:0;
		padding:0;}
		
	h2.plan_price{
		text-align:right;
		color:#999 !important;
		font-size:32px !important;
	}
	h2.plan_price strong{
		color:#ff4107 !important;
		font-size:32px !important;
		}
            </style>
                
            <div id="producto_cont">
            
            	<div class="col-md-12">
                	<div class="planpic_full col-md-3"><img src="<?=$plan_pic?>"></div>
                    <div class="plandesc col-md-9">
                    	<div class="col-md-12"><h2>{$TITULO}</h2></div>
                        <div class="col-md-12">{$DESCRIPCION}</div>
                        <div class="col-md-12 plan_details">
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Capacidad:</div>
                            	<div class="col-md-6 plan_detail"><?=$plan_storage?> GB</div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Transferencia:</div>
                            	<div class="col-md-6 plan_detail"><?=$plan_transfer?></div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Uptime:</div>
                            	<div class="col-md-6 plan_detail"><?=$plan_uptime?></div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Dominio Gratis:</div>
                            	<div class="col-md-6 plan_detail"><img src="{$TEMPLATE_URL}/img/<? if($plan_domain == 0):?>no<? else: ?>checkmark<? endif;?>.gif" /></div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Aloja Hasta:</div>
                            	<div class="col-md-6 plan_detail"><?=$plan_nodomains?> Sitio(s)</div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Emails x Hora:</div>
                            	<div class="col-md-6 plan_detail"><?=$plan_emails?></div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Activación:</div>
                            	<div class="col-md-6 plan_detail"><?=$plan_activation?></div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Garantía:</div>
                            	<div class="col-md-6 plan_detail"><?=$plan_warranty?></div>
                            </div>
                            <div class="col-md-4">
                            	<div class="col-md-6 plan_caract">IP Dedicada:</div>
                            	<div class="col-md-6 plan_detail"><img src="{$TEMPLATE_URL}/img/<? if($plan_ip == 0):?>no<? else: ?>checkmark<? endif;?>.gif" /></div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Certificado SSL:</div>
                            	<div class="col-md-6 plan_detail"><img src="{$TEMPLATE_URL}/img/<? if($plan_ssl == 0):?>no<? else: ?>checkmark<? endif;?>.gif" /></div>
                            </div>
                            <div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Antivirus:</div>
                            	<div class="col-md-6 plan_detail"><img src="{$TEMPLATE_URL}/img/<? if($plan_antivirus == 0):?>no<? else: ?>checkmark<? endif;?>.gif" /></div>
                            </div>
                        	<div class="col-md-4">
                            	<div class="col-md-6 plan_caract">Firewall:</div>
                            	<div class="col-md-6 plan_detail"><img src="{$TEMPLATE_URL}/img/<? if($plan_firewall == 0):?>no<? else: ?>checkmark<? endif;?>.gif" /></div>
                            </div>
                        </div>
                        <div class="content col-md-12">{$CONTENIDO}</div>
                        <div class="col-md-6"><h2 class="plan_price"><?=$plan_prefix?> <strong><?=$plan_annually?></strong> <?=$plan_suffix?></h2></div>
                        <div class="col-md-6">
                            <a class="btncompra"  href="https://www.afterfuture.net/clientes/cart.php?a=add&amp;pid=<?=$planes_hosting[$plan_id]['id']?>&amp;currency=<?=$currency?>&amp;systpl=afnet" target="_self" title="Configurar Servidor">
                              <h3 class="configurar">Contratar! <img style="position:relative; margin-top:-5px;"src="{$TEMPLATE_URL}/img/icon_buy.png" /></h3>
                            </a>                        
                        </div>
                    </div>
                </div>
                
                <div class="col-md-12">
                	
                </div>
            <div style="background:#f0f1f2;" class="col-md-12"><? require_once('hosting_compartido_info.php');?></div>
            <h4 style="text-align:center; background:url('{$TEMPLATE_URL}/img/layer_1_bg.png'); width:100%; overflow:hidden; color:#fff !important; padding:5px;">Listos para instalar tus Aplicaciones más Populares</h4>
            <img style="width: auto; width: 100%; height: auto;" src="{$TEMPLATE_URL}/img/softaculous-hostingpic.jpg" alt="" width="1170" height="138">
                
            <h4 style="text-align:center; background:url('{$TEMPLATE_URL}/img/layer_1_bg.png'); width:100%; overflow:hidden; color:#fff !important; padding:5px;">Compara nuestros Planes</h4>
            <? require_once('hosting_planes_comparar.php');?>
            </div>
<? } else { ?>


			<? require_once('hosting_header_empresarial.php');?>
			<div style="background:#f0f1f2; width:auto; height:auto; overflow:hidden; border-bottom:1px solid #CCC;"><? require_once('hosting_empresarial_info.php');?></div>

<div class="col-md-12" style=" z-index:100; background:none; padding:0 !important; margin:0 !important;">
			<? require_once('hosting_planes_empresarial.php');?>
        </div>
    		
            <div style="position:relative;"><img style="display: block; margin:10px 0" src="{$SITE_URL}/media/img/page-div.png" alt="" width="803" height="3" /></div>
               
<style>
            
        div.block{
			padding:5px 5px;
			z-index:100;
            text-align:center;
            overflow:hidden;
            position:relative;
			border-top:3px solid #415667;
			border-bottom:3px solid #415667;
			background:#485f72;
            }
        a:hover{
			color:#FFF !important;
			}
        div.block a img{
            width: 100%;
            margin:0;
            padding:0;}
            
        div.block h4{
            position:relative;
            color:#fff !important;
            font-weight:bold !important;
            font-size:22px !important;
            text-align:center;
            width:100%;
            padding:5px;
            height:auto;
        }
        div.block h5{
            font-size:12px !important;
            width:100%;
            padding:15px 15px;
            text-align:center;
            height:auto;
			color:#FFF !important;
        }
        </style>
   
<h4 style="text-align:center; background:url('{$TEMPLATE_URL}/img/layer_1_bg.png'); width:100%; overflow:hidden; color:#fff !important; padding:5px;">Listos para instalar tus Aplicaciones más Populares</h4>
<img style="width: auto; width: 100%; height: auto;" src="{$TEMPLATE_URL}/img/softaculous-hostingpic.jpg" alt="" width="1170" height="138">
    
        <h4 style="text-align:center; background:url('{$TEMPLATE_URL}/img/layer_1_bg.png'); width:100%; overflow:hidden; color:#fff !important; padding:5px;">Te garantizamos el mejor servicio de Alojamiento Web</h4>
        <div style="width:100%; height:auto; overflow:hidden;"><? require_once('testimoniales.php');?></div>
        
<div class="block col-md-4">
<h4>Prueba el Panel de Control</h4>
<a href="http://hyperion.afterfuture.net:2082/login/?user=democ&amp;pass=cpanel=1234" target="_blank"><img src="{$TEMPLATE_URL}/img/webhosting-cpanelpic.jpg" alt="" width="370" height="100" /> </a>
<h5>Panel de Control listo para ofrecerte una experiencia libre de complicaciones al administrar los contenidos de tu Web.&nbsp;</h5>
</div>
<div class="block col-md-4">
<h4>Sitio en Minutos!</h4>
<img src="{$TEMPLATE_URL}/img/webhosting-sitebuilderpic.jpg" alt="" width="370" height="100" />
<h5>Exclusivo constructor de Sitios Web en Minutos, dise&ntilde;a tu p&aacute;gina Web en HTML5 y para M&oacute;viles desde tu panel de control.</h5>
</div>
<div class="block col-md-4">
<h4>los Mejores Servidores</h4>
<img src="{$TEMPLATE_URL}/img/webhosting-servidorespic.jpg" alt="" width="370" height="100" />
<h5>Alojamos tu servicio en potentes servidores nunca sobrecargados, optimizados en seguridad y mejoras de rendimiento.</h5>
</div>


    <p style="position:relative;"><img style="display: block; margin-left: auto; margin-right: auto;" src="{$SITE_URL}/media/img/page-div.png" alt="" width="803" height="3" /></p>
<? }; ?>