Пример #1
0
 public function removerAssociacaoID($id)
 {
     try {
         $associacao = new BDAssociacao();
         $res = $associacao->removerAssociacao($id);
         return $res;
     } catch (Exception $ex) {
         echo "Erro: {$ex}";
     }
 }
Пример #2
0
 public function pdfListarOngCidadao($id)
 {
     try {
         $obj = new BDAssociacao();
         $busca = $obj->buscarassociacaoID($id)->fetch(PDO::FETCH_OBJ);
         $mpdf = new mPDF();
         $mpdf->allow_charset_conversion = true;
         // Gerando conteúdo do PDF
         ob_start();
         $html = ob_get_clean();
         $html = utf8_encode($html);
         $html .= "<table class='table'>";
         $html .= "<thead>";
         $html .= "<tr>";
         $html .= "<th> ID </th>";
         $html .= "<td> CPF </th>";
         $html .= "<td> RG </th>";
         $html .= "<td> CNH </td>";
         $html .= "<th> Nome </th>";
         $html .= "<th> Endereço </th>";
         $html .= "<th> Bairro </th>";
         $html .= "<th> E-Mail </th>";
         $html .= "<th> Telefone </th>";
         $html .= "<th> Observações </th>";
         $html .= "</tr>";
         $html .= "</thead>";
         $html .= "<tbody>";
         $lista = $this->listarOngCidadaoID($id)->fetchAll(PDO::FETCH_OBJ);
         foreach ($lista as $linha) {
             $html .= "<tr>";
             $html .= "<td> {$linha->id_cidadao} </td>";
             $html .= "<td> {$linha->nome_cidadao} </td>";
             $html .= "<td> {$linha->cpf_cidadao} </td>";
             $html .= "<td> {$linha->rg_cidadao} </td>";
             $html .= "<td> {$linha->cnh_cidadao} </td>";
             $html .= "<td> {$linha->rua_cidada} </td>";
             $html .= "<td> {$linha->bairro_cidadao} </td>";
             $html .= "<td> {$linha->telefone1_cidadao} </td>";
             $html .= "<td> {$linha->email_cidadao}</td>";
             $html .= "<td> {$linha->info_cidadao} </td>";
             $html .= "</tr>";
         }
         $html .= "</tbody>";
         $html .= "</table>";
         $mpdf->WriteHTML($html);
         $mpdf->Output('lista cidadãos da associação : ' . $busca->nome_associacao_moradores . '-' . date("d-m-y") . '.pdf', 'D');
         header("Location : listaAssociacao.php");
         exit;
     } catch (Exception $ex) {
         echo "Erro: {$ex}";
     }
 }