Example #1
0
 function getID($paramAlt = "")
 {
     if (!isset(Router::$id) or !is_numeric(Router::$id)) {
         if ($paramAlt and isset($_GET[$paramAlt]) and $_GET[$paramAlt]) {
             Router::$id = $_GET[$paramAlt];
             unset($_GET[$paramAlt]);
         } else {
             return;
         }
     }
     return str_replace("-", ",", Router::$id);
 }
Example #2
0
    function setDefaultBrand()
    {
        if (AUDIENCE == 'sim') {
            return;
        }
        require_once "models/BrandCollection.php";
        require_once "models/Brand.php";
        require_once "models/BudgetIssued.php";
        require_once "models/BrandPromos.php";
        $Brand = (new BrandCollection(json_decode('{
			"name": "test-' . time() . '",
			"mission": "test and strengthen the TraceEval ecosystem",
			"description": "This is a trial brand that the user can close at any time."
		}')))->add()[0];
        Router::$id = $Brand->brand_id;
        $b = (new Brand(json_decode('{
			"name": "brand' . $Brand->brand_id . '"
		}')))->set();
        $BudgetIssued = (new BudgetIssued(json_decode('{
			"from": "' . $Brand->holders[0]->holder_id . '-' . $Brand->holders[0]->limkey . '", 
			"to": "' . $Brand->holders[1]->holder_id . '-' . $Brand->holders[1]->limkey . '",
			"amount": 10.00,
			"note": "first issued budget"
		}')))->add();
        $Promo = (new BrandPromos(json_decode('{
			"name": "Welcome Team #' . $Brand->brand_id . '",
			"description": "Help new teams reach their starting revenue goals. More teams leads to a more robust market!",
			"amount": 1.00,
			"holder_id": ' . $Brand->holders[0]->holder_id . ',
			"keyword": "welcome",
			"by_all_limit": 10,
			"by_brand_limit": 2,
			"by_user_limit": 1,
			"by_user_wait": 336
		}')))->add();
    }
Example #3
0
 public static function parse($uri)
 {
     self::$action = Config::get('default_action');
     self::$controller = Config::get('default_controller');
     self::$language = Config::get('default_language');
     self::$id = Config::get('default_id');
     $uri_elements = self::url_to_array($uri);
     if (count($uri_elements)) {
         //if (strtolower(current($uri_elements) != 'admiin')) {
         if (in_array(strtolower(current($uri_elements)), Config::get('languages'))) {
             self::$language = strtolower(current($uri_elements));
             array_shift($uri_elements);
         }
         //}else {
         //  array_shift($uri_elements);
         //}
         $url = implode('/', $uri_elements);
         self::find_alias($url);
         /**
                     if(current($uri_elements)){
                     self::$controller = ucfirst(strtolower(current($uri_elements)));
                     array_shift($uri_elements);
                     }
                     if(current($uri_elements)){
                     self::$action = strtolower(current($uri_elements));
                     array_shift($uri_elements);
                     }
                     if(current($uri_elements)){
                     self::$params = $uri_elements;
         
                     }
                      **/
     }
 }