function addVideoLecture($name, $format, $examyear, $start, $end, $creator)
{
    $conn = getConnection();
    do {
        $temp_url = md5($name . random_gen(10) . getCurrentInstituteID1());
        $query = "SELECT * FROM video WHERE url LIKE '" . $temp_url . "'";
        $result = mysql_query($query);
        $rows = mysql_num_rows($result);
        if ($rows == 0) {
            $tempflag = false;
        } else {
            $tempflag = true;
        }
    } while ($tempflag);
    $url = $temp_url . '.' . $format;
    $query = "INSERT INTO video(name ,url,examyear,activeflag ,createdby , start_date, end_date, lastupdated) VALUES('" . $name . "' ,'" . $url . "' ,'" . $examyear . "' , 1 , " . $creator . ", '" . $start . "', '" . $end . "',NOW())";
    $result = mysql_query($query);
    if ($result) {
        $temp = array(true, mysql_insert_id());
    } else {
        $temp = array(false, mysql_error());
    }
    return $temp;
}
function removeStudentFromMainTable($mainID)
{
    $instituteID = getCurrentInstituteID1();
    $conn = getMainConnection();
    $query = "SELECT * FROM `studentinstituteid` WHERE `studentID` = '" . $mainID . "' AND `instituteID` = '" . $instituteID . "' AND `activeflag` = 1";
    $result = mysql_query($query, $conn);
    $rows = mysql_num_rows($result);
    if ($rows == 1) {
        $member = mysql_fetch_array($result);
        $query1 = "UPDATE `studentinstituteid` SET `activeflag` = 0 WHERE `ID` = '" . $member['ID'] . "'";
        $result1 = mysql_query($query1, $conn);
        return true;
    }
    return false;
}
function getAllClassNotices()
{
    $conn = getMainConnection();
    $query = "SELECT * FROM notice WHERE activeflag = 1 ORDER BY ID DESC";
    $result = mysql_query($query);
    $id = getCurrentInstituteID1();
    $output = '';
    $flag = false;
    while ($member = mysql_fetch_array($result)) {
        $flag = true;
        $temp = explode(';', $member['classID']);
        $flag = in_array($id, $temp);
        if ($flag || $member['classID'] == 0) {
            $output .= '<li><h4>' . $member['name'] . '<h4></li>';
        }
        $output .= '<br />';
    }
    if ($flag) {
        $output = '<h3>&nbsp;&nbsp;Note : </h3>' . $output;
    }
    return $output;
}
Beispiel #4
0
function assignRecurringStructure($type, $name, $BatchObj, $userID)
{
    $list = getAllActiveUsersByBranch(getCurrentInstituteID1(), $BatchObj->getBranchObj()->getID());
    $conn = getConnection();
    for ($i = 0; $i < count($list); $i++) {
        $query = "SELECT * FROM recurring_structure WHERE associate = '" . $type . "' AND staffID = '" . $list[$i]->getID() . "' AND activeflag = 1";
        $result = mysql_query($query);
        $numrows = mysql_affected_rows();
        if ($numrows == 0) {
        } else {
            while ($member = mysql_fetch_array($result)) {
                assignTasksOfStructureToStaff($member['structureID'], $member['staffID'], $member['priority'], $name, $userID);
            }
        }
    }
}