Jump to content
Fórum Script Brasil
  • 0

Paginação PHP O.O + Mysql



Galera eu to criando um portal de noticias, onde vou fazer o upload por um formulário, e o mesmo tem que jogar a imagem pra uma pasta, e salvar o caminho no banco de dados.


class Home {

    public function run() {

        $html_home = new Html();
        $html = $html_home->load('view/home.html');

        $tcomunicados = '';
        $taniver = '';

        $tdados = Connection::select("select * from comunicados limit 3");
        foreach ($tdados as $reg) {
            $tcomunicados .= '<TR>
		<TD ROWSPAN=9 HEIGHT="auto" STYLE="border-top: 1px solid #f1f1f1;" class="text-center"><img src="' . $reg['imagem'] . '" width="150"></img></TD>
		<TD COLSPAN=5 VALIGN=MIDDLE STYLE="border-top: 1px solid #f1f1f1; border-bottom: 1px solid #f1f1f1;">' . $reg['titulo'] . '</TD>
		<TD COLSPAN=2><small><cite>' . $reg['por'] . '</cite></small></TD>
		<TD COLSPAN=2><em><small class="subheader">' . $reg['data'] . '</small></em></TD>
                <TD COLSPAN=5 ROWSPAN=6>' . $reg['comunicado'] . '</TD>

        $tdados2 = Connection::select("SELECT * FROM aniversarios");
        foreach ($tdados2 as $reg) {
            $taniver .= '<TR>
		<td BGCOLOR="#FFD700" STYLE="border-bottom: 1px solid #f1f1f1" HEIGHT="15" ALIGN="LEFT"><span><font size=2 color="#006400" ><b>' . $reg['data'] . '</span> - 
		<span><font size=2 color="#006400">' . $reg['nome'] . '</span>, 
		<span><font size=2 color="#006400">' . $reg['funcao'] . '</span> - 
		<span><font size=2 color="#006400">' . $reg['filial'] . '</span></td>

        $html = str_replace('#TCOMUNICADOS#', $tcomunicados, $html);
        $html = str_replace('#TANIVER#', $taniver, $html);

        return $html;



Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...