function show_score($xml, $type_request)
 {
     $id = $xml->Orders->Order->ID;
     $status = $xml->Orders->Order->Status;
     $score = $xml->Orders->Order->Score;
     $parameters['entityCode'] = $this->config->get('clearsale_tg_entitycode');
     $parameters['orderID'] = $this->request->get['order_id'];
     $parameters['getAll'] = 'true';
     $clear = new SoapClient('http://www.clearsale.com.br/integracaov2/service.asmx?wsdl', array("trace" => 1, "exceptions" => 0));
     $analyst = $clear->GetAnalystComments($parameters);
     $xml_analyst = $analyst->GetAnalystCommentsResult;
     $xml_xml_analyst = simplexml_load_string(str_replace('<?xml version="1.0" encoding="utf-16"?>', '', $xml_analyst));
     if ($type_request == 0) {
         $type = 'Nova Consulta';
     }
     if ($type_request == 1) {
         $type = 'Reanalise';
     }
     if ($type_request == 2) {
         $type = 'Reenvio';
     }
     if (strlen($id) > 0) {
         $return_status = explode(':', $this->getStatus($status));
         $status_msg = '';
         if (isset($return_status[0]) && $return_status[0]) {
             $status_msg = $return_status[0];
         }
         $note = '';
         if (isset($return_status[1]) && $return_status[1]) {
             $note = $return_status[1];
         }
         $table = '<table class="table-responsive" cellspacing="10" style="background-color:' . $this->getColorStatus($status) . '; border:1px solid #ccc;font-family:Arial , Verdana;"><tr><td><b>Solicitação:</b> ' . $type . '</td></tr><tr><td ><b>Pedido:</b> ' . $id . '</td></tr><tr><td ><b>Status:</b> <a style="cursor:help; text-decoration:underline; color:#888; font-weight:bold;" title="' . $note . '">' . $status_msg . '</a></td></tr>';
         if (isset($score) && $score > 0) {
             $table .= '<tr><td ><b>Score:</b> ' . $score . '</td></tr>';
         }
         if (isset($xml_xml_analyst->AnalystComments) && $xml_xml_analyst->AnalystComments > 0) {
             $table .= '<tr><td ><b>Comentários:</b> ' . $xml_xml_analyst->AnalystComments . '</td></tr>';
         }
         $table .= '</table>';
     } else {
         $table = '<table style="background-color:' . $this->getColorStatus($status) . '" cellpadding="5" style="border:1px solid #ccc;font-family:Trebuchet MS, Arial, Helvetica, sans-serif"><tr><td ><b>Error:</b> ' . $xml->StatusCode . ' - ' . $xml->Message . '</td></tr></table>';
     }
     exit($table);
 }