From 90519d645394b4ce86aa5784b1e4c2e330b59c34 Mon Sep 17 00:00:00 2001 From: Caroline Salib Date: Mon, 10 Jul 2017 20:55:09 -0300 Subject: [PATCH] Corrigido bug ao converter para ascii na busca de alunos; portabilis/ieducar#194 --- ieducar/intranet/include/pmieducar/clsPmieducarAluno.inc.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ieducar/intranet/include/pmieducar/clsPmieducarAluno.inc.php b/ieducar/intranet/include/pmieducar/clsPmieducarAluno.inc.php index 0b2a2fc..794d925 100644 --- a/ieducar/intranet/include/pmieducar/clsPmieducarAluno.inc.php +++ b/ieducar/intranet/include/pmieducar/clsPmieducarAluno.inc.php @@ -542,7 +542,7 @@ class clsPmieducarAluno cadastro.pessoa WHERE cadastro.pessoa.idpes = ref_idpes - AND TO_ASCII(LOWER(nome)) LIKE TO_ASCII(LOWER('%{$str_nome_aluno}%')) + AND LOWER(nome) LIKE LOWER('%{$str_nome_aluno}%') )"; $whereAnd = ' AND '; @@ -552,14 +552,14 @@ class clsPmieducarAluno $and_resp = ''; if (is_string($str_nome_responsavel)) { - $and_nome_pai_mae = "OR UPPER(TO_ASCII(aluno.nm_pai)) LIKE UPPER(TO_ASCII('%$str_nome_responsavel%')) AND (aluno.tipo_responsavel = 'p')"; + $and_nome_pai_mae = "OR UPPER((aluno.nm_pai)) LIKE UPPER(('%$str_nome_responsavel%')) AND (aluno.tipo_responsavel = 'p')"; - $and_nome_pai_mae .= "OR UPPER(TO_ASCII(aluno.nm_mae)) LIKE UPPER(TO_ASCII('%$str_nome_responsavel%')) AND (aluno.tipo_responsavel = 'm')"; + $and_nome_pai_mae .= "OR UPPER((aluno.nm_mae)) LIKE UPPER(('%$str_nome_responsavel%')) AND (aluno.tipo_responsavel = 'm')"; $and_nome_resp = " - (UPPER(TO_ASCII(pai_mae.nome)) LIKE UPPER(TO_ASCII('%$str_nome_responsavel%'))) AND (aluno.tipo_responsavel = 'm') AND pai_mae.idpes = fisica_aluno.idpes_mae + (UPPER((pai_mae.nome)) LIKE UPPER(('%$str_nome_responsavel%'))) AND (aluno.tipo_responsavel = 'm') AND pai_mae.idpes = fisica_aluno.idpes_mae OR - (UPPER(TO_ASCII(pai_mae.nome)) LIKE UPPER(TO_ASCII('%$str_nome_responsavel%'))) AND (aluno.tipo_responsavel = 'p') AND pai_mae.idpes = fisica_aluno.idpes_pai"; + (UPPER((pai_mae.nome)) LIKE UPPER(('%$str_nome_responsavel%'))) AND (aluno.tipo_responsavel = 'p') AND pai_mae.idpes = fisica_aluno.idpes_pai"; $and_resp = ' AND '; } @@ -610,12 +610,12 @@ class clsPmieducarAluno } if (is_string($str_nm_pai)) { - $filtros .= "{$whereAnd} TO_ASCII(LOWER(nm_pai)) nm_pai LIKE TO_ASCII(LOWER('%{$str_nm_pai}%'))"; + $filtros .= "{$whereAnd} (LOWER(nm_pai)) nm_pai LIKE (LOWER('%{$str_nm_pai}%'))"; $whereAnd = ' AND '; } if (is_string($str_nm_mae)) { - $filtros .= "{$whereAnd} TO_ASCII(LOWER(nm_mae)) LIKE TO_ASCII(LOWER('%{$str_nm_mae}%'))"; + $filtros .= "{$whereAnd} (LOWER(nm_mae)) LIKE (LOWER('%{$str_nm_mae}%'))"; $whereAnd = ' AND '; } @@ -768,7 +768,7 @@ class clsPmieducarAluno cadastro.pessoa WHERE cadastro.pessoa.idpes = ref_idpes - AND TO_ASCII(LOWER(nome)) LIKE TO_ASCII(LOWER('%{$str_nome_aluno}%')) + AND (LOWER(nome)) LIKE (LOWER('%{$str_nome_aluno}%')) )"; $whereAnd = ' AND '; @@ -778,14 +778,14 @@ class clsPmieducarAluno $and_resp = ''; if (is_string($str_nome_responsavel)) { - $and_nome_pai_mae = "OR UPPER(TO_ASCII(aluno.nm_pai)) LIKE UPPER(TO_ASCII('%$str_nome_responsavel%')) AND (aluno.tipo_responsavel = 'p')"; + $and_nome_pai_mae = "OR UPPER((aluno.nm_pai)) LIKE UPPER(('%$str_nome_responsavel%')) AND (aluno.tipo_responsavel = 'p')"; - $and_nome_pai_mae .= "OR UPPER(TO_ASCII(aluno.nm_mae)) LIKE UPPER(TO_ASCII('%$str_nome_responsavel%')) AND (aluno.tipo_responsavel = 'm')"; + $and_nome_pai_mae .= "OR UPPER((aluno.nm_mae)) LIKE UPPER(('%$str_nome_responsavel%')) AND (aluno.tipo_responsavel = 'm')"; $and_nome_resp = " - (UPPER(TO_ASCII(pai_mae.nome)) LIKE UPPER(TO_ASCII('%$str_nome_responsavel%'))) AND (aluno.tipo_responsavel = 'm') AND pai_mae.idpes = fisica_aluno.idpes_mae + (UPPER((pai_mae.nome)) LIKE UPPER(('%$str_nome_responsavel%'))) AND (aluno.tipo_responsavel = 'm') AND pai_mae.idpes = fisica_aluno.idpes_mae OR - (UPPER(TO_ASCII(pai_mae.nome)) LIKE UPPER(TO_ASCII('%$str_nome_responsavel%'))) AND (aluno.tipo_responsavel = 'p') AND pai_mae.idpes = fisica_aluno.idpes_pai"; + (UPPER((pai_mae.nome)) LIKE UPPER(('%$str_nome_responsavel%'))) AND (aluno.tipo_responsavel = 'p') AND pai_mae.idpes = fisica_aluno.idpes_pai"; $and_resp = 'AND'; } @@ -835,12 +835,12 @@ class clsPmieducarAluno } if (is_string($str_nm_pai)) { - $filtros .= "{$whereAnd} TO_ASCII(LOWER(nm_pai)) nm_pai LIKE TO_ASCII(LOWER('%{$str_nm_pai}%'))"; + $filtros .= "{$whereAnd} (LOWER(nm_pai)) nm_pai LIKE (LOWER('%{$str_nm_pai}%'))"; $whereAnd = ' AND '; } if (is_string($str_nm_mae)) { - $filtros .= "{$whereAnd} TO_ASCII(LOWER(nm_mae)) LIKE TO_ASCII(LOWER('%{$str_nm_mae}%'))"; + $filtros .= "{$whereAnd} (LOWER(nm_mae)) LIKE (LOWER('%{$str_nm_mae}%'))"; $whereAnd = ' AND '; } -- libgit2 0.21.2