예제 #1
0
 public static function loadModel()
 {
     if (self::$_model === null) {
         if (isset($_GET['id'])) {
             self::$_model = Zone::model()->findByPk($_GET['id']);
         }
         if (self::$_model === null) {
             throw new CHttpException(404, 'The requested page does not exist.');
         }
     }
     return self::$_model;
 }
예제 #2
0
 /**
  * Returns an array with all the children values
  * getChildren(1) => array(
  *   2 => Galicia,
  *   3 => Andalucia,
  *   4 => Sevilla,
  * )
  */
 public static function getChildren($id)
 {
     $h = array();
     $zone = ZoneService::getZone($id);
     if (isset($zone)) {
         foreach ($zone->children as $child) {
             $h[$child->zid] = $child->name;
         }
     }
     //print "<pre>$id".print_r($h, true)."</pre>";
     return $h;
 }
예제 #3
0
파일: index.php 프로젝트: CHILMEX/amocasion
<?php

$this->pageTitle = Yii::app()->name . " - Zones";
$this->breadcrumbs = array('Zones');
$this->contentTitle = "Zones";
$this->contentMenu = (require '_actionBar.php');
?>

<table><tr>
    <td width="200px">
        <?php 
$this->widget('CTreeView', array('url' => Yii::app()->createUrl("/zone/treeFill", array('selected' => 4)), 'animated' => 'slow'));
?>
    </td><td>
        <div id="zone_view">
            <div id="location">
            <?php 
$this->renderPartial('view', array('model' => ZoneService::getZone($model)));
?>
            </div>
        </div>
    </td>
</tr></table>
예제 #4
0
    echo CHtml::encode($model->email);
}
?>
            <?php 
if (!empty($model->phones)) {
    echo CHtml::encode($model->phones);
}
?>
        </div>
    </div>
    <div class="field">
        <label>Zone</label>
        <div>
            <?php 
$zoneNames = array();
foreach (ZoneService::getParentHierarchy($model->zid) as $zone) {
    if ($zone->zid == 0) {
        continue;
    }
    $zoneNames[] = CHtml::link($zone->name, $this->createUrl("/zone/view", array("id" => $zone->zid)));
}
echo implode(" >> ", $zoneNames);
?>
        </div>
    </div>
    <div class="field" style="position:absolute;bottom: 0px;left: 0px; "> <?php 
// Align to bottom
?>
    <?php 
if (isset($model->lat) && isset($model->lon)) {
    $zoom = isset($model->zoom) ? $model->zoom - 2 : 5;
<?php

require '../base/Config.php';
Config::init();
$service = new ZoneService();
if (isset($_POST["game"]) === false || isset($_POST["type"]) === false || isset($_POST["platform"]) === false) {
    $service->error("zoneinfo", 1);
}
$game = $_POST["game"];
$type = $_POST["type"];
$platform = $_POST["platform"];
if (!is_numeric($game) || !is_numeric($type)) {
    $service->error("zoneinfo", 2);
}
$service->init();
$cache_service = new CacheService();
$cache_service->init();
$file_name = "../bin/cache/zoneinfo_" . $game . "_" . $type . "_" . $platform . ".txt";
$array = $cache_service->getCacheInfo($file_name);
if (null == $array) {
    $array = $service->getZoneInfo($game, $type, $platform);
    if (count($array)) {
        $cache_service->setCacheInfo($file_name, $array);
    }
}
if (count($array)) {
    $service->response(array("zoneinfo" => $array));
} else {
    $service->error("zoneinfo", 3);
}
예제 #6
0
 public function actionDelete()
 {
     if (Yii::app()->request->isPostRequest) {
         // we only allow deletion via POST request
         if (ZoneService::loadModel()->delete()) {
             Flashes::addInfoFlash(Yii::t('amo', 'Zone deleted'));
         } else {
             Flashes::addErrorFlash(Yii::t('amo', 'Could not delete the zone.') . '  ' . Yii::t('amo', 'Please, try again later.'));
         }
         $this->redirect(array('index'));
     } else {
         throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
     }
 }
예제 #7
0
<?php

require '../../base/Config.php';
Config::init();
$service = new PayNoticeService();
$service->init();
Common::logPayRequest($_SERVER, $_POST);
$params = $_POST;
if (isset($_POST['server_id']) === false || isset($_POST['private_data']) === false) {
    $service->error('pay', -1);
}
$remote_ip = $_SERVER['REMOTE_ADDR'];
if ($service->checkAnySDKSever($remote_ip) === false) {
    $service->error('pay', 1);
} else {
    $zone_service = new ZoneService();
    $zone_service->init();
    $zone_id = $params['server_id'];
    $platform = $params['private_data'];
    $slave_url = $zone_service->getZoneWebInfo($zone_id, $platform);
    if ($slave_url == '') {
        $service->error('pay', 2);
    } else {
        $service->payNotice($params, $slave_url . 'anysdk/pay.php');
    }
}