$rows = project_get_req_doc_types($project_id);
foreach ($rows as $row) {
    $list_box[$row[REQ_DOC_TYPE_ID]] = $row[REQ_DOC_TYPE_NAME];
}
$list_box[""] = "";
html_print_list_box_from_key_array($list_box, session_validate_form_get_field('req_type', $req_doc_type));
print "</select>" . NEWLINE;
print "</td>" . NEWLINE;
print "</tr>" . NEWLINE;
# ASSIGNED TO RELEASE
print "<tr>" . NEWLINE;
print "<td class=form-lbl-r nowrap>" . lang_get('assigned_to_release') . "</td>" . NEWLINE;
print "<td class=form-data-l>" . NEWLINE;
print "<select name=assigned_release size=1>" . NEWLINE;
$list_box = array();
$rows_rel = admin_get_releases($project_id);
foreach ($rows_rel as $row_rel) {
    $list_box[$row_rel[RELEASE_ID]] = $row_rel[RELEASE_NAME];
}
$list_box[""] = "";
html_print_list_box_from_key_array($list_box, session_validate_form_get_field('req_area', $selected_release));
print "</select>" . NEWLINE;
print "</td>" . NEWLINE;
print "</tr>" . NEWLINE;
# SUBMIT BUTTON
print "<tr>" . NEWLINE;
print "<td colspan='2' class=center><input type='submit' value='" . lang_get('submit_btn') . "'></td>" . NEWLINE;
print "</tr>" . NEWLINE;
print "</table>" . NEWLINE;
print "</td>" . NEWLINE;
print "</tr>" . NEWLINE;
function requirement_edit_assoc_releases($req_id, $assoc_releases)
{
    global $db;
    $tbl_req = REQ_TBL;
    $f_req_proj_id = $tbl_req . "." . REQ_PROJECT_ID;
    $f_req_id = $tbl_req . "." . REQ_ID;
    $f_req_filename = $tbl_req . "." . REQ_FILENAME;
    $tbl_req_ver_assoc_rel = REQ_VERS_ASSOC_REL;
    $f_req_ver_assoc_rel_id = $tbl_req_ver_assoc_rel . "." . REQ_VERS_ASSOC_REL_ID;
    $f_req_ver_assoc_rel_req_id = $tbl_req_ver_assoc_rel . "." . REQ_VERS_ASSOC_REL_REQ_ID;
    $f_req_ver_assoc_rel_rel_id = $tbl_req_ver_assoc_rel . "." . REQ_VERS_ASSOC_REL_REL_ID;
    $tbl_release = RELEASE_TBL;
    $f_release_id = $tbl_release . "." . RELEASE_ID;
    $f_release_project_id = $tbl_release . "." . PROJECT_ID;
    $f_release_name = $tbl_release . "." . RELEASE_NAME;
    $f_release_archive = $tbl_release . "." . RELEASE_ARCHIVE;
    $s_project_properties = session_get_project_properties();
    $project_id = $s_project_properties['project_id'];
    $release_ids = admin_get_releases($project_id);
    foreach ($release_ids as $row) {
        $q = "\tSELECT {$f_req_ver_assoc_rel_id}\n\t\t\t\tFROM {$tbl_req_ver_assoc_rel}\n\t\t\t\tWHERE {$f_req_ver_assoc_rel_req_id} = {$req_id}\n\t\t\t\t\tAND\t{$f_req_ver_assoc_rel_rel_id} = " . $row[RELEASE_ID];
        $rs = db_query($db, $q);
        $record_exists = db_num_rows($db, $rs);
        if (util_array_key_search($row[RELEASE_ID], $assoc_releases)) {
            if (!$record_exists) {
                $q = "\tINSERT INTO {$tbl_req_ver_assoc_rel}\n\t\t\t\t\t\t\t({$f_req_ver_assoc_rel_req_id}, {$f_req_ver_assoc_rel_rel_id})\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t({$req_id}, " . $row[RELEASE_ID] . ")";
            }
        } else {
            if ($record_exists) {
                $q = "\tDELETE FROM {$tbl_req_ver_assoc_rel}\n\t\t\t\t\t\tWHERE {$f_req_ver_assoc_rel_req_id} = {$req_id}\n\t\t\t\t\t\t\tAND\t{$f_req_ver_assoc_rel_rel_id} = " . $row[RELEASE_ID];
            }
        }
        db_query($db, $q);
    }
}