function getAllActiveAnnouncementsByBranch($obj)
{
    $conn = getConnection();
    $batchlist = array();
    $batchlist = getAllActiveBatchesByBranch($obj);
    $list = array();
    for ($i = 0; $i < count($batchlist); $i++) {
        $query = "SELECT * FROM announcement WHERE activeflag=1 AND batchID='" . $batchlist[$i]->getID() . "' ORDER BY ID ASC";
        //echo $query;
        $result = mysql_query($query);
        while ($member = mysql_fetch_array($result)) {
            $temp = getAnnouncement($member['ID']);
            array_push($list, $temp);
        }
    }
    if (count($list) != 0) {
        return $list;
    }
    return NULL;
}
示例#2
0
function getAllActiveStudentsByBranch($obj, $n)
{
    $conn = getConnection();
    $batchlist = array();
    $batchlist = getAllActiveBatchesByBranch($obj);
    $stulist = array();
    for ($i = 0; $i < count($batchlist); $i++) {
        $query = "SELECT * FROM student WHERE activeflag=1 AND batchID='" . $batchlist[$i]->getID() . "' ORDER BY firstname ASC,lastname ASC, rollno ASC";
        $result = mysql_query($query);
        while ($member = mysql_fetch_array($result)) {
            $temp = getStudent($member['ID'], $n);
            array_push($stulist, $temp);
        }
    }
    if (count($stulist) != 0) {
        return $stulist;
    }
    return NULL;
}