-
-
-
-
@@ -789,53 +787,54 @@ $.ajax({
e.preventDefault();
var self = this;
var newVal = $(this).parents(".addTodo").find("input").val();
- if(newVal.length){
- $(this).parents(".addTodo").find("input").val("");
- var ajaxCall = $.ajax({
- url: page,
- type: "post",
- data: {
- val: newVal,
- mode: "add_todo",
- },
- });
- ajaxCall.success(function(data){
- data = $.parseJSON(data);
- var li = document.createElement("li");
- li.className = "col-md-12";
- var p = document.createElement("p");
- p.className = "oneTodo paddingLeftSmall col-md-10";
- p.id = data.id;
- p.innerHTML = data.todo;
- var a = document.createElement("a");
- a.href = "#";
- a.className = "col-md-2 btn btn-danger btn-xs delete";
- a.innerHTML = "Delete";
- $(a).on("click", function(e){
- e.preventDefault();
- var self = this;
- var id = $(this).prev().attr("id");
- var ajaxCall = $.ajax({
- url: page,
- type: "post",
- data: {
- id: id,
- mode: "delete_todo",
- },
- });
- ajaxCall.success(function(data){
- $(self).parents("li").remove();
- });
+ if(newVal.length)
+ {
+ $(this).parents(".addTodo").find("input").val("");
+ var ajaxCall = $.ajax({
+ url: page,
+ type: "post",
+ data: {
+ val: newVal,
+ mode: "add_todo",
+ },
+ });
+ ajaxCall.success(function(data){
+ data = $.parseJSON(data);
+ var li = document.createElement("li");
+ li.className = "col-md-12";
+ var p = document.createElement("p");
+ p.className = "oneTodo paddingLeftSmall col-md-10";
+ p.id = data.id;
+ p.innerHTML = data.todo;
+ var a = document.createElement("a");
+ a.href = "#";
+ a.className = "col-md-2 btn btn-danger btn-xs delete";
+ a.innerHTML = "Delete";
+ $(a).on("click", function(e){
+ e.preventDefault();
+ var self = this;
+ var id = $(this).prev().attr("id");
+ var ajaxCall = $.ajax({
+ url: page,
+ type: "post",
+ data: {
+ id: id,
+ mode: "delete_todo",
+ },
+ });
+ ajaxCall.success(function(data){
+ $(self).parents("li").remove();
+ });
- });
- var div = document.createElement("div");
- div.className = "col-md-12";
+ });
+ var div = document.createElement("div");
+ div.className = "col-md-12";
- $(li).append(div).find("div").append(p).append(a);
- $(self).parents(".widgetBox").find("ul").prepend(li);
- });
+ $(li).append(div).find("div").append(p).append(a);
+ $(self).parents(".widgetBox").find("ul").prepend(li);
+ });
}else{
- alert("Please enter a valid value");
+ alert("Please enter a valid value");
}
}
});
diff --git a/upload/admin_area/styles/cb_2014/theme/css/styles.css b/upload/admin_area/styles/cb_2014/theme/css/styles.css
index 7c08936a..65463ffe 100644
--- a/upload/admin_area/styles/cb_2014/theme/css/styles.css
+++ b/upload/admin_area/styles/cb_2014/theme/css/styles.css
@@ -639,4 +639,9 @@ ul.mainTabs{
top: 40px;
width: 100%;
z-index: 10;
+}
+
+.addTodoText {
+ width: 80%;
+ display: inline;
}
\ No newline at end of file
diff --git a/upload/includes/classes/my_queries.class.php b/upload/includes/classes/my_queries.class.php
index 1f412d50..eb6b563f 100644
--- a/upload/includes/classes/my_queries.class.php
+++ b/upload/includes/classes/my_queries.class.php
@@ -932,20 +932,39 @@ class myquery {
//$db->update(tbl("comments"),array("comment"),array($text)," comment_id = $cid");
}
- /**
- * Function used to update comment vote
- */
- function update_comment_vote($cid,$text)
- {
- global $db;
- $db->Execute("UPDATE ".tbl("comments")." SET vote='$text' WHERE comment_id='$cid'");
- }
+ /**
+ * Function used to update comment vote
+ */
+ function update_comment_vote($cid,$text)
+ {
+ global $db;
+ $db->Execute("UPDATE ".tbl("comments")." SET vote='$text' WHERE comment_id='$cid'");
+ }
function get_todos()
{
global $db;
return $db->select(tbl('admin_todo'),'*'," userid='".userid()."'",NULL," date_added DESC ");
}
+
+ function insert_todo($text)
+ {
+ global $db;
+ $db->insert(tbl("admin_todo"),array('todo,date_added,userid'), array(mysql_clean($text),NOW(),userid()));
+ }
+
+ function update_todo($id,$text)
+ {
+ global $db;
+ $db->Execute("UPDATE ".tbl("admin_todo")." SET todo='".mysql_clean($text)."' WHERE comment_id='$id'");
+ }
+
+ function delete_todo($id)
+ {
+ global $db;
+ $db->delete(tbl("admin_todo"),array("todo_id"),array($id));
+ }
+
/**
* Function used to validate comments
*/