I've made some filter in Hooks and it works. But I think there are other ways that are more simple using more concise code.
Any suggestion?
I code is like this
Code: Select all
function Pelajar_init(&$options, $memberInfo, &$args) {
$TableAndGroup = $memberInfo['group'];
$RecID = sqlValue("select id FROM ".$TableAndGroup." WHERE milik = '".$memberInfo['username']."'");
if ($TableAndGroup=="Penyelia"){
$pelajar = sql("SELECT pelajar FROM Seliaan WHERE penyelia='{$RecID}'", $eo);
while ($row = db_fetch_assoc($pelajar)) {
$array[] = $row;
}
$num_rows = db_num_rows($pelajar);
for ($i = 0; $i < $num_rows;) {
//echo $array[$i]['pelajar']."<br>";
addFilter($i+1, 'or', 1, 'equal-to', $array[$i]['pelajar']);
$i ++;
}
}
}