qsos-commits
[Top][All Lists]
Advanced

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

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


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

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

Modified files:
        apps/o3s       : index.php 

Log message:
        Language can be modified by user.
        Database backend integration.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/index.php?cvsroot=qsos&r1=1.2&r2=1.3

Patches:
Index: index.php
===================================================================
RCS file: /sources/qsos/qsos/apps/o3s/index.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- index.php   8 Jul 2007 23:21:09 -0000       1.2
+++ index.php   17 May 2009 22:06:15 -0000      1.3
@@ -1,6 +1,6 @@
 <?php
 /*
-**  Copyright (C) 2007 Atos Origin 
+**  Copyright (C) 2009 Atos Origin 
 **
 **  Author: Raphael Semeteys <address@hidden>
 **
@@ -23,14 +23,17 @@
 ** index.php: lists software families and shows search box
 **
 */
+session_start();
+$_SESSION = array();
 
 include("config.php");
-include("fs.functions.php");
-include("locales/$lang.php");
+include("lang.php");
+$$lang = 'checked';
 
 echo "<html>\n";
 echo "<head>\n";
 echo "<LINK REL=StyleSheet HREF='skins/$skin/o3s.css' TYPE='text/css'/>\n";
+echo "<script>function changeLang(lang) { window.location = 
'index.php?lang='+lang }</script>";
 echo "</head>\n";
 
 echo "<body>\n";
@@ -38,34 +41,44 @@
 echo "<img src='skins/$skin/o3s.png'/>\n";
 echo "<br/><br/>\n";
 
-echo "<div style='font-weight: bold'>".$msg['s1_title']."<br/><br/>\n";
+echo "<div style='font-weight: bold'>".$msg['s1_title']."<br/><br/></div>\n";
 
-echo "<table style='border-collapse: collapse'>\n";
-
-$tree = retrieveLocalizedTree($sheet, $locale);
-if (count($tree)) {
-       echo "<tr class='title'>\n";
-       echo "<td>".$msg['s1_table_title']."</td>\n";
-       echo "</tr>\n";
+echo "<div>";
+foreach($supported_lang as $l) {
+  $checked = $$l;
+  echo "<input type='radio' onclick=\"changeLang('$l')\" $checked/> $l";
+}
+echo "<br/><br/></div>";
        
-       $families = array_keys(retrieveLocalizedTree($sheet, $locale));
-       for ($i=0; $i<count($families); $i++) {
-               echo "<tr class='level1' 
-                       onmouseover=\"this.setAttribute('class','highlight')\" 
-                       onmouseout=\"this.setAttribute('class','level1')\">\n";
-               echo "<td><a 
href='set_weighting.php?family=$families[$i]'>$families[$i]</a></td>\n";
-               echo "</tr>\n";
-       }
-} else {
-       echo "<tr class='title'>\n";
-       echo "<td>".$msg['s1_no_evaluations']."</td>\n";
+echo "<table>\n";
+echo "<tr class='title'>\n";
+echo "<td>".$msg['s1_table_title']."</td>\n";
+echo "<td style='width: 100px; text-align: 
center'>".$msg['s1_table_templateversion']."</td>\n";
+echo "<td style='width: 100px; text-align: 
center'>".$msg['s1_table_nbeval']."</td>\n";
+echo "</tr>\n";
+
+$IdDB = mysql_connect($db_host ,$db_user, $db_pwd);
+mysql_select_db($db_db);
+$query = "SELECT qsosappfamily, qsosspecificformat, count(*) FROM evaluations 
WHERE appname <> '' AND language = '$lang' GROUP BY qsosappfamily, 
qsosspecificformat ORDER BY qsosappfamily, qsosspecificformat";
+$IdReq = mysql_query($query, $IdDB);
+while($row = mysql_fetch_row($IdReq)) {
+  $link = "list.php?lang=$lang&family=$row[0]&qsosspecificformat=$row[1]";
+  $over0 =  "onmouseover=\"this.setAttribute('class','highlight')\" 
+    onmouseout=\"this.setAttribute('class','level0')\"";
+  $over1 =  "onmouseover=\"this.setAttribute('class','highlight')\" 
+    onmouseout=\"this.setAttribute('class','level1')\"";
+  echo "<tr>\n";
+  echo "<td class='level0' $over0><a href='$link'><b>$row[0]</b></a</td>\n";
+  echo "<td align='center' class='level1' style='width: 100px; text-align: 
center' $over1><a href='$link'>$row[1]</a</td>\n";
+  echo "<td align='center' class='level1' style='width: 1O0px; text-align: 
center' $over1><a href='$link'>$row[2]</a></td>\n";
        echo "</tr>\n";
 }
 
 echo "</table>\n";
 
-echo "<p>".$msg['s1_search']."<br/><form action='search.php' method='post'>
+echo "<p>".$msg['s1_search']."<br/><form action='search.php'>
        <input type='text' name='s' size='20' maxlength='30'/>
+  <input type='hidden' name='lang' value='$lang'/>
        <input type='submit' value='".$msg['s1_button']."'/>
 </form></p>";
 echo "</div>\n";




reply via email to

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