function displayPageControl($add = 'edit')
    {
        ?>
		<table style="width:100%">
		<tr>
		<?php 
        if ($add) {
            ?>
		<td><a href="?act=<?php 
            echo $add;
            ?>
"><img src="/img/pic/add_16.gif" title="Добавить" alt="Добавить"/>Добавить</a></td>
		<?php 
        }
        ?>
		<td><?php 
        $this->page->display();
        ?>
</td>
		<td style="text-align:right">Показать:<?php 
        $this->page->displayPageSize($this->cfg('PAGE_SIZE_SELECT'), $this->pageSize);
        ?>
</td>
		</tr>
		</table>
		<?php 
    }
Example #2
0
 protected function page($_total)
 {
     $page = new Page($_total);
     $this->model->limit = $page->limit;
     $this->smarty->assign("num", $page->listRowsBegin());
     $this->smarty->assign("page", $page->display());
 }
 public static function displayErrorPage($type, $msg = "")
 {
     $page = new Page(PageManager::$smarty, "pages/bigMessage.tpl");
     switch ($type) {
         case "access":
             $page->assign("page", "Access denied");
             $page->assign("message", Reporting::error("You dont have access to display this page."));
             break;
         case "error":
             $page->assign("page", "An error occured.");
             $page->assign("message", Reporting::error($msg));
             break;
         case "404":
             $page->assign("page", "Page not found");
             $page->assign("message", Reporting::error("The requests page you are looking for, wasn't found in our System. Sorry :("));
             break;
         default:
             $page->assign("page", "Error Occured");
             $page->assign("message", Reporting::error("And undefined error occured. Please try to reload the page or contact the system administrator."));
             break;
     }
     if (isset($_SERVER['HTTP_REFERER'])) {
         $page->assign("referrer", $_SERVER['HTTP_REFERER']);
     }
     $page->display();
 }
 private function show()
 {
     $this->showNav();
     //Tools::dump($_GET);
     $article = new articleModel();
     $nav = new navModel();
     if ($_GET['name'] && !empty($_GET['name'])) {
         $nav->name = $_GET['name'];
         $oneNav = $nav->getNavByName();
         $this->smarty->assign("oneNav", $oneNav[0]);
         $article->nid = $oneNav[0]->id;
         $page = new Page($article->getArticleByNIDTotal(), 10);
         $article->limit = $page->limit;
         $articles = $article->getArticleByNID();
         //Tools::dump($articles);
         $this->smarty->assign("page", $page->display());
         $this->smarty->assign("articles", $articles);
         $this->smarty->assign("father", $_GET['father']);
         $this->smarty->assign("fid", $_GET['fid']);
     } else {
         header("Location:index.php");
     }
 }
