data listing

0

It is only printing the first row of the database and I want it to print all the lines.

<?php
    @session_start();
    include_once $_SERVER['DOCUMENT_ROOT'] . '/PlanejamentoEstrategico/model/indoperacionais/Indoperacionais.php';
?>

    <html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="distribution" content="Private">
        <meta name="rating" content="Sistema">
        <meta name="copyright" content="UnimedMamanaus">
        <title>Planilha de Indicadores Operacionais</title>
        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        <style type="text/css">.texto {color:#006400;}
        </style>
        <center><h2><p class="texto">PAINEL DE INDICADORES OPERACIONAIS UNIMED MANAUS</p></h2></center>
        <body>
        <h2>&nbsp;&nbsp;Formulario para Avaliacao Mensal - 2015 - 2016</h2>
        <h3>&nbsp;&nbsp;Area de Gestao de Pessoas</h3>
        <div class="sheet"></div>
        </div><center> 
       <style type="text/css">
       body {
    background-color: Very Light Grey ;
}
     h2 {
     border-width: medium;
     border-style: solid;
     border-color: #FFFFFF;
     background-color: Very Light Grey  ;
     }
     h3 {
     border-width: medium;
     border-style: solid;
     border-color: #DCDCDC;
     background-color: OliveDrab  ;
     }
     td {
         background-color: Silver   ;
     }
    tr {
         background-color: LightGray    ;
     }

       <div class='report'>

   </style>
  </head>
        <table border="2">
    <thead>

 <tr>
   <th>nome</th>
   <th>indicadores</th>
    <th>responvel</th>
    <th>metas</th>
</tr>
<tr>

<?php
    $ano        = $_POST["ano"];

    //Instanciando a classe
    $_model = new model_Indoperacionais();
    $_indoperacionais = $_model->RetornaIndoperacionais($ano);
     foreach($_indoperacionais as  $value){
        echo '<td>'.$value.'</td>';

     }



    ?>


 </tr>
    </table>
    </thead>

            </center>
        </div>
    </body>
</html>



class model_Indoperacionais extends MysqlConnection{


    private $indoperacionais;

    public function RetornaIndoperacionais($ano){

   if($_POST["ano"] == '2016'){
        $_indoperacional = "/pla_est_2016";
    }else{
        $_indoperacional = "/pla_est";
    }

        $Query = ("SELECT nome,indicadores,responsavel,metas FROM 'iniciativas'"); 


        //while ($_indoperacionais = mysql_fecth_array($Query));
        try{
            $this->search = $this->MySql->prepare($Query);
            $this->search->bindValue(":nome", $this->indoperacionais);
            $this->search->execute();

        } catch(PDOExeption $e) {
            die($e->getMessage());
        }

        $_result = $this->search->fetch(PDO::FETCH_ASSOC);
        //print_r($_result); exit;
         return $_result ;
           //print_r($_result);
           //return (_result)
    }
}
    
asked by anonymous 22.08.2016 / 20:54

0 answers