public static function NewsCount(Ab_Database $db, $userid = 0, $retvalue = false) { $sql = "\n\t\t\tSELECT count( newsid ) AS cnt\n\t\t\tFROM " . $db->prefix . "ns_news\n\t\t\tWHERE ((deldate=0 AND published>0) OR userid=" . bkint($userid) . ") AND language='" . bkstr(Abricos::$LNG) . "' \n\t\t\tLIMIT 1 \n\t\t"; if ($retvalue) { $row = $db->query_first($sql); return $row['cnt']; } else { return $db->query_read($sql); } }
public static function TeacherItem(Ab_Database $db, $id) { $sql = "\n\t\t\tSELECT\n\t \t\t\tteacherid as id,\n\t \t\t\tfio,\n\t \t\t\tremove\n \t\tFROM " . $db->prefix . "rb_teacher\n \t\tWHERE teacherid=" . bkint($id) . "\n \t\tLIMIT 1\n\t\t"; return $db->query_first($sql); }