Exemplo n.º 1
0
<?php

$a = loadVariable("a", '');
$v = loadVariable("v", "");
$page_type = loadVariable("page_type", "");
$id = loadVariable("id", "0");
if ($a != '') {
    switch ($a) {
        case "get_link_content":
            echo get_link_content($v);
            break;
        case 'delete':
            delete_row($page_type, $id);
            break;
        case 'status':
            status_change($page_type, $id);
            break;
        default:
            echo "Error";
    }
}
function delete_row($page_type, $id)
{
    if (empty($page_type)) {
        die(json_encode(array("error" => "Page Type not declared!!!")));
    } else {
        //Table information declaration
        $table_info['site menu']['tbl'] = "site_menu";
        $table_info['site menu']['key'] = "menu_id";
        $table_info['site content']['tbl'] = "site_content";
        $table_info['site content']['key'] = "content_id";
Exemplo n.º 2
0
if ($a == "") {
    $a = 'list';
}
$heading = "Add";
if ($a == "edit") {
    $heading = "Edit";
    if ($menu_id != 0) {
        $SQL = "select * from site_menu WHERE menu_id='" . $menu_id . "'";
        $rsAdmin = $objDB->select($SQL);
        if (count($rsAdmin) > 0) {
            $menu_id = $rsAdmin[0]["menu_id"];
            $menu_name = $rsAdmin[0]["menu_name"];
            $parent = $rsAdmin[0]["parent"];
            $description = $rsAdmin[0]["description"];
            $type = $rsAdmin[0]["type"];
            $link_content_opt = get_link_content($type, FALSE);
            $link_content = $rsAdmin[0]["link_content"];
            print_r($link_content);
            $external_link = $rsAdmin[0]["external_link"];
            $menu_order = $rsAdmin[0]["menu_order"];
            $status = $rsAdmin[0]["status"];
        }
    }
}
if ($a == "list") {
    $SQL = "select * from site_menu order by menu_name";
    $rsAdmin = $objDB->select($SQL);
    $numPerPage = 10;
    $iCount = count($rsAdmin);
    $page = loadVariable("page", 1);
    $totalPages = ceil($iCount / $numPerPage);