Ejemplo n.º 1
0
 public static function get_user_msg_check($username)
 {
     $num = pm_db::result_first("SELECT COUNT(*) AS num FROM gamebi_usermsg WHERE touser='******' AND is_read=0");
     return $num ? $num : 0;
 }
Ejemplo n.º 2
0
 public static function get_right_name($act_id)
 {
     return pm_db::result_first("SELECT action_name FROM iosadm_admin_action WHERE action_id='{$act_id}'");
 }
Ejemplo n.º 3
0
 public static function get_logslist($start, $username, $ctr_new, $act_new, $start_dategsh, $end_dategsh, $perpage = 20)
 {
     $where = '';
     if (!empty($username)) {
         $where .= " AND username = '******' ";
     }
     if (!empty($ctr_new)) {
         $where .= " AND ctrl = 'c={$ctr_new}' ";
     }
     if (!empty($act_new)) {
         $where .= " AND act = 'a={$act_new}' ";
     }
     if (!empty($start_dategsh)) {
         $where .= " AND aday >= {$start_dategsh} ";
     }
     if (!empty($end_dategsh)) {
         $where .= " AND aday <= {$end_dategsh} ";
     }
     if ($start > -1 && $perpage > 0) {
         $where .= " ORDER BY timestamp DESC LIMIT {$start}, {$perpage} ";
     }
     $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM iosadm_oplog WHERE 1=1 {$where} ";
     $query = pm_db::query($sql);
     $data = pm_db::fetch_all($query);
     $total = pm_db::result_first(" SELECT FOUND_ROWS() AS rows ");
     if ($data) {
         $output = array();
         $output['data'] = $data;
         $output['total'] = $total;
         return $output;
     } else {
         return null;
     }
 }