SHARE
TWEET

????

a guest Nov 28th, 2016 34 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.    
  3.     include 'security/conn.php';
  4.     include 'utils/parseToUtf8.php';
  5.     // Definindo qual query será executada, com ou sem filtro
  6.  
  7.        
  8.     $origem = $_GET['origem'];
  9.     $projeto = $_GET['projeto'];
  10.  
  11.     $query_status_demanda = "SELECT mantis_bug_table.version  AS VERSAO,
  12.        CASE WHEN mantis_bug_table.version <> ''
  13.        THEN REPLACE(mantis_bug_table.version,'.','')
  14.        END AS VERSAOSEMPONTO,
  15.        CASE WHEN mantis_bug_table.status IN (10,20,30,50)
  16.             THEN 'EM EXECUÇÃO'
  17.             ELSE 'CONCLUÍDO'
  18.        END AS DESCRICAO,
  19.        COUNT(mantis_bug_table.id) AS QUANTIDADE FROM dbmantis_bugs.mantis_bug_table
  20.        INNER JOIN dbmantis_bugs.mantis_custom_field_string_table
  21.                ON (mantis_bug_table.id = mantis_custom_field_string_table.bug_id)
  22.        WHERE (mantis_custom_field_string_table.value = '$origem')
  23.        AND (mantis_bug_table.project_id = $projeto)
  24.        GROUP BY mantis_bug_table.version, DESCRICAO
  25.        ORDER BY mantis_bug_table.version ASC,
  26.    STATUS ASC";
  27.  
  28.  
  29.     function getstatusDemanda($conn, $query_status_demanda){
  30.        
  31.         if (!$result = $conn->query($query_status_demanda)) {
  32.             echo '
  33.                 <script>
  34.                     alert("Erro ao executar a query de status demanda.");
  35.                 </script>
  36.             ';
  37.             $result->close();
  38.         }
  39.         // DATA CATCH statusS
  40.         while($row = $result->fetch_array(MYSQL_ASSOC)) {
  41.             $rows[]=$row;
  42.         }
  43.  
  44.         //$result_status_demanda = parseToUtf8($rows);
  45.         if(isset($rows)){
  46.           $result_status_demanda = json_encode($rows);
  47.           $result->close();
  48.         }else{
  49.             $result_status_demanda = null;
  50.         }
  51.  
  52.         return $result_status_demanda;
  53.     }
  54.  
  55.     print getstatusDemanda($conn, $query_status_demanda);
  56.  
  57.     $conn->close();
  58. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top