Esempio n. 1
0
function mcurrent_category($selector=null) {

	$zones = get_zones();

	$a = array();

	foreach( $zones AS $z=>$o ) {

		$a['/manage/category/index.php?zone='.$z] = $o;

	}

	$l = "/manage/category/index.php?zone={$selector}";

	return current_link($l,$a,true);

}
Esempio n. 2
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
$condition = array();
($zone = strval($_GET['zone'])) || ($zone = 'city');
if ($zone) {
    $condition['zone'] = $zone;
}
$cates = get_zones();
$count = Table::Count('category', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$categories = DB::LimitQuery('category', array('condition' => $condition, 'order' => 'ORDER BY display ASC, sort_order DESC, id DESC', 'size' => $pagesize, 'offset' => $offset));
include template('manage_category_index');
Esempio n. 3
0
     $breadcrumbs .= " >> " . "<a href='index.php?editor=server&action=16'>" . "Rules</a> >> Add Ruleset";
     $body = new Template("templates/server/ruleset.add.tmpl.php");
     $body->set('suggestruleid', suggest_ruleset_id());
     break;
 case 31:
     // Add Ruleset
     check_admin_authorization();
     add_ruleset();
     header("Location: index.php?editor=server&action=27");
     exit;
 case 32:
     // View Zones
     check_admin_authorization();
     $breadcrumbs .= " >> Zone Launcher Setup";
     $body = new Template("templates/server/zones.tmpl.php");
     $zones = get_zones();
     if ($zones) {
         foreach ($zones as $key => $value) {
             $body->set($key, $value);
         }
     }
     $launchers = get_launchers();
     if ($launchers) {
         foreach ($launchers as $key => $value) {
             $body->set($key, $value);
         }
     }
     break;
 case 33:
     // Edit Zone
     check_admin_authorization();
Esempio n. 4
0
     }
 } elseif ('categoryedit' == $action) {
     need_auth('admin');
     if ($id) {
         $category = Table::Fetch('category', $id);
         if (!$category) {
             json('无数据', 'alert');
         }
         $zone = $category['zone'];
     } else {
         $zone = strval($_GET['zone']);
     }
     if (!$zone) {
         json('请确定分类', 'alert');
     }
     $zone = get_zones($zone);
     $html = render('manage_ajax_dialog_categoryedit');
     json($html, 'dialog');
 } elseif ('categoryremove' == $action) {
     need_auth('admin');
     $category = Table::Fetch('category', $id);
     if (!$category) {
         json('无此分类', 'alert');
     }
     if ($category['zone'] == 'city') {
         $tcount = Table::Count('team', array('city_id' => $id));
         if ($tcount) {
             json('本类下存在团购项目', 'alert');
         }
     } elseif ($category['zone'] == 'group') {
         $tcount = Table::Count('team', array('group_id' => $id));
        $zones = $_POST['zone'];
        if (delete_user($uid, $zones)) {
            success(SUC_USER_DEL);
        }
    } else {
        header("Location: users.php");
        exit;
    }
} else {
    if ($uid != $_SESSION['userid'] && $perm_edit_others == "0" || $uid == $_SESSION['userid'] && $perm_is_godlike == "0") {
        error(ERR_PERM_DEL_USER);
        include_once "inc/footer.inc.php";
        exit;
    } else {
        $fullname = get_fullname_from_userid($uid);
        $zones = get_zones("own", $uid);
        echo "     <h2>" . _('Delete user') . " \"" . $fullname . "\"</h2>\n";
        echo "     <form method=\"post\" action=\"\">\n";
        echo "      <table>\n";
        if (count($zones) > 0) {
            $users = show_users();
            echo "       <tr>\n";
            echo "        <td colspan=\"5\">\n";
            echo "         " . _('You are about to delete a user. This user is owner for a number of zones. Please decide what to do with these zones.') . "\n";
            echo "        </td>\n";
            echo "       </tr>\n";
            echo "       <tr>\n";
            echo "        <th>" . _('Zone') . "</th>\n";
            echo "        <th>" . _('Delete') . "</th>\n";
            echo "        <th>" . _('Leave') . "</th>\n";
            echo "        <th>" . _('Add new owner') . "</th>\n";
 echo "       <th>&nbsp;</th>\n";
 echo "       <th>&nbsp;</th>\n";
 echo "       <th><a href=\"list_zones.php?zone_sort_by=name\">" . _('Name') . "</a></th>\n";
 echo "       <th><a href=\"list_zones.php?zone_sort_by=type\">" . _('Type') . "</a></th>\n";
 echo "       <th><a href=\"list_zones.php?zone_sort_by=count_records\">" . _('Records') . "</a></th>\n";
 echo "       <th>" . _('Owner') . "</th>\n";
 if ($iface_zonelist_serial) {
     echo "       <th>" . _('Serial') . "</th>\n";
 }
 echo "      </tr>\n";
 if ($count_zones_view <= $iface_rowamount) {
     $zones = get_zones($perm_view, $_SESSION['userid'], "all", ROWSTART, $iface_rowamount, $zone_sort_by);
 } elseif (LETTERSTART == 'all') {
     $zones = get_zones($perm_view, $_SESSION['userid'], "all", ROWSTART, 'all', $zone_sort_by);
 } else {
     $zones = get_zones($perm_view, $_SESSION['userid'], LETTERSTART, ROWSTART, $iface_rowamount, $zone_sort_by);
     $count_zones_shown = $zones == -1 ? 0 : count($zones);
 }
 foreach ($zones as $zone) {
     if ($zone['count_records'] == NULL) {
         $zone['count_records'] = 0;
     }
     $zone_owners = get_fullnames_owners_from_domainid($zone['id']);
     if ($iface_zonelist_serial) {
         $serial = get_serial_by_zid($zone['id']);
     }
     if ($perm_edit != "all" || $perm_edit != "none") {
         $user_is_zone_owner = verify_user_is_owner_zoneid($zone["id"]);
     }
     echo "         <tr>\n";
     echo "          <td class=\"checkbox\">\n";
Esempio n. 7
0
        exit;
    case 4:
        // Delete Player
        check_admin_authorization();
        delete_player($playerid);
        if (isset($_GET['acctid'])) {
            header("Location: index.php?editor=account&acctid={$acctid}");
        } else {
            header("Location: index.php?editor=player");
        }
        exit;
    case 5:
        // Edit Player Location
        check_admin_authorization();
        $cur_loc = get_player_location();
        $zonelist = get_zones();
        $body = new Template("templates/player/player.move.tmpl.php");
        $javascript = new Template("templates/player/js.tmpl.php");
        $body->set('playerid', $playerid);
        $body->set('cur_loc', $cur_loc);
        $body->set('zonelist', $zonelist);
        break;
    case 6:
        // Update Player Location
        check_admin_authorization();
        update_player_location();
        header("Location: index.php?editor=player&playerid={$playerid}");
        exit;
}
function get_players($page_number, $results_per_page, $sort_by)
{