add inventory

This commit is contained in:
2016-02-03 22:50:17 +01:00
parent 41de4ee6a7
commit b871022329
8 changed files with 358 additions and 1 deletions

View File

@@ -220,4 +220,22 @@ class Helper {
$details = json_decode ( Helper::url_get_contents( "http://ipinfo.io/{$ip}/json" ) );
return $details;
}
public static function mkYiiSortItem($field, $column){
return [
$field => [
'asc' => [$column => SORT_ASC ],
'desc' => [$column => SORT_DESC],
]
];
}
public static function mkYiiSortItems($config){
$result = [];
foreach ($config as $col ){
$result = $result + Helper::mkYiiSortItem($col[0] ,$col[1]);
}
return $result;
}
}