$typeCount[$i]++; } } } } for ($i = 0; $i < count($type); $i++) { $data[] = array('y' => $type[$i], 'a' => $typeCount[$i]); } echo json_encode($data); break; case 'detalOpnionPerson': $get = $_POST['type']; $typeGood = array('Honesto', 'Comprometido', 'Persistente', 'Companheiro', 'NDA'); $typeBad = array('Pontualidade', 'Hipocrita', 'Falso', 'Interesseiro', 'NDA'); $typeAll = array('Honesto', 'Comprometido', 'Persistente', 'Companheiro', 'Pontualidade', 'Hipocrita', 'Falso', 'Interesseiro', 'NDA'); $persons = Resident::getResidents(); if ($get == 'good') { $type = $typeGood; } if ($get == 'bad') { $type = $typeBad; } if ($get == 'all') { $type = $typeAll; } for ($i = 0; $i < count($type); $i++) { $typeCount[$i] = 0; if ($persons) { foreach ($persons as $opnion) { if ($opnion->getResearch()) { $opnion = explode(';', $opnion->getResearch()->getOpnionAdventista());
<div class="table-responsive"> <table class="table table-striped table-bordered table-hover dataTables-example"> <thead> <tr> <th>ID</th> <th>Nome</th> <th>Email</th> <th>Religião</th> <th>Idade</th> <th>Ação</th> </tr> </thead> <tbody> <?php if (Resident::getResidents() != '') { foreach (Resident::getResidents() as $res) { echo '<tr>'; echo '<td>' . $res->getId() . '</td>'; echo '<td>' . '<a class="modalResident" data-id="' . $res->getId() . '" >' . $res->getName() . '</a>' . '</td>'; echo '<td>' . $res->getEmail() . '</td>'; echo '<td>' . $res->getReligion()->getName() . '</td>'; echo '<td>' . $res->getAge() . '</td>'; echo '<td>' . '<a href="forms.php?p=altMorador&cod=' . $res->getId() . '"><i class="icon-pencil"></i>Editar</a>' . ' | '; if (Research::existResearch($res->getId())) { echo '<i class="icon icon-check" style="color: green"></i> Pesquisa Realizada'; } else { echo '<a href="forms.php?p=cadPesquisa&cod=' . $res->getId() . '"><i class="icon-edit" style="color: red"></i>Realizar Pesquisa</a>'; } echo '</td>'; echo '</tr>'; }