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