<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2013 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: cookie_info.php
| Version: 2.00
| Author: PHP-Fusion Mods UK
| Developers: Craig
| Sites: http://www.phpfusionmods.co.uk
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES."templates/header.php";

if (file_exists(INFUSIONS."cookie_control/locale/".$settings['locale'].".php")) {
include INFUSIONS."cookie_control/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."cookie_control/locale/English.php";
}

include INFUSIONS."cookie_control/infusion_db.php";

require_once INCLUDES."bbcode_include.php";

add_to_title($locale['global_200'].$locale['ecdp_026']);

$cookie_control_settings = dbarray(dbquery("SELECT * FROM ".DB_COOKIE_SETTINGS));

if ($cookie_control_settings['cc_enable'] !== "1") { redirect(BASEDIR."index.php"); }

global $settings;

opentable($locale['ecdp_026']);

echo "<span style='font-size: 12px; font-weight:'>".$settings['sitename'].$locale['ecdp_027']."</span>";

        $i = 0;

        $row_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
		
		echo "<table cellpadding='0' cellspacing='1' width='80%' class='tbl-border center'>\n<tr>\n";
		echo "<td class='tbl2'><strong>".$locale['ecdp_063']."</strong></td>\n";
		echo "<td class='tbl2' width='50%'><strong>".$locale['ecdp_015']."</strong></td>\n";
		echo "<td class='tbl2' width='25%'><strong>".$locale['ecdp_006']."</strong></td>\n";
		echo "</tr>\n";
		
		$rows = dbcount("(cookie_id)", DB_COOKIE_CONTROL);

		if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }

		if ($rows != 0) {

		$result = dbquery("SELECT * FROM ".DB_COOKIE_CONTROL." ORDER BY cookie_id DESC LIMIT ".$_GET['rowstart'].",20");

		while ($data = dbarray($result)) {
        $desc = nl2br(parseubb($data['cookie_desc'], "color|b|i|u|small|url"));
		echo "<tr>\n";
		echo "<td class='$row_color'><span style='color: #ff0000;'>".$data['cookie_cookie']."</span>";
		if ($data['cookie_default'] == 1) { echo "<span style='color: #157707;'>".COOKIE_PREFIX."lastvisit</span>";}
		elseif ($data['cookie_default'] == 2) { echo "<span style='color: #157707;'>".COOKIE_PREFIX."user</span>"; }
		elseif ($data['cookie_default'] == 3) { echo "<span style='color: #157707;'>".COOKIE_PREFIX."admin</span>"; }
		elseif ($data['cookie_default'] == 4) { echo "<span style='color: #157707;'>fusion_box"; }
		elseif ($data['cookie_default'] == 5) { echo "<span style='color: #157707;'>".COOKIE_PREFIX."visited</span>"; }
		elseif ($data['cookie_default'] == 6) { echo "<span style='font-weight:bold; color: #157707;'>".COOKIE_PREFIX."cookie_control</span>"; }
		echo"</td>";
		echo "<td class='$row_color'>".$desc."</td>\n";
		echo "<td class='$row_color'>";
		if ($data['cookie_usage'] == 1) { echo $locale['ecdp_008'];}
		elseif ($data['cookie_usage'] == 2) { echo $locale['ecdp_009']; }
		elseif ($data['cookie_usage'] == 3) { echo $locale['ecdp_010']; }
		elseif ($data['cookie_usage'] == 4) { echo $locale['ecdp_011']; }
		elseif ($data['cookie_usage'] == 5) { echo $locale['ecdp_012']; }
		elseif ($data['cookie_usage'] == 6) { echo $locale['ecdp_013']; }
		elseif ($data['cookie_usage'] == 7) { echo $locale['ecdp_014']; }
		elseif ($data['cookie_usage'] == 8) { echo $locale['ecdp_062']; }
		else{ echo $locale['ecdp_007']; }
		echo"</td>\n";
		echo "</tr>\n";
			}
		echo "</table>\n";
		} else {
		echo "</table>\n";
		}
		echo" <br /><br />".$locale['ecdp_028'].(stripinput($cookie_control_settings['cc_position']==1?"".$locale['ecdp_047']."":"".$locale['ecdp_048']."")).$locale['ecdp_028b'];

		if (($rows) > 20) { echo "<div align='center' style='margin-top:5px;'>\n".makepagenav($_GET['rowstart'],20,$rows,3,FUSION_SELF.$aidlink."&amp;")."\n</div>\n"; }
	 
	 // Please do not remove copyright info
 include INFUSIONS."cookie_control/includes/copyright_func.php";
 echo showccocopyright();
// End copyright info

closetable();

require_once THEMES."templates/footer.php";

?>