Skip to content

Commit

Permalink
Bug busca Membro erro igreja
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseilton Costa Bruce authored and Joseilton Costa Bruce committed Nov 3, 2020
1 parent 38ac7aa commit 0805973
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
31 changes: 24 additions & 7 deletions models/AutocompleteEasy.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@
$stmtIgr = $conn->prepare($igrejaArr);
$stmtIgr->execute();

$IgArray = $stmtIgr->fetchAll(PDO::FETCH_ASSOC);
$igrejas = $stmtIgr->fetchAll(PDO::FETCH_ASSOC);

// var_dump($IgArray['0']['razao']);
foreach ($igrejas as $value) {
$IgArray[$value['rol']] = $value['razao'];
}

// var_dump($IgArray);
// // exit;
// echo '<br /><br />';

$sqlOrd = $sqlSexo." ORDER BY m.nome ASC";

Expand Down Expand Up @@ -89,6 +95,9 @@

$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
// var_dump($results);
// // exit;
// echo '<br /><br />';

$data2 = array();

$json = '[';
Expand Down Expand Up @@ -156,14 +165,22 @@ function endKey($value){

if ($chave=='rol') {
$rol = $dados;
$img="img_membros/$rol.jpg";
$icon = "<img src='$img' class='img-thumbnail thumb' alt=' ' width='25' height='35' align='absmiddle' />";
$json .= ',"icon": "'.$icon .'"';
$img='../img_membros/'.$rol.'.jpg';
if (file_exists($img)) {
$icon = "<img src='$img' class='img-thumbnail thumb' alt=' ' width='25' height='35' align='absmiddle' />";
$json .= ',"icon": "'.$icon .'"';
} elseif(file_exists("../img_membros/ver_foto.png")) {
$icon = "<img src='img_membros/ver_foto.png' class='img-thumbnail' alt=' ' width='25' height='35' align='absmiddle' />";
$json .= ',"icon": "'.$icon .'"';
}else {
$icon = "<img src='img_membros/ver_foto.jpg' class='img-thumbnail' alt=' ' width='25' height='35' align='absmiddle' />";
$json .= ',"icon": "'.$icon .'"';
}
}

if ($chave=='congregacao') {
$cong = $dados - 1;
$razao = ($IgArray[$cong]['razao']=='') ? 'Falta informar igreja no cadastro' : "<span class='text-warning'>".$cargo.' &bull; '.$IgArray[$cong]['razao']."</span>" ;
$cong = $dados;
$razao = ($IgArray[$cong]=='') ? 'Falta informar igreja no cadastro' : "<span class='text-warning'>".$cargo.' &bull; '.$IgArray[$cong]."</span>" ;
$json .= ',"razao": " - '.$razao.'"';
}

Expand Down
2 changes: 1 addition & 1 deletion tesouraria/receita.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
$linkAcesso .= '&rec='.$_GET['rec'].'&idDizOf='.$idDizOf.'&igreja=';
$fin = ($_GET['fin'] < '1') ? '2' : $_GET['fin'];
$rec = (empty($_GET['rec'])) ? 0 : $_GET['rec'];
require_once 'help/tes/receitaTela.php';//Opções de exibição na tela a escolha
require_once 'help/tes/receitaTela.php';//Opções de exibição na tela a escolha
}
} else {
echo "<script> alert('Sem permissão de acesso! Entre em contato com o Tesoureiro!');location.href='../?escolha=adm/cadastro_membro.php&uf=PB';</script>";
Expand Down
7 changes: 3 additions & 4 deletions top_dados.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,16 @@ class="btn btn-default btn-sm" >&nbsp;Pr&oacute;ximo Registro&nbsp;
?>
<div class="col-xs-2"><label>&nbsp;</label>
<input type="submit" name="Submit2" class="btn btn-primary btn-sm"
value="Listar..." title="Click aqui para listar os dados do Membro"
tabindex="<?php echo ++$ind;?>" />
value="Listar..." title="Click aqui para listar os dados do Membro"
tabindex="<?php echo ++$ind;?>" />

</div>
</div>
</form>
</div>
<?php
// require_once 'forms/autocompleta.php';
if (!(strstr($_GET["escolha"], "dados_pessoais.php") || strstr($_GET["escolha"], "cartao.php")) && isset($_SESSION["membro"]))
{
if (!(strstr($_GET["escolha"], "dados_pessoais.php") || strstr($_GET["escolha"], "cartao.php")) && isset($_SESSION["membro"])) {
echo 'Membro: '.$membro->nome().' - Cargo: '.cargo($bsc_rol).' - Congrega: '.$igreja->razao();
} elseif (empty($_GET['bsc_rol']) && $_GET['bsc_rol']<=0 ) {
?>
Expand Down

0 comments on commit 0805973

Please sign in to comment.