$row = pg_fetch_array($result); $count = $row['count']; if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } $SQL = "SELECT id_interesse, descricao FROM areainteresse ORDER BY descricao"; $result = pg_query($SQL) or die("Couldn t execute query." . pq_last_error()); if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml")) { header("Content-type: application/xhtml+xml;charset=utf-8"); } else { header("Content-type: text/xml;charset=utf-8"); } echo "<?xml version='1.0' encoding='utf-8'?>"; echo "<rows>"; echo "<page>" . $page . "</page>"; echo "<total>" . $total_pages . "</total>"; echo "<records>" . $count . "</records>"; while ($row = pg_fetch_array($result)) { echo "<row id='" . $row[id_interesse] . "'>"; echo "<cell>" . $row[descricao] . "</cell>"; echo "</row>"; }
$count = $row['count']; //echo $count; if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } $SQL = "SELECT id_projeto, descricao FROM ProjetosPesquisa WHERE (doc_matricula='12310488') ORDER BY id_projeto "; $result = pg_query($SQL) or die("A consulta aos projetos de pesquisa do docente não pode ser realizada." . pq_last_error()); if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml")) { header("Content-type: application/xhtml+xml;charset=utf-8"); } else { header("Content-type: text/xml;charset=utf-8"); } echo "<?xml version='1.0' encoding='utf-8'?>"; echo "<rows>"; echo "<page>" . $page . "</page>"; echo "<total>" . $total_pages . "</total>"; echo "<records>" . $count . "</records>"; while ($row = pg_fetch_array($result)) { echo "<row id='" . $row[id_projeto] . "'>"; echo "<cell>" . $row[descricao] . "</cell>"; echo "</row>"; }
//echo $count; if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } /* Chama a FuncFormataData (implementada no banco) para formatar a data */ $SQL = "SELECT id_grade, FuncFormataData(dt_implantacao) AS dt_implantacao FROM GradeCurricular ORDER BY dt_implantacao"; $result = pg_query($SQL) or die("A consulta a grade não foi realizada com sucesso." . pq_last_error()); if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml")) { header("Content-type: application/xhtml+xml;charset=utf-8"); } else { header("Content-type: text/xml;charset=utf-8"); } echo "<?xml version='1.0' encoding='utf-8'?>"; echo "<rows>"; echo "<page>" . $page . "</page>"; echo "<total>" . $total_pages . "</total>"; echo "<records>" . $count . "</records>"; while ($row = pg_fetch_array($result)) { echo "<row id='" . $row[id_grade] . "'>"; echo "<cell>" . "Grade " . $row[id_grade] . "</cell>"; echo "<cell>" . $row[dt_implantacao] . "</cell>"; echo "</row>";