0) { foreach ($id_list as $myid) { db_execute("delete from src_data where id=$myid"); } } db_execute("delete from src_fields where srcid=$id"); db_execute("delete from src where id=$id"); } header ("Location: data.php"); break; case 'edit': include_once ('include/top_header.php'); if ($id != "") { $src = db_fetch_row("select * from src where id=$id"); } DrawFormHeader("Data Input Source Configuration","",false); DrawFormItem("Name","The name of this data source; only used by the front end."); DrawFormItemTextBox("Name",$src[Name],"",""); DrawFormItem("Input String","The data that in sent; which includes the filename and input sources in <> brackets."); DrawFormItemTextBox("FormatStrIn",$src[FormatStrIn],"",""); DrawFormItem("Output String","The data that is returned from the input program; defined as <> brackets."); DrawFormItemTextBox("FormatStrOut",$src[FormatStrOut],"",""); DrawFormSaveButton(); DrawFormItemHiddenIDField("ID",$id); DrawFormItemHiddenTextBox("action","save",""); DrawFormItemHiddenTextBox("Type",$src[Type],""); DrawMatrixCustom(""); /* fields */ if ($id != "") { DrawMatrixTableBegin("97%"); DrawMatrixRowBegin(); DrawMatrixHeaderTop("Current Data Input Source Fields",$colors[dark_bar],"","4"); DrawMatrixHeaderAdd($colors[dark_bar],"","data_fields.php?action=edit&fid=$id"); DrawMatrixRowEnd(); DrawMatrixRowBegin(); DrawMatrixHeaderItem("Name",$colors[panel],$colors[panel_text]); DrawMatrixHeaderItem("Data Name",$colors[panel],$colors[panel_text]); DrawMatrixHeaderItem("Input/Output",$colors[panel],$colors[panel_text]); DrawMatrixHeaderItem("Update RRA",$colors[panel],$colors[panel_text]); DrawMatrixHeaderItem("",$colors[panel],$colors[panel_text]); DrawMatrixRowEnd(); $fields = db_fetch_assoc("select * from src_fields where srcid=$id order by name"); if (sizeof($fields) > 0) { foreach ($fields as $field) { DrawMatrixRowBegin(); switch ($field[InputOutput]) { case 'in': $inputoutput = "Input"; break; case 'out': $inputoutput = "Output"; break; } switch ($field[UpdateRRA]) { case '': $updaterra = "No"; break; case 'on': $updaterra = "Yes"; break; } DrawMatrixLoopItem($field[Name],html_boolean($config["vis_main_column_bold"]["value"]),"data_fields.php?action=edit&id=$field[ID]&fid=$id"); DrawMatrixLoopItem($field[DataName],false,""); DrawMatrixLoopItem($inputoutput,false,""); DrawMatrixLoopItem($updaterra,false,""); DrawMatrixLoopItemAction("Remove",$colors[panel],"",false,"data_fields.php?action=remove&id=$field[ID]&fid=$id"); DrawMatrixRowEnd(); } } DrawMatrixTableEnd(); } include_once ("include/bottom_footer.php"); break; default: include_once ('include/top_header.php'); $title_text = "Current Data Input Sources"; $add_text = "data.php?action=edit"; include_once ("include/top_table_header.php"); print ""; DrawMatrixHeaderItem("Name",$colors[header_text],1); DrawMatrixHeaderItem(" ",$colors[header_text],2); print ""; $src_list = db_fetch_assoc("select * from src order by name"); $rows = sizeof($src_list); $i = 0; if (sizeof($src_list) > 0) { foreach ($src_list as $src) { DrawMatrixRowAlternateColorBegin($colors[alternate],$colors[light],$i); DrawMatrixLoopItem($src[Name],html_boolean($config["vis_main_column_bold"]["value"]),"data.php?action=edit&id=$src[ID]"); if ($src[Type] == "") { $matrix_remove = "data.php?action=remove&id=$src[ID]"; } else { $matrix_remove = ""; } DrawMatrixLoopItemAction("Remove","","",false,$matrix_remove); print "\n"; $i++; } } include_once ("include/bottom_table_footer.php"); include_once ("include/bottom_footer.php"); break; } ?>