From e845f71c143324a7c1a3ea11860d4275b9b0763f Mon Sep 17 00:00:00 2001 From: Yuchen Jiang Date: Thu, 24 Sep 2015 23:21:19 -0400 Subject: [PATCH] added cpg/hg19 import page --- ImportFiles.html | 106 ++++++++++++++++++++++++++++++++++++++++++++ dynamic_loading.php | 19 +++++++- 2 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 ImportFiles.html diff --git a/ImportFiles.html b/ImportFiles.html new file mode 100644 index 0000000..fd75d0d --- /dev/null +++ b/ImportFiles.html @@ -0,0 +1,106 @@ + + + + + +
+ table name:
+
+ + + + \ No newline at end of file diff --git a/dynamic_loading.php b/dynamic_loading.php index 6cab5d5..89a3ef4 100644 --- a/dynamic_loading.php +++ b/dynamic_loading.php @@ -19,8 +19,15 @@ if (isset($_POST["upload"])){ $timestamp = (new DateTime())->getTimestamp(); $data = parseData($_POST["upload"]); - $result = insertToDb($timestamp, $_POST["header"],$data); - ajaxReturn($result); + if(isset($_POST["tableName"])){ + $result = insertToDb($_POST["tableName"], $_POST["header"],$data); + ajaxReturn($result); + } + else{ + $result = insertToDb($timestamp, $_POST["header"],$data); + ajaxReturn($result); + } + } else if (isset($_POST["processData"])){ $serviceUrl = $_POST["processData"]; @@ -853,6 +860,14 @@ // echo $result; mysqli_query ($link,$result); } + + + $sql = "SELECT @n:=0"; + mysqli_query ($link,$sql); + + $sql = "UPDATE ".$tableName." SET ID = @n := @n + 1"; + mysqli_query ($link,$sql); + return $tableName; //echo json_encode($tableName); }