function viewNote() { $sNoteId = trim(getParameter('view_note_id')); if ($sNoteId == '' || is_null($sNoteId)) { $response = 'Không có note id!'; $json = new Services_JSON(); Header('Content-Type: application/json'); return $json->encode($response); } global $arrConf; $oCustomer = new getInfoMainConsole(); $oCustomer->callcenter_db_connect($arrConf['cadena_dsn']); $result = $oCustomer->getNote($sNoteId); $oCustomer->callcenter_db_disconnect(); // return json if (!$result) { $response = 'Lỗi: ' . $oCustomer->errMsg; } else { $response = $result['note']; } $json = new Services_JSON(); Header('Content-Type: application/json'); return $json->encode($response); }