Subversion Repository Public Repository

Nextrek

Diff Revisions 601 vs 602 for /Android/SmartCharging/endPoints/nightly/repositories/CommentRepository.php

Diff revisions: vs.
  @@ -140,6 +140,33 @@
140 140
141 141 }
142 142
143 + public function editComment($id_comment, $content) {
144 + $query = "UPDATE commenti SET descrizione='".$content."' WHERE id=".$id_comment;
145 + try {
146 + $this->db->exec($query);
147 + $status["return"] = 0;
148 + $status["content"] = $content;
149 + return $status;
150 + } catch (PDOException $e) {
151 + echo $e->getMessage();
152 + $status = createErrorMessage(1, "Errore DB");
153 + return $status;
154 + }
155 + }
156 +
157 + public function removeComment($id_comment) {
158 + $query = "DELETE FROM commenti WHERE id=".$id_comment;
159 + try {
160 + $this->db->exec($query);
161 + $status["return"] = 0;
162 + return $status;
163 + } catch (PDOException $e) {
164 + echo $e->getMessage();
165 + $status = createErrorMessage(1, "Errore DB");
166 + return $status;
167 + }
168 + }
169 +
143 170 public function getImages($id_comment) {
144 171 $comment = new Comment();
145 172 $query;