| @@ 353-369 (lines=17) @@ | ||
| 350 | return true; |
|
| 351 | } |
|
| 352 | ||
| 353 | public function putClient($dados, $id_cliente) |
|
| 354 | { |
|
| 355 | if ($dados['senha'] != '') { |
|
| 356 | $dados['senha'] = sha1($dados['senha']); |
|
| 357 | } |
|
| 358 | ||
| 359 | $this->Cliente->id = $id_cliente; |
|
| 360 | $this->Cliente->id_usuario = $this->getIdUser(); |
|
| 361 | ||
| 362 | if ($this->Cliente->save($dados)) { |
|
| 363 | $this->response->body('{"message": "success", "result": '. json_encode($dados) .'}'); |
|
| 364 | return; |
|
| 365 | } |
|
| 366 | ||
| 367 | $this->response->body('{"message": "error"}'); |
|
| 368 | return; |
|
| 369 | } |
|
| 370 | ||
| 371 | public function inactiveClient($id_cliente) |
|
| 372 | { |
|
| @@ 430-446 (lines=17) @@ | ||
| 427 | return; |
|
| 428 | } |
|
| 429 | ||
| 430 | public function putParent($dados, $id_parente) |
|
| 431 | { |
|
| 432 | if ($dados['senha'] != '') { |
|
| 433 | $dados['senha'] = sha1($dados['senha']); |
|
| 434 | } |
|
| 435 | ||
| 436 | $this->Parente->id = $id_parente; |
|
| 437 | $this->Parente->id_usuario = $this->getIdUser(); |
|
| 438 | ||
| 439 | if ($this->Parente->save($dados)) { |
|
| 440 | $this->response->body('{"message": "success", "result": '. json_encode($dados) .'}'); |
|
| 441 | return; |
|
| 442 | } |
|
| 443 | ||
| 444 | $this->response->body('{"message": "error"}'); |
|
| 445 | return; |
|
| 446 | } |
|
| 447 | ||
| 448 | public function inactiveParent($id_parente) |
|
| 449 | { |
|