Esempio n. 1
0
<?php

include_once "include/template.class.php";
include_once "include/admin.class.php";
$template = new DxTemplate();
$section = new Admin();
@($action = intval($_GET['action']));
print $template->Head("Administration Page");
print $template->includeCSS("template/Default/style.tmp");
print $template->includeJS("include/menu.js");
print $template->openBody(0);
print '<center>';
print $template->openDiv("header");
print $template->closeDiv();
print $template->setMenu(explode('/', $_SERVER['PHP_SELF']), 4);
print $template->openDiv("body");
print $section->setMenu();
print '<h2 align="center">Administration Pannel Control</h2>';
if ($section->is_admin()) {
    if ($action == 1) {
        print '<form method="POST" action="?action=1">
			<table width="100%" valign="top">
				<tr>
					<td> Name: </td>
					<td> <input type="text" name="name" /> </td>
				</tr>
				<tr>
					<td>Description: </td>
					<td><input type="text" name="description" /> </td>
				</tr>
				<tr /> 
Esempio n. 2
0
    print $template->closeBody();
    if (@$_POST['new'] == 'new_topic') {
        if (isset($_POST['name']) && isset($_POST['text'])) {
            if ($newTopic->is_user()) {
                $newTopic->newTopic($_POST['name'], $_POST['text'], $_POST['id']);
                print "<script> window.location='viewSection.php?id=" . $_POST['id'] . "' </script>";
            } else {
                print "<script> window.location='index.php' </script>";
            }
        } else {
            echo "<script>alert(\"Errore! Inserire Nome e Testo.\"); windows.location=\"viewSection.php\";</script>";
        }
    }
} else {
    include "include/security.php";
    $template = new DxTemplate();
    print $template->Head("viewSection");
    print $template->includeCSS("template/Default/style.tmp");
    print $template->includeJS("include/menu.js");
    print $template->openBody(0);
    print '<center>';
    print $template->openDiv("header");
    print $template->closeDiv();
    print $template->openDiv("body");
    print $template->setMenu(explode('/', $_SERVER['PHP_SELF']), 5);
    $id = protectVar($_GET['id']);
    if (empty($id)) {
        die("<p align='center'>ID non specificato!</p>");
    }
    $template->printTopics($id);
    print $template->closeDiv();