<?php
require( 'inc/db.php' );
include( 'inc/functions.php' );

$chatsQuery  =   $db->prepare("SELECT `id`,`title`,`chat_desc` FROM chats ORDER BY `last_message` DESC LIMIT 8");
$chatsQuery->execute();
$chatsRow =   $chatsQuery->fetchAll();
$emoticonsQuery =   $db->prepare("SELECT * FROM emotes");
$emoticonsQuery->execute();
$emoticonsRow   =   $emoticonsQuery->fetchAll();

include( 'inc/header.inc.php' );
?>
<script>
    var searchResults   =   <?php echo json_encode($chatsRow); ?>;
    var chat_room_id    =   0;
    var emotes          =   <?php echo json_encode($emoticonsRow); ?>;
    var fonts           =   <?php echo json_encode($fontFamilyArr); ?>;
</script>
<div class="container" style="background-color: #fff;padding-top: 10px;">
    <div ui-view></div>
</div>

<?php

include( 'inc/footer.inc.php' );

?>