|
@@ 59-82 (lines=24) @@
|
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
$this->loginClient($dados); |
| 59 |
|
} else if ($type->is('put')) { |
| 60 |
|
|
| 61 |
|
$dados = $this->request->data; |
| 62 |
|
|
| 63 |
|
if (empty($dados)) { |
| 64 |
|
$this->response->body(json_encode(array('message' => 'Ocorreu algum erro com os parametros passados'))); |
| 65 |
|
return; |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
if ($id_cliente == null) { |
| 69 |
|
$this->response->body(json_encode(array('message' => 'Você não passou o id do usuario'))); |
| 70 |
|
return; |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
$this->putClient($dados, $id_cliente); |
| 74 |
|
} else if ($type->is('delete')) { |
| 75 |
|
|
| 76 |
|
if ($id_cliente == null) { |
| 77 |
|
$this->response->body(json_encode(array('message' => 'Você não passou o id do usuario'))); |
| 78 |
|
return; |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
$this->inactiveClient($id_cliente); |
| 82 |
|
} |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
public function parent($id_cliente = null, $id_parente = null) |
|
@@ 133-156 (lines=24) @@
|
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
$this->loginParent($dados); |
| 133 |
|
} else if ($type->is('put')) { |
| 134 |
|
|
| 135 |
|
$dados = $this->request->data; |
| 136 |
|
|
| 137 |
|
if (empty($dados)) { |
| 138 |
|
$this->response->body(json_encode(array('message' => 'Ocorreu algum erro com os parametros passados'))); |
| 139 |
|
return; |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
if ($id_parente == null) { |
| 143 |
|
$this->response->body(json_encode(array('message' => 'Você não passou o id do usuario'))); |
| 144 |
|
return; |
| 145 |
|
} |
| 146 |
|
|
| 147 |
|
$this->putParent($dados, $id_parente); |
| 148 |
|
} else if ($type->is('delete')) { |
| 149 |
|
|
| 150 |
|
if ($id_parente == null) { |
| 151 |
|
$this->response->body(json_encode(array('message' => 'Você não passou o id do usuario'))); |
| 152 |
|
return; |
| 153 |
|
} |
| 154 |
|
|
| 155 |
|
$this->inactiveClient($id_parente); |
| 156 |
|
} |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
public function occurrences($id_cliente = null) |