| @@ 314-326 (lines=13) @@ | ||
| 311 | ||
| 312 | public function getTicketDiagnosis($id = null, $var = null, $context = null) { |
|
| 313 | switch ($context) { |
|
| 314 | case 'qa': |
|
| 315 | $response = json_decode($this->getRepairTicket($id, 'qa_diagnosis'), true); |
|
| 316 | if ($response) { |
|
| 317 | if ($var) { |
|
| 318 | foreach ($response as $key => $value) { |
|
| 319 | if ($key == $var) { |
|
| 320 | return $value; |
|
| 321 | } |
|
| 322 | } |
|
| 323 | } else { |
|
| 324 | return $response; |
|
| 325 | } |
|
| 326 | } |
|
| 327 | case 'pre': |
|
| 328 | $response = json_decode($this->getRepairTicket($id, 'pre_diagnosis'), true); |
|
| 329 | if ($response) { |
|
| @@ 327-339 (lines=13) @@ | ||
| 324 | return $response; |
|
| 325 | } |
|
| 326 | } |
|
| 327 | case 'pre': |
|
| 328 | $response = json_decode($this->getRepairTicket($id, 'pre_diagnosis'), true); |
|
| 329 | if ($response) { |
|
| 330 | if ($var) { |
|
| 331 | foreach ($response as $key => $value) { |
|
| 332 | if ($key == $var) { |
|
| 333 | return $value; |
|
| 334 | } |
|
| 335 | } |
|
| 336 | } else { |
|
| 337 | return $response; |
|
| 338 | } |
|
| 339 | } |
|
| 340 | case 'post': |
|
| 341 | $response = json_decode($this->getRepairTicket($id, 'post_diagnosis'), true); |
|
| 342 | if ($response) { |
|
| @@ 340-352 (lines=13) @@ | ||
| 337 | return $response; |
|
| 338 | } |
|
| 339 | } |
|
| 340 | case 'post': |
|
| 341 | $response = json_decode($this->getRepairTicket($id, 'post_diagnosis'), true); |
|
| 342 | if ($response) { |
|
| 343 | if ($var) { |
|
| 344 | foreach ($response as $key => $value) { |
|
| 345 | if ($key == $var) { |
|
| 346 | return $value; |
|
| 347 | } |
|
| 348 | } |
|
| 349 | } else { |
|
| 350 | return $response; |
|
| 351 | } |
|
| 352 | } |
|
| 353 | } |
|
| 354 | } |
|
| 355 | ||