<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
if (!defined('MODULE_FILE') && defined('ADMIN_ALLOW')) {
	die ("Access Denied");
}

global $cid, $pid, $admin_file;
$module_name = "Content";
echo "<center><b>$module_name "._ADMINPANEL."</b><br /><br />";
if (isset($cid)) {
	$sql = "SELECT `title` FROM `".TABLE_PAGES_CATEGORIES."` WHERE `cid`='$cid'";
       if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(CORE_ERROR, 'Could not obtain _pages_categories', '', __LINE__, __FILE__, $sql);}
	$row = $GLOBALS['db']->sql_fetchrow($result);
	echo ""._CATEGORY.": <b>$row[title]</b><br /><br />[ <a href='".$admin_file.".php?op=edit_category&cid=$cid'>"._EDIT."</a> | <a href='".$admin_file.".php?op=del_content_cat&cid=$cid&ok=0'>"._DELETE."</a> ]";
}
if (isset($pid)) {
	$sql = "SELECT `title`, `active` FROM `".TABLE_PAGES."` WHERE `pid`='$pid'";
       if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(CORE_ERROR, 'Could not obtain _pages', '', __LINE__, __FILE__, $sql);}
	$row = $GLOBALS['db']->sql_fetchrow($result);
	br('2');
	echo ""._ARTICLE.": <b>$row[title]</b><br /><br />[ <a href='".$admin_file.".php?op=content_edit&pid=$pid'>"._EDIT."</a> | ";
	if ($row['active'] == 1) {
		echo "<a href='".$admin_file.".php?op=content_change_status&pid=$pid&active=1'>"._DEACTIVATE."</a> | ";
	} elseif ($row['active'] == 0) {
		echo "<a href='".$admin_file.".php?op=content_change_status&pid=$pid&active=0'>"._ACTIVATE."</a> | ";
	}
	echo "<a href='".$admin_file.".php?op=content_delete&pid=$pid&ok=0'>"._DELETE."</a> ]";
}
echo "</center>";