How to remove error Parse error: syntax error, unexpected 'public'

0

Hello, I would like to know how I can get this error out of my query

<?phppublicfunctionRetornaAtualizacoes(){if($_SERVER['REQUEST_METHOD']=='POST'){try{$Query="SELECT 
                s.setor,
                s.usuario,
                s.hd,
                s.memoria,
                s.cd,
                s.placam,
                s.host,
                s.monitor,
                s.nobreak,
                s.placar,
                s.placav
        FROM setor

                  ";
        include_once $_SESSION['pmodel'].'Projetos/index.php';
               $p_sql = MysqlConnection::getInstance()->prepare($Query);

                $_retorno = array(); 

                if($p_sql->execute()) {
                    while ($_result = $p_sql->fetch(PDO::FETCH_ASSOC))  {
                        $_retorno[] = $_result; 
                    }
                }

                return $_retorno;
            } catch (PDOException $e) {
                echo $e->getMessage();
            }
        }


            }
        ?>


             <div>
                <table width="100%" CELLSPACING="0" CELLPADDING="2" BORDER="1" class='tabelaProt'>
                                <thead>
                                        <tr>
                                             <th>Setor</th>
                                             <th>Usuário</th>
                                             <th>Hd</th>
                                             <th>Memória</th>
                                             <th>Processador</th>
                                             <th>Cd/Dvd</th>
                                             <th>Hd</th>
                                             <th>Memória</th>
                                             <th>Setor</th>
                                             <th>Usuário</th>
                                             <th>Hd</th>
                                             <th>Memória</th>
                                        </tr>
                                </thead>
                        <tbody>         
  <?php
               $setor=$_POST['setor'];
                $usuario=$_POST['usuario'];
                $hd=$_POST['hd'];
                $memoria=$_POST['memoria'];
                $processador=$_POST['processador'];
                $cd=$_POST['cd'];
                $placam=$_POST['placam'];
                $host=$_POST['host'];
                $monitor=$_POST['monitor'];
                $nobreak=$_POST['nobreak'];
                $placar=$_POST['placar'];
                $placav=$_POST['placav'];

         $data           = $_POST["data"];
        $codusuario     = $_POST["codusuario"];
        $cRelatorios = new cRelatorios();
          $relatorio = $cRelatorios->RetornaAtualizacoes();    

                   if(!empty($relatorio)){

                   foreach($relatorio as  $value){
              // echo "<pre>"; print_r($value); exit;
                 echo "<tr>";
                 echo "<td><center>". $value[""] ."</center></td>";
                 echo "<td><center>". $value[""] ."</center></td>";
                 echo "<td><center>". $value[""] ."</center></td>";
                echo "<td>". $value[""] ."</td>";
                echo "<td>". $value[""] ."</td>";
               echo count($relatorio);//Quero que imprima só uma vez dentro do <td>
               echo "</tr >";

                                   }
    }


     ?>
    
asked by anonymous 26.12.2016 / 16:25

0 answers