| @@ 358-374 (lines=17) @@ | ||
| 355 | return true; |
|
| 356 | } |
|
| 357 | ||
| 358 | public function putClient($dados, $id_cliente) |
|
| 359 | { |
|
| 360 | if ($dados['senha'] != '') { |
|
| 361 | $dados['senha'] = sha1($dados['senha']); |
|
| 362 | } |
|
| 363 | ||
| 364 | $this->Cliente->id = $id_cliente; |
|
| 365 | $this->Cliente->id_usuario = $this->getIdUser(); |
|
| 366 | ||
| 367 | if ($this->Cliente->save($dados)) { |
|
| 368 | $this->response->body('{"message": "success", "result": '. json_encode($dados) .'}'); |
|
| 369 | return; |
|
| 370 | } |
|
| 371 | ||
| 372 | $this->response->body('{"message": "error"}'); |
|
| 373 | return; |
|
| 374 | } |
|
| 375 | ||
| 376 | public function inactiveClient($id_cliente) |
|
| 377 | { |
|
| @@ 457-473 (lines=17) @@ | ||
| 454 | return; |
|
| 455 | } |
|
| 456 | ||
| 457 | public function putParent($dados, $id_parente) |
|
| 458 | { |
|
| 459 | if ($dados['senha'] != '') { |
|
| 460 | $dados['senha'] = sha1($dados['senha']); |
|
| 461 | } |
|
| 462 | ||
| 463 | $this->Parente->id = $id_parente; |
|
| 464 | $this->Parente->id_usuario = $this->getIdUser(); |
|
| 465 | ||
| 466 | if ($this->Parente->save($dados)) { |
|
| 467 | $this->response->body('{"message": "success", "result": '. json_encode($dados) .'}'); |
|
| 468 | return; |
|
| 469 | } |
|
| 470 | ||
| 471 | $this->response->body('{"message": "error"}'); |
|
| 472 | return; |
|
| 473 | } |
|
| 474 | ||
| 475 | public function inactiveParent($id_parente) |
|
| 476 | { |
|