Example #1
0
<?php

require '../include/common.inc.php';
include ROOT . '/include/init.inc.php';
require ROOT . '/classes/modelmgr/GeneralTextXmlModel.cls.php';
$action = $_REQUEST["action"];
$model = new GeneralTextXmlModel("general.php");
$smarty->assign("MyModule", "website");
if ($action == "") {
    $smarty->assign("MyMenuId", "general_list");
    $model->ShowList($dbmgr, $smarty);
} else {
    if ($action == "search") {
        $model->ShowSearchResult($dbmgr, $smarty, $_REQUEST);
    } else {
        if ($action == "add") {
            if ($SysUser["is_admin"] != "Y") {
                echo "System Error";
                exit;
            }
            $smarty->assign("MyMenuId", "general_add");
            $model->Add($dbmgr, $smarty);
        } else {
            if ($action == "edit") {
                $smarty->assign("MyMenuId", "general_add");
                $model->Edit($dbmgr, $smarty, $_REQUEST["id"]);
            } else {
                if ($action == "save") {
                    if ($_REQUEST["primary_id"] == "" && $SysUser["is_admin"] != "Y") {
                        echo "System Error";
                        exit;
Example #2
0
<?php

require '../include/common.inc.php';
include ROOT . '/include/init.inc.php';
require ROOT . '/classes/modelmgr/GeneralTextXmlModel.cls.php';
$action = $_REQUEST["action"];
$model = new GeneralTextXmlModel("general.php");
$smarty->assign("MyModule", "website");
$model->DefaultShow($smarty, $dbmgr, $action, "general", $_REQUEST);