educar_fonte_xml.php
989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
header( 'Content-type: text/xml' );
require_once( "include/clsBanco.inc.php" );
require_once( "include/funcoes.inc.php" );
require_once 'Portabilis/Utils/DeprecatedXmlApi.php';
Portabilis_Utils_DeprecatedXmlApi::returnEmptyQueryUnlessUserIsLoggedIn();
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<query xmlns=\"sugestoes\">\n";
if( is_numeric( $_GET["bib"] ) )
{
$db = new clsBanco();
$db->Consulta( "
SELECT
cod_fonte
, nm_fonte
FROM
pmieducar.fonte
WHERE
ativo = 1
AND ref_cod_biblioteca = '{$_GET["bib"]}'
ORDER BY
nm_fonte ASC
");
if ($db->numLinhas())
{
while ( $db->ProximoRegistro() )
{
list( $cod, $nome ) = $db->Tupla();
echo " <fonte cod_fonte=\"{$cod}\" >{$nome}</fonte>\n";
}
}
}
echo "</query>";
?>