Permalink
Browse files

text area for add node

  • Loading branch information...
1 parent 73e36fd commit 83ed0e9a032298bb0300cc23b900e5ed724efce6 @nobelium nobelium committed Feb 5, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −1 admin/index.php
  2. +3 −2 common.lib.php
View
@@ -113,7 +113,7 @@
//get question details and update the database
if($execute)
- if(addNewNode($questionHTML, _POST("posX"), _POST("posY"), _POST("header")))
+ if(addNewNode($questionHTML, _POST("posX"), _POST("posY"), _POST("header"), _POST("comments")))
echo json_encode(array("status"=>600,
"message"=>"Successfully Added a new node",
"posX"=>intval(_POST("posX")),
View
@@ -100,14 +100,15 @@ function updateUserLevel($fromLevel, $toLevel){
}
//Add a new Node(question) in the database
-function addNewNode($questionHtml, $posx, $posy, $header){
+function addNewNode($questionHtml, $posx, $posy, $header, $comments){
$questionHtml = escape($questionHtml);
$posx = escape($posx);
$posy = escape($posy);
$header = escape($header);
+ $comments = "<!--".escape($comments)."-->";
//$addNodeQuery = mysql_query("INSERT INTO `questions` (`question`) VALUES('{$questionHtml}')");
//$addNodeQuery = mysql_query("INSERT INTO `questions` (`level`,`question`,`posX`,`posY`) SELECT MAX(`level`)+1 , '{$questionHtml}', '{$posx}', '{$posy}' FROM `questions`");
- $addNodeQuery = mysql_query("INSERT INTO `questions` (`question`,`header`,`posX`,`posY`) VALUES('{$questionHtml}','{$header}','$posx','$posy')");
+ $addNodeQuery = mysql_query("INSERT INTO `questions` (`question`,`header`,`posX`,`posY`,`comments`) VALUES('{$questionHtml}','{$header}','$posx','$posy','$comments')");
if($addNodeQuery) return true;
else return false;
}

0 comments on commit 83ed0e9

Please sign in to comment.