示例#1
0
         }
         $response = array('result' => $result, 'elementId' => $docwatch_watch->get_id(), 'response' => $response);
         print encoding_normalize::json_encode($response);
     } else {
         $response = array('result' => false, 'elementId' => $docwatch_watch->get_id(), 'response' => "");
         print encoding_normalize::json_encode($response);
     }
     break;
 case "delete_watch":
     $docwatch_watch = new docwatch_watch($id);
     $result = $docwatch_watch->delete();
     $response = "";
     if (!$result) {
         $response = $docwatch_watch->get_error();
     }
     $response = array('result' => $result, 'elementId' => $docwatch_watch->get_id(), 'response' => $response);
     print encoding_normalize::json_encode($response);
     break;
 case "update_children":
     switch ($type) {
         case "category":
             if (isset($children)) {
                 $children = explode(",", $children);
                 if (count($children)) {
                     foreach ($children as $child) {
                         $query = "UPDATE docwatch_categories SET category_num_parent='" . $id . "' WHERE id_category='" . $child . "'";
                         $result = pmb_mysql_query($query, $dbh);
                         if (!$result) {
                             $response = $msg["dsi_docwatch_tree_error_database"];
                             break;
                         }