| @@ 302-318 (lines=17) @@ | ||
| 299 | return true; |
|
| 300 | } |
|
| 301 | ||
| 302 | public function putClient($dados, $id_cliente) |
|
| 303 | { |
|
| 304 | if ($dados['senha'] != '') { |
|
| 305 | $dados['senha'] = sha1($dados['senha']); |
|
| 306 | } |
|
| 307 | ||
| 308 | $this->Cliente->id = $id_cliente; |
|
| 309 | $this->Cliente->id_usuario = $this->getIdUser(); |
|
| 310 | ||
| 311 | if ($this->Cliente->save($dados)) { |
|
| 312 | $this->response->body('{"message": "success", "result": '. json_encode($dados) .'}'); |
|
| 313 | return; |
|
| 314 | } |
|
| 315 | ||
| 316 | $this->response->body('{"message": "error"}'); |
|
| 317 | return; |
|
| 318 | } |
|
| 319 | ||
| 320 | public function inactiveClient($id_cliente) |
|
| 321 | { |
|
| @@ 379-395 (lines=17) @@ | ||
| 376 | return; |
|
| 377 | } |
|
| 378 | ||
| 379 | public function putParent($dados, $id_parente) |
|
| 380 | { |
|
| 381 | if ($dados['senha'] != '') { |
|
| 382 | $dados['senha'] = sha1($dados['senha']); |
|
| 383 | } |
|
| 384 | ||
| 385 | $this->Parente->id = $id_parente; |
|
| 386 | $this->Parente->id_usuario = $this->getIdUser(); |
|
| 387 | ||
| 388 | if ($this->Parente->save($dados)) { |
|
| 389 | $this->response->body('{"message": "success", "result": '. json_encode($dados) .'}'); |
|
| 390 | return; |
|
| 391 | } |
|
| 392 | ||
| 393 | $this->response->body('{"message": "error"}'); |
|
| 394 | return; |
|
| 395 | } |
|
| 396 | ||
| 397 | public function inactiveParent($id_parente) |
|
| 398 | { |
|