include("../../../archivos/funciones.php");
function listaTemas()
{
conexion_relpub();
$tabla = "";
$sql = "select t.codigo_tema,
t.tema
from tema t,
librosnuevos l
where t.codigo_tema = l.codigo_tema
and datediff(day, l.fecha, getdate()) between 0 and 30
group by t.codigo_tema, t.tema
order by t.tema";
//echo $sql;
$result = mssql_query($sql);
for ($i = 0; $i < mssql_num_rows( $result ); ++$i)
{
$row = mssql_fetch_row($result);
$tabla = $tabla . "
$row[1]
".librosPorTema($row[0])."
";
}
return $tabla;
}
//--------------------------------------------------------------------------------------------
function librosPorTema($x)
{
conexion_relpub();
$sql = "select ln.cut, ct.cautor, ct.ctitulo, ln.raiting, ct.nIdCatalogo
from librosnuevos ln,
sab3.dbo.catalogo ct
where ct.ccatalogo = ln.cut
and ln.codigo_tema = $x
and dateDiff(day, ln.fecha, GetDate()) between 0 and 30
order by ln.codigo_tema, ct.cautor, ct.ctitulo";
//echo $sql;
$result = mssql_query($sql);
$tabla = "