comparison models/extractapp.php @ 102:6ba742b712b0 extractapp

new: use cookie in browser to trigger auto refresh page in LGServices
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 25 May 2016 11:29:28 +0200
parents a264460c77ca
children e542b161d907
comparison
equal deleted inserted replaced
101:a264460c77ca 102:6ba742b712b0
903 list($id, $name, $tag, $color) = $this->GetTag($postdata); 903 list($id, $name, $tag, $color) = $this->GetTag($postdata);
904 904
905 // for creationDate and lastChangeDate 905 // for creationDate and lastChangeDate
906 $date = date('Y-m-d H:i:s', time()); 906 $date = date('Y-m-d H:i:s', time());
907 907
908 $query1 = sprintf("INSERT INTO `Taglist` (`id`, `name`, `tag`, `color`, `creationDate`, `lastChangeDate`) VALUES (%s, %s, %s, %s, %s, %s)", 908 $query1 = sprintf("INSERT INTO Taglist (`id`, `name`, `tag`, `color`, `creationDate`, `lastChangeDate`) VALUES (%s, %s, %s, %s, %s, %s)",
909 $this->GetSQLValueString($id, "int"), 909 $this->GetSQLValueString($id, "int"),
910 $this->GetSQLValueString($name, "text"), 910 $this->GetSQLValueString($name, "text"),
911 $this->GetSQLValueString($tag, "text"), 911 $this->GetSQLValueString($tag, "text"),
912 $this->GetSQLValueString($color, "text"), 912 $this->GetSQLValueString($color, "text"),
913 $this->GetSQLValueString($date, "date"), 913 $this->GetSQLValueString($date, "date"),
914 $this->GetSQLValueString($date, "date")); 914 $this->GetSQLValueString($date, "date"));
915 //$this->GetSQLValueString($this->systemNAME, "text")); 915 //$this->GetSQLValueString($this->systemNAME, "text"));
916 916
917 $result1 = mysql_query($query1); 917 $result1 = mysql_query($query1);
918 918 if (!$result1) {
919 //echo json_encode("error when insert into Taglist table");
920 echo 0;
921 return;
922 }
919 923
920 // add it to topic_tag_relation table 924 // add it to topic_tag_relation table
921 $topic_id = $postdata['topic_id']; 925 $topic_id = $postdata['topic_id'];
922 926
923 // tag_id is $id; 927 // tag_id is $id;
930 $this->GetSQLValueString($date, "date")); 934 $this->GetSQLValueString($date, "date"));
931 935
932 936
933 $result = mysql_query($query); 937 $result = mysql_query($query);
934 if (!$result) { 938 if (!$result) {
935 echo json_encode("error when insert into TopicTagRelation table"); 939 echo 1;
936 } 940 //echo json_encode("error when insert into TopicTagRelation table");
941 }
942
937 } 943 }
938 944
939 } 945 }
940 946
941 public function SaveTagElement($postdata) { 947 public function SaveTagElement($postdata) {