<?php
    $pageTitle = "Social";
    require_once('common/header.php');

    //Select the table from which the content is fetched from
    $socialTable = new Table("cmsgen_galleries");
    $allItems = $socialTable->findAll();
?>
    <?php foreach($allItems as $item) : ?>

    <div <?php echo $socialTable->getLiveEditAttr($item['id']); ?>>
        Profile: <b><?php echo $item['name']; ?></b><br>
        Country: <b><?php echo $item['description']; ?></b><br>

    </div>

    <?php endforeach ; ?>

<?php
    if($isLoggedIn) :
    //Admin is logged in
?>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
 <script type="text/javascript" src="<?php echo PUBLIC_HTML_SITE.DS; ?>js/jqueryui-dialog.js"></script>
 <script type="text/javascript" src="<?php echo PUBLIC_HTML_SITE.DS; ?>js/livequery.js"></script>

<div id="liveEditContainer" class="round drop_shadow">
<a style="font-size:8px;" class="closeButton drop_shadow round" href="javascript:close()">CLOSE</a>
 <div id="generatedForm">LOADING....</div>
</div>
<script type="text/javascript">
$('body').find('[itemId]').livequery(function(){
             $(this).each(function(index){
                    var id = $(this).attr('itemId');
                    var table = $(this).attr('table');
                    $(this).addClass('editable');
                    $(this).append('<a class="editButton drop_shadow round" href="javascript:void(0)" onclick="javascript:edit('+id+','+"'"+table+"'"+')">EDIT</a>');
            });
});

    </script>

    <script type="text/javascript" src="<?php echo ADMIN_PATH_HTML;?>/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
     <script type="text/javascript" src="<?php echo ADMIN_PATH_HTML;?>/js/actions.js"></script>
    <?php endif; ?>
</body>
</html>