diff interface/edit_section_db.php @ 1:ef6d0c6a13d7

(1)Add 'sort_by' time entry in main page. (check_sections.php) Modify check_sections_details page to have level3 option. (2)Modify map to have default dataset loaded.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 21 Jan 2015 10:49:44 +0100
parents b12c99b7c3f0
children da5309d54083
line wrap: on
line diff
--- a/interface/edit_section_db.php	Mon Jan 19 17:13:49 2015 +0100
+++ b/interface/edit_section_db.php	Wed Jan 21 10:49:44 2015 +0100
@@ -154,17 +154,41 @@
 		echo json_encode("Succeeded.");
 	}
 }
+
 if(isset($_POST['command']) && $_POST['command']!=''){
 	$command=$_POST['command'];
-	if($command=="write"){
-		if(isset($_POST['bookId'])&&isset($_POST['sectionArray'])&&isset($_POST['version'])&&isset($_POST['editor'])&&
+	if($command=="write"){		
+		
+		$bookId=$_POST['bookId'];
+		$sectionArray=$_POST['sectionArray'];
+		$version=$_POST['version'];
+		$editor=$_POST['editor'];
+
+		foreach ($sectionArray as $key => $value) {
+			//echo $key.',';
+			foreach ($value as $key => $inner_val) {
+				//echo $key.",".$inner_val."\n";
+			}
+		}
+		
+		//echo "bookId:".$bookId.", "."editor:".$editor;
+		if(isset($bookId)&&isset($sectionArray)&&isset($version)&&isset($editor)&&\
+			is_numeric($bookId) && sizeof($sectionArray)!=0 && is_numeric($version) && $editor!=""){
+			
+			updateSectionArray($bookId,$sectionArray,$version,$editor);
+		}
+		/*
+		if(isset($_POST['bookId'])&&isset($_POST['sectionArray'])&&isset($_POST['version'])&&isset($_POST['editor'])&&\
 			is_numeric($_POST['bookId']) && sizeof($_POST['sectionArray'])!=0 && is_numeric($_POST['version']) && $_POST['editor']!=""){
 			$bookId=$_POST['bookId'];
 			$sectionArray=$_POST['sectionArray'];
 			$version=$_POST['version'];
 			$editor=$_POST['editor'];
-			updateSectionArray($bookId,$sectionArray,$version,$editor);
+			
+			echo "updating db...";
+			// updateSectionArray($bookId,$sectionArray,$version,$editor);
 		}
+		*/
 	}
 }