blob: 8f5ecc8c8cb9a0f0bf725c5a9814b1a3fba4bbe0 [file] [log] [blame]
droyd0b89592008-05-15 19:18:20 +00001<?php
2/*******************************************************************************
3 * Copyright (c) 2008 Eclipse Foundation and others.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Eclipse Foundation - Initial API and implementation
11*******************************************************************************/
12include("global.php");
13
14InitPage("");
15
16global $User;
17global $App, $dbh;
18
19$pageTitle = "Babel - Translation statistics";
20$pageKeywords = "";
21$incfile = "content/en_stats.php";
22
23$PROJECT_VERSION = $App->getHTTPParameter("project_version");
24$PROJECT_ID = "";
25$VERSION = "";
26
27if($PROJECT_VERSION != "") {
28
29 $items = explode("|", $PROJECT_VERSION);
30 $PROJECT_ID = $items[0];
31 $VERSION = $items[1];
32}
33$LANGUAGE_ID= $App->getHTTPParameter("language_id");
34$SUBMIT = $App->getHTTPParameter("submit");
35
droy520b74d2008-05-28 14:04:00 +000036$sql = "SELECT DISTINCT pv.project_id, pv.version FROM project_versions AS pv INNER JOIN map_files as m ON pv.project_id = m.project_id AND pv.version = m.version WHERE pv.is_active ORDER BY pv.project_id ASC, pv.version DESC";
droyd0b89592008-05-15 19:18:20 +000037$rs_p_list = mysql_query($sql, $dbh);
38
39$sql = "SELECT language_id, name FROM languages WHERE is_active ORDER BY name";
40$rs_l_list = mysql_query($sql, $dbh);
41
droy7fcffa72008-06-02 20:33:14 +000042
43$where = "";
44
45if($PROJECT_ID != "") {
46 $where = $App->addAndIfNotNull($where) . " p.project_id = ";
47 $where .= $App->returnQuotedString($App->sqlSanitize($PROJECT_ID, $dbh));
droyd0b89592008-05-15 19:18:20 +000048}
droy7fcffa72008-06-02 20:33:14 +000049if($LANGUAGE_ID != "") {
50 $where = $App->addAndIfNotNull($where) . " l.language_id = ";
51 $where .= $App->returnQuotedString($App->sqlSanitize($LANGUAGE_ID, $dbh));
52}
53if($VERSION != "") {
54 $where = $App->addAndIfNotNull($where) . "p.version = ";
55 $where .= $App->returnQuotedString($App->sqlSanitize($VERSION, $dbh));
droyd0b89592008-05-15 19:18:20 +000056}
57
droy7fcffa72008-06-02 20:33:14 +000058if($where != "") {
59 $where = " WHERE " . $where;
60}
droyd0b89592008-05-15 19:18:20 +000061
droy7fcffa72008-06-02 20:33:14 +000062$sql = "SELECT p.project_id, p.version, l.name, p.pct_complete FROM project_progress AS p INNER JOIN languages AS l ON l.language_id = p.language_id $where ORDER BY p.pct_complete DESC, p.project_id, p.version, l.name";
63$rs_p_stat = mysql_query($sql, $dbh);
64
65include("head.php");
66include($incfile);
67include("foot.php");
droyd0b89592008-05-15 19:18:20 +000068
69?>