From c4f926438dcb8abe805e910399940f79ff643c4b Mon Sep 17 00:00:00 2001 From: ziejd2 Date: Thu, 14 Sep 2017 15:39:41 -0500 Subject: Add files via upload --- sourcecodes/bn_file_load_gom.php | 401 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 401 insertions(+) create mode 100644 sourcecodes/bn_file_load_gom.php (limited to 'sourcecodes/bn_file_load_gom.php') diff --git a/sourcecodes/bn_file_load_gom.php b/sourcecodes/bn_file_load_gom.php new file mode 100644 index 00000000..342afe02 --- /dev/null +++ b/sourcecodes/bn_file_load_gom.php @@ -0,0 +1,401 @@ + + + + + + + + + window.alert ('Sorry, error uploading $TextFile.')"; + flush(); + exit(); + } + else + { + $searchID=file_get_contents("$TextinFile"); + unlink($TextinFile); + + } + + } + + else + { + echo ""; + } + } +} + +?> +
+

Upload data file for structure learning search

+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + > + +

Content of uploaded data file:

+ +
+    + > +
+    + > +
+    + > +
+    + > +
+    + > +
+
+
+1) + { + fprintf($flevel,"%s",$level_arr[$j][0]); + $m=$data_type[$j]; + for($jj=1;$jj<=$m;$jj++) + { + fprintf($flevel,"\t%s",$level_arr[$j][$jj]); + } + + fprintf($flevel,"\n"); + } +} + + +fwrite($fptype,"$name_t\n"); +for($j=0;$j<$lcc;$j++) +{ + fprintf($fptype,"$data_type[$j]\t"); +} +fwrite($fptype,"\n"); + + +fwrite($fpmain, "$l_type\n"); +$l_c=0; + +//perform discrete level replacement +for($m=0;$m<$lcc;$m++) //column +{ + if($data_type[$m]>1) + { + $r=$data_type[$m]; + for($j=1;$j<=$r;$j++) + { + $search=$level_arr[$m][$j]; + $replace=$j."#"; + for($n=0;$n<$lc;$n++) //row + { + $val=$cont_arr_tmp[$n][$m]; + if($val==$search) + $cont_arr_tmp[$n][$m]=$replace; //alter levels + } + } + for($n=0;$n<$lc;$n++) //row + $cont_arr_tmp[$n][$m]=str_replace('#','',$cont_arr_tmp[$n][$m]); + } +} + +//write data to output file +for($j=0;$j<$lc;$j++) +{ + fprintf($fpmain,"%s",$cont_arr_tmp[$j][0]); + for($jj=1;$jj<$lcc;$jj++) + fprintf($fpmain,"\t%s",$cont_arr_tmp[$j][$jj]); + fprintf($fpmain, "\n"); +} + +fclose($fpmain); + +////////////////empty ban and white list///////////////////////////// + +$sid1=$keyval."ban"; +$sid2=$keyval."white"; +$wdir="./data/"; + +$Textban=$wdir.$sid1.".txt"; +$Textwhite=$wdir.$sid2.".txt"; + +$fpb = fopen($Textban,"w"); +$fpw = fopen($Textwhite,"w"); + +$datpost="From\tTo\n"; + +fwrite($fpb,"$datpost"); +fwrite($fpw,"$datpost"); +if($searchID!="") +{ + +$runtime=exe_time($keyval,$parent_number,$k_number); +?> +
+

+

+

+
+
+ + + + + + -- cgit 1.4.1