예제 #1
0
 public static function adminDash()
 {
     //Sätts för att andra funtioner ska kunna byggas till. Överflödig i dagsläget.
     Sql::setUniqueUrl($_SESSION['user']['id']);
     $dashboard = Sql::getDashboard();
     // Räknar om värden från databasen till en procentsats som sedan läggs in i return arrayen
     foreach ($dashboard['permissions'] as $permission => $value) {
         foreach ($value as $key => $val) {
             if ($key == 'number_of_permissions') {
                 $val = round($val / $dashboard['customers']['customers'] * 100);
                 $percent[] = $val;
             }
         }
     }
     return ['users' => $dashboard['users'], 'lists' => $dashboard['lists'], 'customers' => $dashboard['customers'], 'percent' => $percent, 'categories' => Sql::category(), 'imageUrl' => Sql::getListImage($_SESSION['uniqueUrl'])];
 }
예제 #2
0
 public static function payUp()
 {
     return ['userInfo' => Sql::getUserInfo($_SESSION['user']['id']), 'listInfo' => Sql::getListInfo($_SESSION['uniqueUrl']), 'imageUrl' => Sql::getListImage($_SESSION['uniqueUrl'])];
 }
예제 #3
0
 public static function getBlacklist()
 {
     return ['blacklist' => TRUE, 'items' => Sql::getBlackListItems($_SESSION['uniqueUrl'], $_SESSION['user']['id']), 'categories' => Sql::category(), 'imageUrl' => Sql::getListImage($_SESSION['uniqueUrl'])];
 }