Example #5
0
                        } else {
                            if (!is_numeric($sid)) {
                                $errors[] = "Es wurde eine ungültige Server-ID angegeben.";
                            } else {
                                if (!PhysicalServerManager::existsById($sid)) {
                                    $errors[] = "Die angegebene Server-ID existiert nicht.";
                                }
                            }
                        }
                        if (count($errors) == 0) {
                            $server = new PhysicalServer($sid);
                            $page->assign("t_Report", Reporting::success("Der Server \"" . $server->getData("name") . "\" wird demnächst aktualisiert. (Task geplant)"));
                            $server->addTask(TASK_SERVER_UPDATE);
                            //header("Location: " . Core::GetConfig("dirRoot") . "Server");
                        } else {
                            $page->assign("t_Report", Reporting::error(Utils::buildErrorString($errors)));
                        }
                    }
                }
            }
        }
    }
}
$sc = PhysicalServerManager::getCount();
$smarty->assign("servercount", $sc);
$smarty->assign("physicalServerStates", $physicalServerStates);
if ($sc != 0) {
    $smarty->assign("serverArrayData", PhysicalServerManager::getAllPhysicalServer());
}
$page->display();
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
include "../core.php";
// Admin Check
$user = UserManager::getLocalUser();
if (!$user->isAdmin()) {
    PageManager::displayErrorPage("access");
    return;
}
$userid = isset($_GET['userid']) ? $_GET['userid'] : null;
if ($userid != null) {
    if (UserManager::existsById($userid)) {
        $user = new User($userid);
        $page = new Page($smarty, "modals/CustomerRemove.tpl");
        if ($user->getData("gameServerCount") == 0) {
            $page->assign("u", $user);
        } else {
            $page->assign("t_Report", Reporting::Error("This customer cannot be deleted because still has gameservers. They have to be deleted manually."));
        }
        $page->display();
    } else {
        $p = new Page($smarty, "modals/DefaultError.tpl");
        $p->display();
    }
} else {
    $p = new Page($smarty, "modals/DefaultError.tpl");
    $p->display();
}
Example #7
0
 public function _remap($model)
 {
     global $admin, $ci, $page;
     $this->benchmark->mark('page_setup_start');
     if (!defined('BLOG')) {
         define('BLOG', '');
     }
     define('BASE_URL', $this->config->base_url());
     $this->poster = md5(BASE_URL);
     $this->model = $model;
     $ci = $this;
     // $ci =& get_instance(); doesn't cut it so ...
     $errors = '';
     do {
         $errors .= ob_get_clean();
     } while (ob_get_level());
     ob_start();
     session_cache_limiter('');
     // turn off automatic sending of cache headers
     if ($this->model == '#cache#') {
         $file = func_get_arg(1);
         $type = array_pop($file);
         $this->load->driver('resources');
         return $this->resources->deliverer->view(implode('/', $file), $type);
     }
     $admin = array_merge(array('name' => '', 'email' => '', 'password' => '', 'folder' => ''), (array) $admin);
     define('ADMIN', !empty($admin['folder']) ? trim($admin['folder'], '/') . '/' : 'admin/');
     $uri = $this->uri->uri_string();
     $bp_admin = strpos($uri . '/', ADMIN) === 0 ? isset($admin['function']) ? $admin['function'] : true : false;
     if (!$bp_admin && $this->poster != $this->model) {
         $uri = str_replace('_', '-', $uri);
     }
     $paths = array();
     foreach (explode('/', $uri) as $value) {
         if (($extension = strpos($value, '.')) !== false) {
             $value = substr($value, 0, $extension);
         }
         // remove file extensions
         if (!empty($value)) {
             $paths[] = $value;
         }
         // remove empty "folders"
     }
     $paths = array_diff($paths, array('index'));
     // remove any reference to 'index'
     $type = pathinfo($uri, PATHINFO_EXTENSION);
     if (!empty($type) && in_array($type, array('xml', 'txt', 'less'))) {
         $desired_url = $this->config->base_url(implode('/', $paths) . '.' . $type);
     } else {
         $desired_url = $this->config->site_url($paths) . strstr($_SERVER['REQUEST_URI'], '?');
     }
     $actual_url = (is_https() ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     if ($desired_url != $actual_url) {
         header('Location: ' . $desired_url, true, 301);
         exit;
     }
     $this->load->driver('session');
     $this->load->library('sitemap');
     if ($html = $this->sitemap->cached()) {
         $this->benchmark->mark('page_setup_end');
         $this->benchmark->mark('page_display_start');
     } else {
         require_once BASE . 'Page.php';
         $page = new Page();
         $this->benchmark->mark('page_setup_end');
         $this->benchmark->mark('page_content_start');
         if ($this->model == $this->poster) {
             $this->delay_flashdata();
             $this->log_analytics('users');
             $image = base64_decode('R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
             header('Expires: Fri, 01 Jan 1990 00:00:00 GMT');
             header('Cache-Control: max-age=0, must-revalidate');
             header('Content-Length: ' . strlen($image));
             header('Content-Type: image/gif');
             header('Pragma: no-cache');
             exit($image);
         } elseif ($template = $this->input->post($this->poster)) {
             $this->delay_flashdata();
             $data = array();
             $file = BASE_URI . 'blog/content/post.tpl';
             if (is_file($file)) {
                 $this->load->driver('blog', array('role' => '#post#'));
                 $this->blog->resources(BASE_URL . 'blog/content/');
                 $this->load->library('auth');
                 $vars = array('template' => $template, 'user' => $this->auth->user(), 'uri' => array('id' => $this->sitemap->uri('id'), 'type' => $this->sitemap->uri('type'), 'views' => $this->sitemap->uri('views')));
                 $this->blog->smarty($file, $vars);
                 $data = $this->compile($page->post);
             }
             $data = json_encode($this->filter_links($data));
             header('Content-Type: application/json');
             header('Content-Length: ' . strlen($data));
             exit($data);
         } elseif ($this->model == '#sitemap#') {
             $params = func_get_arg(1);
             $method = array_shift($params);
             // Either 'robots' or 'xml'
             $html = $this->sitemap->{$method}(array_shift($params));
         } else {
             if ($bp_admin) {
                 $this->load->driver('blog', array('role' => '#admin#'));
                 if (is_callable($bp_admin)) {
                     $html = $bp_admin();
                 } elseif ($route = $page->routes(array(ADMIN, ADMIN . '[blog:view]/[published|unpublished|posts|pages' . (is_admin(1) ? '|authors|categories|tags|templates|backup|restore' : null) . ':folder]?', ADMIN . '[sitemap' . (is_admin(1) ? '|setup|errors|plugins|folders|databases' : null) . ':view]', ADMIN . '[users:view]/[logout' . (is_admin(1) ? '|register|edit|list' : null) . ':action]?', ADMIN . '[themes:view]/[download|preview:action]?/[:theme]?/[bootstrap\\.less:less]?', ADMIN . '[analytics:view]/[users|pages|referrers:method]?'))) {
                     if (!isset($route['params']['view'])) {
                         $page->eject(ADMIN . 'blog');
                     }
                     $view = $route['params']['view'];
                     $this->load->driver('admin', array('file' => $view));
                     $html = $this->admin->{$view}->view($route['params']);
                 } else {
                     $page->eject(BASE_URL . ADMIN . 'users');
                 }
             } elseif ($folder = $page->folder(BASE_URI . 'folders/')) {
                 $this->load->driver('blog', array('role' => '#folder#'));
                 $html = $page->outreach($folder . 'index.php', array('folder' => array('name' => trim(str_replace(BASE_URI . 'folders', '', $folder), '/'), 'url' => str_replace(BASE_URI, BASE_URL, $folder), 'uri' => $folder)));
             } else {
                 $this->load->driver('blog', array('role' => '#blog#'));
                 if ($file = $this->blog->file($page->get('uri'))) {
                     $html = $this->blog->pages->post($file);
                 } elseif ($route = $page->routes(array(BLOG, BLOG . '/[atom|rss:method].xml', BLOG . '/[archives:method]/[i:year]?/[i:month]?/[i:day]?', BLOG . '/[authors|tags:method]/[:uri]?', BLOG . '/[**:method]' => 'category'))) {
                     $method = isset($route['params']['method']) ? $route['params']['method'] : ($this->input->get('search') ? 'search' : 'index');
                     if ($route['target'] == 'category') {
                         $method = 'category';
                         $route['params'] = array_shift($route['params']);
                         if (!is_dir($this->blog->post . $route['params'])) {
                             show_404($page->url());
                         }
                     }
                     $html = $this->blog->pages->{$method}($route['params']);
                 } else {
                     show_404($page->url());
                 }
             }
         }
         $this->benchmark->mark('page_content_end');
         $this->benchmark->mark('page_display_start');
         if ($page->get('type') == 'html') {
             $html = $this->layout($html);
             do {
                 $errors .= ob_get_clean();
             } while (ob_get_level());
             $html = $this->filter_links($page->display($html . $errors));
         }
         if ($this->output->get_content_type() == 'text/html') {
             $this->output->set_content_type($page->get('type'));
         }
         if (trim($errors) == '') {
             $this->sitemap->update($html);
         }
     }
     $this->log_analytics('hits');
     if ($this->session->enable_profiler && $this->output->get_content_type() == 'text/html' && $bp_admin === false) {
         $this->output->enable_profiler(true);
     } elseif (trim($errors) == '') {
         $this->sitemap->may_change();
     }
     do {
         $errors .= ob_get_clean();
     } while (ob_get_level());
     // for compression's sake
     $this->load->view('view', array('html' => $html));
     $this->benchmark->mark('page_display_end');
 }
Example #8
0
error_reporting(E_ALL);
ini_set('display_errors', 'On');
function __autoload($class)
{
    if (file_exists("classes/{$class}.class.php")) {
        include "classes/{$class}.class.php";
    } else {
        include "../classes/{$class}.class.php";
    }
}
include "../config.php";
if (!isset($_SERVER['PHP_AUTH_USER']) || !($_SERVER['PHP_AUTH_USER'] == ADMIN_USER && $_SERVER['PHP_AUTH_PW'] == ADMIN_PASS)) {
    header('WWW-Authenticate: Basic realm="Logowanie"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Dostep ograniczony';
    exit;
}
$Page = new Page();
$cmd = @$_REQUEST["cmd"];
switch ($cmd) {
    default:
    case "kostiumy":
        $Page->setContent(new AdminKostiumy());
        break;
    case "grupy":
        $Page->setContent(new AdminGrupy());
        break;
}
include "tpl/header.php";
$Page->display();
include "tpl/footer.php";
Example #9
0
<?php

include 'showFolderItems.php';
include 'userinfo.php';
include 'uploader.php';
session_start();
$userpage = new Page($_SESSION['id'], $_SESSION['username'], $_SESSION['email'], $_SESSION['folder']);
$userpage->display();
class Page
{
    //still empty variable
    //mporei na xrisimopieithei sto melon gia perasma epipleon periexomeno
    public $content;
    private $userinfo;
    public $path;
    function __construct($id, $username, $email, $folder)
    {
        $this->userinfo = new userinfo($id, $username, $email, $folder);
        $_SESSION['user'] = serialize($this->userinfo);
    }
    /**
     * display the user page
     * i vasiki methodos pou ftaxnei dinamika tin selida
     */
    function display()
    {
        if (!empty(@$_SESSION["id"])) {
            session_start();
            $this->Init();
            if ($_SESSION['path'] != $this->userinfo->getCurrentPath()) {
                //afto simvenei mono meta to delete giati kaleite i usermainpage kai kanei neo userinfo pou exei to default path mesa
function display($path, $variables = array())
{
    return Page::display($path, $variables);
}
Example #11
0
 private function show()
 {
     //Tools::dump($this->model->getAllUser());
     $page = new Page($this->model->getAllUserTotal(), 5);
     $this->model->limit = $page->limit;
     $this->smarty->assign("num", $page->listRowsBegin());
     $this->smarty->assign("page", $page->display());
     $data = $this->model->getAllUser();
     foreach ($data as $key => $value) {
         switch ($value->state) {
             case 0:
                 $value->state = "<span style='color:red;'>[否]</span>\r\n\t\t\t\t\t\t\t<a href='?a=user&action=state&flag=show&id=" . $value->id . "'>通过</a>";
                 break;
             case 1:
                 $value->state = "<span style='color:green;'>[是]</span>\r\n\t\t\t\t\t\t\t<a href='?a=user&action=state&flag=hide&id=" . $value->id . "'>否决</a>\t";
         }
     }
     $this->smarty->assign('data', $data);
     $this->smarty->assign("show", true);
 }
Example #12
0
 public function display($content, $title, Page $page)
 {
     include $this->header;
     $page->display($content);
     include $this->footer;
 }
Example #13
0
 function display()
 {
     $this->setContents(PAGE_DEFAULT_REGION, $this->_smarty->fetch($this->_template));
     parent::display();
 }
Example #14
0
 /**
  * Display the selected template with the given data and customization
  * @return void
  */
 public function display()
 {
     if (count($this->dependents)) {
         $this->addJavascript($this->createDependentJavascript());
     }
     $this->assign('data', $this->Row->data);
     $this->assign('dependents', $this->dependents);
     $this->assign('fields', $this->fields);
     $this->assign('links', $this->links);
     $this->assign('general_actions', $this->general_actions);
     parent::display();
 }
 private function showCourse()
 {
     $course = new courseModel();
     $page = new Page($course->getAllCourseTotal(), 5);
     $course->limit = $page->limit;
     $allCourse = $course->getAllCourse();
     foreach ($allCourse as $key => $value) {
         switch ($value->state) {
             case 0:
                 $value->state = "<span style='color:red;'>[否]</span>\r\n\t\t\t\t\t\t\t<a href='?a=learning&action=state&flag=show&id=" . $value->id . "'>显示</a>";
                 break;
             case 1:
                 $value->state = "<span style='color:green;'>[是]</span>\r\n\t\t\t\t\t\t\t<a href='?a=learning&action=state&flag=hide&id=" . $value->id . "'>隐藏</a>\t";
         }
     }
     $this->course();
     //Tools::dump($allCourse);
     $this->smarty->assign("num", $page->listRowsBegin());
     $this->smarty->assign("page", $page->display());
     $this->smarty->assign("data", $allCourse);
     $this->smarty->assign("showCourse", true);
 }