<?php
include("postget.php");
//checklevel(1,$_REQUEST['clientid']);
/////////////////////////////////// solo se ejecuta si es un invitado
if (!$_SESSION['hd_accesslvl']) {

//// calcular la altura del archivo top_bg.gif
//// incluir esto al comienzo de los archivos que utilicen top_bg.gif o bot_bg.gif
    $bg_altura = @getimagesize('attachments/hd_back_menu_bot.gif');
    if (!$bg_altura) {
        $bg_altura[1] = 33;
    }
//////////////////////////////////////////////////////////////////////////////////
    $pagefrom = $_SERVER['PHP_SELF'];
    $pagefrom = explode('/', $_SERVER['PHP_SELF']);
    $pagefrom = array_pop($pagefrom);

    if ($config[84][1] == 1) {
        $serverurlSSL = str_replace('http://', 'https://', $config[1][1]);
    } else {
        $serverurlSSL = $config[1][1];
    }

//	print("<table class='menubar_bg' border='0' width='100%' cellpadding='0' cellspacing='0' align='center'><tr>");
    ?>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="metro span12">
                <div class="metro-sections">
<!--                    <script>
                        $(document).ready(function($){
                            var ventana_ancho = $(window).width();
                            var ventana_alto = $(window).height();
                            alert(ventana_ancho);
                            document.cookie ='anchopantalla='+ventana_ancho+'; expires=Thu, 2 Aug 2021 20:47:11 UTC;';
                        });
                    </script>-->

                    <div id="section1" class="metro-section tile-span-r">
                        <?php
                        if (substr($config[68][1], 0, 1) == '1') {
                            $link = "announcements.php";
                            $cuantas = query("SELECT id FROM hd_announcements WHERE status=1 AND onlyclients=0 AND langs LIKE '%" . $currentlang . "%'", 2);
                            $query = "SELECT comment FROM hd_announcements WHERE status=1 AND onlyclients=0 AND langs LIKE '%" . $currentlang . "%' ORDER BY id DESC LIMIT 5";
                            echo '
                  <a class="tile wide imagetext bg-color-blueDark" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/news.png" />
                     </div>
                     <div class="column-text">
                        <div class="text5">';
                            $data = mysql_query($query, $db_link);
                            while ($row = mysql_fetch_array($data)) {
                                echo '- ' . substr(strip_tags($row['comment']), 0, 18) . '...<br>';
                            }
                            echo '
                        </div>
                     </div>
                     <div class="app-label">' . ucfirst(_menu_ANNOUNCEMENTS) . '</div>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
                        } elseif (substr($config[68][1], 2, 1) == '1') {
                            $link = "must_enter.php";
                            $cuantas = query("SELECT id FROM hd_announcements WHERE status=1 AND onlyclients = 0 AND langs LIKE '%" . $currentlang . "%'", 2);
                            $query = "SELECT comment FROM hd_announcements WHERE status=1 AND onlyclients = 0 AND langs LIKE '%" . $currentlang . "%' ORDER BY id DESC LIMIT 5";
                            echo '
                  <a class="tile wide imagetext bg-color-blueDark" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/news.png" />
                     </div>
                     <div class="column-text">
                        <div class="text5">';
                            $data = mysql_query($query, $db_link);
                            while ($row = mysql_fetch_array($data)) {
                                echo '- ' . substr(strip_tags($row['comment']), 0, 18) . '...<br>';
                            }
                            echo '
                        </div>
                     </div>
                     <div class="app-label">' . ucfirst(_menu_ANNOUNCEMENTS) . '</div>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
                        }


                        if (substr($config[64][1], 0, 1) == '1') {
                            $link = "ticketsnewguest.php";
                            echo '
                  <a class="tile imagetext wideimage bg-color-orange" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/support.png" />
                     </div>
                     <div class="app-label">' . ucfirst(_menu_TICKETS) . '</div>
                  </a>
		';
                        } elseif (substr($config[64][1], 2, 1) == '1') {
                            $link = "must_enter.php";
                            echo '
                  <a class="tile imagetext wideimage bg-color-orange" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/support.png" />
                     </div>
                     <div class="app-label">' . ucfirst(_menu_TICKETS) . '</div>
                  </a>
		';
                        }



                        if (substr($config[67][1], 0, 1) == '1') {
                            $link = "faq.php";
                            $cuantas = query("SELECT id FROM hd_faq WHERE onlyclients = 0 AND langs LIKE '%" . $currentlang . "%'", 2);
                            $query = "SELECT question FROM hd_faq WHERE onlyclients = 0 AND langs LIKE '%" . $currentlang . "%' ORDER BY RAND() LIMIT 5";
                            echo '
                  <a class="tile wide imagetext bg-color-greenDark" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/faq.png" />
                     </div>
                     <div class="column-text">
                        <div class="text5">';
                            $data = mysql_query($query, $db_link);
                            while ($row = mysql_fetch_array($data)) {
                                echo '- ' . substr(strip_tags($row['question']), 0, 18) . '...<br>';
                            }
                            echo '
                        </div>
                     </div>
                     <div class="app-label">' . ucfirst(_menu_FAQ) . '</div>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
                        } elseif (substr($config[67][1], 2, 1) == '1') {
                            $link = "must_enter.php";
                            $cuantas = query("SELECT id FROM hd_faq WHERE onlyclients = 0 AND langs LIKE '%" . $currentlang . "%'", 2);
                            $query = "SELECT question FROM hd_faq WHERE onlyclients = 0 AND langs LIKE '%" . $currentlang . "%' ORDER BY RAND() LIMIT 5";
                            echo '
                  <a class="tile wide imagetext bg-color-greenDark" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/faq.png" />
                     </div>
                     <div class="column-text">
                        <div class="text5">';
                            $data = mysql_query($query, $db_link);
                            while ($row = mysql_fetch_array($data)) {
                                echo '- ' . substr(strip_tags($row['question']), 0, 18) . '...<br>';
                            }
                            echo '
                        </div>
                     </div>
                     <div class="app-label">' . ucfirst(_menu_FAQ) . '</div>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
                        }


                        if (substr($config[71][1], 0, 1) == '1') {
                            $link = "manuals.php";
                            $cuantas = query("SELECT id FROM hd_manuals_pages WHERE onlyclients = 0 AND langs LIKE '%" . $currentlang . "%'", 2);
                            echo '
                  <a class="tile imagetext wideimage bg-color-purple" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/manual.png" />
                     </div>
                     <div class="app-label">' . ucfirst(_menu_MANUALS) . '</div>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
                        } elseif (substr($config[71][1], 2, 1) == '1') {
                            $$link = "must_enter.php";
                            $cuantas = query("SELECT id FROM hd_manuals_pages WHERE onlyclients = 0 AND langs LIKE '%" . $currentlang . "%'", 2);
                            echo '
                  <a class="tile imagetext wideimage bg-color-purple" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/manual.png" />
                     </div>
                     <div class="app-label">' . ucfirst(_menu_MANUALS) . '</div>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
                        }


                        if (substr($config[69][1], 0, 1) == '1') {
                            $link = "downloads.php";
                            $cuantas = query("SELECT id FROM hd_downloads WHERE onlyclients = 0", 2);
                            echo '
                  <a class="tile imagetext wideimage bg-color-red" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/download.png" />
                     </div>
                     <div class="app-label">' . ucfirst(_menu_DOWNLOADS) . '</div>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
                        } elseif (substr($config[69][1], 2, 1) == '1') {
                            $link = "must_enter.php";
                            $cuantas = query("SELECT id FROM hd_downloads WHERE onlyclients = 0", 2);
                            echo '
                  <a class="tile imagetext wideimage bg-color-red" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/download.png" />
                     </div>
                     <div class="app-label">' . ucfirst(_menu_DOWNLOADS) . '</div>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
                        }


                        if (substr($config[65][1], 0, 1) == '1') {
                            $link = "contact.php";
                            echo '
                  <a class="tile imagetext wideimage bg-color-blue" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/contact.png" />
                     </div>
                     <div class="app-label">' . ucfirst(_menu_CONTACT) . '</div>
                  </a>
		';
                        } elseif (substr($config[65][1], 2, 1) == '1') {
                            $link = "must_enter.php";
                            echo '
                  <a class="tile imagetext wideimage bg-color-blue" href="' . $link . '">
                     <div class="image-wrapper">
                        <img src="images/contact.png" />
                     </div>
                     <div class="app-label">' . ucfirst(_menu_CONTACT) . '</div>
                  </a>
		';
                        }


                        if ($config[50][1] == '1' OR $config[7][1] == '1' OR $config[15][1] == '1') {
                            ?>
                            <a class="tile wide imagetext bg-color-darken" href="#">
                                <div class="image-wrapper">
                                    <img src="attachments/<?php echo $config[86][1] ?>" border="0" alt=""/>
                                </div>
                                <br>
        <?php if ($config[50][1] == '1') { ?>
                                    <div class="column-text">
                                        <div class="text"><?php echo $config[0][1] ?></div><br />
                                    </div>
                                <?php } ?>
                                <br>
        <?php if ($config[7][1] == '1') { ?>
                                    <div class="column-text">
                                        <div class="text4"><?php echo $config[11][1] ?></div>
                                    </div>
                                <?php } ?>
                                <br>
        <?php if ($config[15][1] == '1') { ?>
                                    <div class="column-text">
                                        <div class="text4"><?php echo $config[12][1] ?></div>
                                    </div>
                            <?php } ?>
                            </a>
                            <?php
                        }

                        include("extratiles.php");
                        ?>

                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php
}
?>