| @@ 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 | { |
|
| @@ 464-480 (lines=17) @@ | ||
| 461 | return; |
|
| 462 | } |
|
| 463 | ||
| 464 | public function putParent($dados, $id_parente) |
|
| 465 | { |
|
| 466 | if ($dados['senha'] != '') { |
|
| 467 | $dados['senha'] = sha1($dados['senha']); |
|
| 468 | } |
|
| 469 | ||
| 470 | $this->Parente->id = $id_parente; |
|
| 471 | $this->Parente->id_usuario = $this->getIdUser(); |
|
| 472 | ||
| 473 | if ($this->Parente->save($dados)) { |
|
| 474 | $this->response->body('{"message": "success", "result": '. json_encode($dados) .'}'); |
|
| 475 | return; |
|
| 476 | } |
|
| 477 | ||
| 478 | $this->response->body('{"message": "error"}'); |
|
| 479 | return; |
|
| 480 | } |
|
| 481 | ||
| 482 | public function inactiveParent($id_parente) |
|
| 483 | { |
|