function enableDelivery() { $response = array('action' => 'disableDelivery', 'message' => 'Bật yêu cầu giao vé thành công! Tìm lại để cập nhật kết quả'); // get parameter $sDelivery_id = trim(getParameter('delivery_id')); global $arrConf; $oCustomer = new getInfoMainConsole(); $oCustomer->callcenter_db_connect($arrConf['cadena_dsn']); //check permission $result = $oCustomer->checkDeliveryPermission($sDelivery_id, $_SESSION['callcenter']['extension']); if (!$result) { $oCustomer->callcenter_db_disconnect(); $response['action'] = 'error'; $response['message'] = 'Không có quyền chỉnh sửa!'; $json = new Services_JSON(); Header('Content-Type: application/json'); return $json->encode($response); } // call function to disable ticket $result = $oCustomer->enableDelivery($sDelivery_id); $oCustomer->callcenter_db_disconnect(); // return json if (!$result) { $response['action'] = 'error'; $response['message'] = 'Lỗi: ' . $oDelivery->errMsg; } $json = new Services_JSON(); Header('Content-Type: application/json'); return $json->encode($response); }