<?php
/**
* Classe Para Pegar arquivos e Links no Banco de Dados
* @package Funcoes.inc
* @author Ramon Vicente
* @copyright 2009 - Ramon Vicente
*/
class materia {
/**
* Funcao _materia() Seleciona a Materia Pelo Parametro
* Se For Buscado Corretamente Retorna Os arquivos e Links
*/
function _materia($bd,$materia){
//Query para Pegar dados
$sql = "SELECT * FROM ARQUIVOS WHERE MATERIA='".$materia."'";
//Execulta a Query
$rs = $bd->Execute( $sql );
// Se Nao For Encontrado Nenhum Arquivo Retorna a Msg de Erro
if($rs->RecordCount() == 0)
echo '<h1 align=center style=color:#F00;>Nenhum Arquivo Encontrado!!</h1>';
// Se Tiver Arquivos Continua a Funcao
else
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tr align="center">
<td width="150"><strong>Arquivo </strong></td>
<td width="120"><strong>Data</strong></td>
<td width="108"><strong>Downloads</strong></td>
</tr>';
//Realisa o Loop e Retorna as Linhas dos Arquivos
while (! $rs->EOF){
<tr align="center">
<td><a href="?i=download&id='.$rs->fields['Id'].'">'.$rs->fields['Arquivo'].'</a></td>
<td>'.$rs->fields['Data'].'</td>
<td>'.$rs->fields['clicks'].'</td>
</tr>';
$rs->movenext(); //Funcao ADODB que Move Para o Proximo Registro
}
} //Fecha funcao _materia
}//Fecha Classe materia
?>