Example #1
0
function getTags()
{
    global $db;
    $types = array();
    $rs = $db->query("select distinct label_warga from t_warga where label_warga<>'' and tgl_keluar=0");
    while ($ftypes = $rs->fetchArray()) {
        $types = array_merge($types, explode(",", $ftypes['label_warga']));
    }
    $types = array_unique_compact($types);
    return $types;
}
Example #2
0
/**
 * Retrieves all the tags from every student
 * and removes duplicates.
 *
 * @since 6.0.04
 * @return mixed
 */
function tagList()
{
    $app = \Liten\Liten::getInstance();
    $tagging = $app->db->query('SELECT tags FROM student');
    $q = $tagging->find(function ($data) {
        $array = [];
        foreach ($data as $d) {
            $array[] = $d;
        }
        return $array;
    });
    $tags = [];
    foreach ($q as $r) {
        $tags = array_merge($tags, explode(",", $r['tags']));
    }
    $tags = array_unique_compact($tags);
    foreach ($tags as $key => $value) {
        if ($value == "" || strlen($value) <= 0) {
            unset($tags[$key]);
        }
    }
    return $tags;
}