| Server IP : 23.111.136.34 / Your IP : 216.73.216.136 Web Server : Apache System : Linux servidor.eurohost.com.br 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : meusitei ( 1072) PHP Version : 5.6.40 Disable Function : show_source, system, shell_exec, passthru, proc_open MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/meusitei/public_html/central/ajuda/ |
Upload File : |
<?php
/******************************************************************************
* Administration <administration.php>
*
* Author: Michael McMullen <michael.mcmullen@tutelagesystems.com>
******************************************************************************/
require_once '../System/configuration.php';
class AdministrationArticlePage extends MasterTemplate
{
var $template = 'admin_article.html';
var $output = array();
function AdministrationArticlePage()
{
// Call the Master Template Constructor
parent::__construct();
// Validate for Administrator
if(! isset($_SESSION['administration']))
{
$this->redirect('login.php');
}
// Add a Crumb
$this->AddBreadCrumb('Welcome', $this->output['webRoot']);
$this->AddBreadCrumb('Administration', 'administration.php');
$this->AddBreadCrumb('Article Management', null);
// Gather Categories
$this->output['articles'] = $this->FetchArticles();
// Render the Template
$this->RenderTemplate();
}
// Renders the index template (called from master)
function outputBody()
{
$body = new HTML_Template_Flexy($this->config['flexy']);
$body->compile($this->template);
$body->outputObject($this);
}
function FetchArticles()
{
$articles = array();
$article_db = DB_DataObject::factory('articles');
$article_db->article_active = 1;
$article_db->orderBy('article_category_id, article_rank, article_name');
$article_db->find();
while($article_db->fetch())
{
$article = $article_db->toArray();
// Look Category
$category_db = DB_DataObject::factory('categories');
$category_db->category_id = $article_db->article_category_id;
$category_db->category_active = 1;
if($category_db->find(true))
{
$article['category'] = $category_db->toArray();
}
else
{
$article['category'] = array(
'category_name' => 'Not Selected',
);
}
$articles[] = $article;
}
return $articles;
}
}
new AdministrationArticlePage();