<?php
include("postget.php");
checklevel(1, $_REQUEST['clientid']);
?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="metro span12">
            <div class="metro-sections">

                <div id="section1" class="metro-section tile-span-r">
<?php
if (substr($config[68][1], 2, 1) == '1') {
    $link = "announcements.php";
    $cuantas = query("SELECT id FROM hd_announcements WHERE langs LIKE '%".$currentlang."%'", 2);
    $query = "SELECT comment FROM hd_announcements WHERE status=1 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], 2, 1) == '1') {
    $link = "tickets.php";
    $cuantas = query("SELECT ticketid FROM hd_tickets WHERE clientid=" . $_SESSION['hd_clientid'] . " AND status < 4", 2);
    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>
                     <div class="app-count">' . $cuantas . '</div>
                  </a>
		';
}


if (substr($config[67][1], 2, 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>
		';
}


if (substr($config[71][1], 2, 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>
		';
}


if (substr($config[69][1], 2, 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>
		';
}

if (substr($config[65][1], 2, 1) == '1') {
    $link = "contactus.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>