|
|
@ -1680,21 +1680,21 @@ class CourseManager |
|
|
|
$sql = "SELECT distinct field_id FROM $t_cfv"; |
|
|
|
$sql = "SELECT distinct field_id FROM $t_cfv"; |
|
|
|
$res_field_all_ids = @api_sql_query($sql,__FILE__,__LINE__); |
|
|
|
$res_field_all_ids = @api_sql_query($sql,__FILE__,__LINE__); |
|
|
|
|
|
|
|
|
|
|
|
while($row_field_all_id = Database::fetch_row($res_field_all_ids)){ |
|
|
|
while ($row_field_all_id = Database::fetch_row($res_field_all_ids)){ |
|
|
|
$field_all_ids[] = $row_field_all_id[0]; |
|
|
|
$field_all_ids[] = $row_field_all_id[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (count($field_ids)>0) { |
|
|
|
foreach($field_ids as $field_id) { |
|
|
|
foreach($field_ids as $field_id) { |
|
|
|
// check if field id is used into table field value |
|
|
|
// check if field id is used into table field value |
|
|
|
if (is_array($field_all_ids)) { |
|
|
|
if (is_array($field_all_ids)) { |
|
|
|
if (in_array($field_id,$field_all_ids)) { |
|
|
|
if (in_array($field_id,$field_all_ids)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$sql_course_field = "DELETE FROM $t_cf WHERE id = '$field_id'"; |
|
|
|
$sql_course_field = "DELETE FROM $t_cf WHERE id = '$field_id'"; |
|
|
|
api_sql_query($sql_course_field,__FILE__,__LINE__); |
|
|
|
api_sql_query($sql_course_field,__FILE__,__LINE__); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|