예제 #1
0
파일: edit.php 프로젝트: evilgeny/bob
<?php

/**
 *	Retriev a list of shops in given area
 * 
 * xmin, ymin, xmax, ymax theese are coordinates of area OR
 * CID 	-	City id
 */
$PROFILER_ENABLED = 0;
$INIT_LIGHT = 0;
$INIT_CONFIG = 1;
$INIT_NO_CS_AUTH = 1;
$USE_POST_PROCESS = 0;
require_once $_SERVER["ROOT_DIR"] . "/init.php";
if (!me()->isAdmin() || isset($_GET['id']) && isNull($net = M('Shop')->loadNetworkById($_GET['id']))) {
    M('Ajax')->cheater();
    exit;
}
try {
    if (!isset($net) || isNull($net)) {
        $net = M('Shop')->createNetwork();
    }
    $net->name = @$_GET['name'];
    $net->save();
    okMessage($net->id());
} catch (RM_Validator_Exception $e) {
    ajaxMessages($e->getResult());
}
예제 #2
0
파일: delete.php 프로젝트: evilgeny/bob
<?php

/**
 *	Retriev a list of shops in given area
 * 
 * xmin, ymin, xmax, ymax theese are coordinates of area OR
 * CID 	-	City id
 */
$PROFILER_ENABLED = 0;
$INIT_LIGHT = 0;
$INIT_CONFIG = 1;
$INIT_NO_CS_AUTH = 1;
$USE_POST_PROCESS = 0;
require_once $_SERVER["ROOT_DIR"] . "/init.php";
if (!me()->isAdmin() || isNull($photo = iterFirst(M('ObjectFs')->getAllFiles()->filter('id=?', $_GET['id'])))) {
    M('Ajax')->cheater();
    exit;
}
try {
    $photo->delete();
    okMessage();
} catch (RM_Validator_Exception $e) {
    ajaxMessages($e->getResult());
}
예제 #3
0
파일: edit.php 프로젝트: evilgeny/bob
 *	Retriev a list of shops in given area
 * 
 * xmin, ymin, xmax, ymax theese are coordinates of area OR
 * CID 	-	City id
 */
$PROFILER_ENABLED = 0;
$INIT_LIGHT = 0;
$INIT_CONFIG = 1;
$INIT_NO_CS_AUTH = 1;
$USE_POST_PROCESS = 0;
require_once $_SERVER["ROOT_DIR"] . "/init.php";
if (!me()->isAdmin() || isNull($shop = M('Shop')->loadShopById(@$_GET['id']))) {
    M('Ajax')->cheater();
    exit;
}
$fields = qw2('shop_net>network_id shop_type>type_id name metro bus_stop 
							phone street bld trade_square working_type parking freebus cass_qty comments ur_address lon>longitude lat>latitude described>described');
foreach ($fields as $k => $v) {
    if (is_integer($k)) {
        $k = $v;
    }
    if (isset($_REQUEST[$k])) {
        $shop->{$v} = $_REQUEST[$k];
    }
}
try {
    $shop->save();
    okMessage($shop->id(), array('unnamed' => $shop->unnamed()));
} catch (RM_Validator_Exception $e) {
    ajaxMessages($e->getResult());
}