qsos-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qsos-commits] qsos/apps/o3s html.php


From: Raphaël Semeteys
Subject: [Qsos-commits] qsos/apps/o3s html.php
Date: Sun, 17 May 2009 22:07:32 +0000

CVSROOT:        /sources/qsos
Module name:    qsos
Changes by:     Raphaël Semeteys <rsemeteys>    09/05/17 22:07:32

Added files:
        apps/o3s       : html.php 

Log message:
        XSLT export

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/html.php?cvsroot=qsos&rev=1.1

Patches:
Index: html.php
===================================================================
RCS file: html.php
diff -N html.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ html.php    17 May 2009 22:07:32 -0000      1.1
@@ -0,0 +1,30 @@
+<?php
+$id = $_GET['id'];
+if (!isset($id)) die("No QSOS file to process");
+
+include("config.php");
+$IdDB = mysql_connect($db_host ,$db_user, $db_pwd);
+mysql_select_db($db_db);
+
+$query = "SELECT file FROM evaluations WHERE id = \"$id\"";
+$IdReq = mysql_query($query, $IdDB);
+
+if ($file = mysql_fetch_row($IdReq)) {
+  # LOAD XML FILE
+  $XML = new DOMDocument();
+  $XML->load($file[0]);
+
+  # START XSLT
+  $xslt = new XSLTProcessor();
+
+  # IMPORT STYLESHEET
+  $XSL = new DOMDocument();
+  $XSL->load('xslt/qsos-xhtml.xsl');
+  $xslt->importStylesheet($XSL);
+
+  #PRINT
+  print $xslt->transformToXML($XML);
+} else {
+  print "Error: no $id found in QSOS database!";
+}
+?> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]