public static function get_user_firstmenu()
 {
     $user_id = ADMINUSERID;
     if (ADMINLEVEL == 1) {
         return pm_db::fetch_all(pm_db::query("SELECT * FROM pm_menu WHERE level=1 AND parent_id=0"));
     }
     $usermenu = mod_member::get_user_menu($user_id);
     $menu = array();
     $query = pm_db::query("SELECT * FROM pm_menu WHERE level=3 AND is_show=1 AND status=1");
     while ($row = pm_db::fetch_one($query)) {
         $secondmenu = pm_db::fetch_result("SELECT * FROM pm_menu WHERE menu_id='{$row['parent_id']}' AND level=2 AND is_show=1 AND status=1");
         $firstmenu = pm_db::fetch_result("SELECT * FROM pm_menu WHERE menu_id='{$secondmenu['parent_id']}' AND level=1 AND is_show=1 AND status=1");
         $menu[$firstmenu['menu_id']] = $firstmenu;
     }
     return $menu;
 }
Example #2
0
 public static function get_one_right($act_id)
 {
     return pm_db::fetch_result("SELECT * FROM iosadm_admin_action WHERE action_id='{$act_id}' AND status=1");
 }
 public static function get_one_adminmsg($id)
 {
     return pm_db::fetch_result("SELECT * FROM gamebi_adminmsg WHERE id='{$id}'");
 }
Example #4
0
 public static function as_channel_data($channel, $starttime = '', $endtime = '')
 {
     $sql = "SELECT SUM(charge) AS c,SUM(registernum) AS rn, SUM(chargenum) AS cn FROM pm_ghzcdata WHERE channelid='{$channel}'";
     if ($starttime) {
         $sql .= " AND thedate>='{$starttime}'";
     }
     if ($endtime) {
         $sql .= " AND thedate<='{$endtime}'";
     }
     return pm_db::fetch_result($sql);
 }
 public static function loginhistory_list($start, $ip, $start_dateunix, $end_dateunix, $username, $perpage = PAGE_ROWS)
 {
     $where = '';
     if (!empty($ip)) {
         $where .= " AND ip LIKE '%{$ip}%' ";
     }
     if (!empty($start_dateunix)) {
         $where .= " AND logintime >= '{$start_dateunix}' ";
     }
     if (!empty($end_dateunix)) {
         $where .= " AND logintime <= '{$end_dateunix}' ";
     }
     if ($start > -1 && $perpage > 0) {
         $where .= "ORDER BY logintime DESC LIMIT {$start}, {$perpage}";
     }
     $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM iosadm_loginhistory WHERE 1=1 AND username = '******' {$where} ";
     $query = pm_db::query($sql);
     $total = pm_db::fetch_result("SELECT FOUND_ROWS() AS rows");
     $data = array();
     while ($row = pm_db::fetch_one($query)) {
         $ipcent = 0;
         $row['ip_count'] = self::get_count_oneip($username, $row['ip']);
         $ipcent = floatval($row['ip_count'] / (double) $total['rows']);
         if ($ipcent < 0.1) {
             $row['ip'] = "<font color = 'PINK' ><strong>" . $row['ip'] . "</strong></font>";
         }
         $row['ipcent'] = $ipcent;
         $row['ipcent'] = number_format($row['ipcent'], 2, '.', ',');
         $data[$row['id']] = $row;
     }
     if ($data) {
         $output = array();
         $output['data'] = $data;
         $output['total'] = $total['rows'];
         return $output;
     } else {
         return null;
     }
 }