Location: PHPKode > projects > Course-manager > courseman-0.1.1/vorhandene-kurse.php
<?php
  header('Cache-Control: no-store');
  header('Content-type: text/xml; charset=utf-8');
  require('local-criteria.php');
  require('global-php.php');
  $verbindung = database_connection(
  	      "<status>" . $lang_database_failure[$language] . "</status>");
  $PHP_AUTH_USER = $_SERVER["PHP_AUTH_USER"];
  $PHP_AUTH_PW = $_SERVER["PHP_AUTH_PW"];
  $ergebnis = db_exec($verbindung,
  			"SELECT * FROM staff_authorization,superuser "
  				. "WHERE staff_authorization.id="
				. "superuser.account "
				. "AND "
				. login_query_clauses(
					$PHP_AUTH_USER,
					$PHP_AUTH_PW)
				. ";");
  if (pg_numrows($ergebnis) < 1) {
    header('WWW-Authenticate: Basic realm="Kursverwaltung"');
    header("HTTP/1.0 401 Unauthorized");
    echo '<status>' . $lang_authentication_failure[$language] . '</status>';
    exit;
  }
?>
<account>
<?php
  $kategorie = intval($_REQUEST["kategorie"]);
  $course_period = option_value($course_period_option);
  $ergebnis = db_exec($verbindung,
  			"SELECT '<category>'||xml_string(category.name)"
				. "||'</category>
','<topic>'||xml_string(course.name)||'</topic>
','<date>'||xml_string($course_date_readable.description)||'</date>
','<id>'||$course_date_readable.id||'</id>
',("
				. "SELECT '<disabled/>' "
				. "FROM disabled_course "
				. "WHERE disabled=$course_date_readable.id)"
				. " FROM category,course,"
				. ($course_date_translated ? "language," : "")
				. "$course_date_readable "
				. "WHERE course_period=$course_period "
				. "AND category=category.id "
				. "AND (category=$kategorie "
				. "OR $kategorie=-1) "
				. "AND $course_date_readable.course=course.id "
				. "AND $course_date_readable.course=course.id "
				. ($course_date_translated
					? ("AND code='$language' "
						. "AND language=language.id ")
					: "")
				. "ORDER BY position,category.name,"
				. "course.name;");
  for ($lt = 0; $lt < pg_numrows($ergebnis); $lt++) {
    $col = 0;
    $specifiers = '';
    $specifiers .= pg_result($ergebnis, $lt, $col++);
    $specifiers .= pg_result($ergebnis, $lt, $col++);
    $specifiers .= pg_result($ergebnis, $lt, $col++);
    $specifiers .= pg_result($ergebnis, $lt, $col++);
    $specifiers .= pg_result($ergebnis, $lt, $col++);
    print("<course>
$specifiers</course>\n");
  }
  db_close($verbindung);
?>
</account>
Return current item: Course-manager