Example #1
0
        <div class="span6">
            <h1>Explore the Dictionary</h1>
            <h3>Most Viewed Items</h3>
            <ul>
                <?php 
//open DB
include dirname(__FILE__) . '/include/dbconnopen.php';
$most_viewed_results = mysqli_query($cnnCDD, "Call Main_Most_Viewed()");
//close DB
include dirname(__FILE__) . '/include/dbconnclose.php';
?>
               <?php 
while ($result_element = mysqli_fetch_assoc($most_viewed_results)) {
    //if element is a database
    if ($result_element['Element_Type'] == 'Database') {
        $database = Database::get_database_info($result_element['Element_ID']);
        ?>
                        <li><a href="database_info.php?database_id=<?php 
        echo $database['Database_ID'];
        ?>
"><i class="icon-th-large"></i> <?php 
        echo $database['Database_Name'];
        ?>
</a> (database)</li>
                        <?php 
    } else {
        if ($result_element['Element_Type'] == 'Table') {
            $table = Table::get_table_info($result_element['Element_ID']);
            ?>
                        <li><a href="table_info.php?table_id=<?php 
            echo $table['Table_ID'];
Example #2
0
<?php

include 'classes/database.php';
include 'classes/business_function.php';
include 'classes/keyword.php';
$database_info = Database::get_database_info($_GET['database_id']);
//if the user is not logged in and the item isn't public
if (!isset($_COOKIE['user_id']) && $database_info['Public'] == '0') {
    header("Location: " . $_SERVER['HTTP_REFERER']);
}
Database::add_view($_GET['database_id']);
//recently viewed link
$recently_viewed_link = '<li><a href="database_info.php?database_id=' . $database_info['Database_ID'] . '"><i class="icon-th-large"></i> ' . $database_info['Database_Name'] . '</a> (database)</li>';
if (stripslashes($_COOKIE['recently_viewed'][0]) != $recently_viewed_link) {
    //add item to recently viewed
    setcookie("recently_viewed[4]", stripslashes($_COOKIE['recently_viewed'][3]));
    setcookie("recently_viewed[3]", stripslashes($_COOKIE['recently_viewed'][2]));
    setcookie("recently_viewed[2]", stripslashes($_COOKIE['recently_viewed'][1]));
    setcookie("recently_viewed[1]", stripslashes($_COOKIE['recently_viewed'][0]));
    setcookie("recently_viewed[0]", $recently_viewed_link);
}
include 'include/header.php';
?>
<br />
<div style="font-weight: bold; font-size: 20px; font-family: arial;">
    Database Detail
</div>
<br />
<div id="database_info_static">
    <table class="table table-striped table-bordered">
        <tr>