gforge-commits
[Top][All Lists]
Advanced

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

[Gforge-commits] gforge/www/admin/languages admintabfiles.php, NONE, 1.


From: cbayle
Subject: [Gforge-commits] gforge/www/admin/languages admintabfiles.php, NONE, 1.1 editdouble.php, NONE, 1.1 editnotinbasetabfiles.php, NONE, 1.1 editnotranstabfiles.php, NONE, 1.1 edittabfiles.php, NONE, 1.1 edittranstabfiles.php, NONE, 1.1 gettabfiles.php, NONE, 1.1 loadtabfiles.php, NONE, 1.1 seenotinbasetabfiles.php, NONE, 1.1 seenotranstabfiles.php, NONE, 1.1 seetabfiles.php, NONE, 1.1 seetranstabfiles.php, NONE, 1.1
Date: Wed, 29 Sep 2004 10:10:44 -0500

Update of /cvsroot/gforge/gforge/www/admin/languages
In directory db.perdue.net:/tmp/cvs-serv18551/languages

Added Files:
        admintabfiles.php editdouble.php editnotinbasetabfiles.php 
        editnotranstabfiles.php edittabfiles.php edittranstabfiles.php 
        gettabfiles.php loadtabfiles.php seenotinbasetabfiles.php 
        seenotranstabfiles.php seetabfiles.php seetranstabfiles.php 
Log Message:
Moved tab file utility in languages  directory


--- NEW FILE: admintabfiles.php ---
<?php
/**
 * Module to render generic HTML tables for Site Admin
 *
 * Copyright 1999-2001 (c) VA Linux Systems
 *
 * @version   $Id: admintabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle Exp $
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


/**
 *      admin_table_add() - present a form for adding a record to the specified 
table
 *
 *      @param $table - the table to act on
 *      @param $unit - the name of the "units" described by the table's records
 *      @param $primary_key - the primary key of the table
 */
function admin_table_add($table, $unit, $primary_key, $lang) {
        global $PHP_SELF;

        // This query may return no rows, but the field names are needed.
        $result = db_query('SELECT * FROM '.$table.' WHERE '.$primary_key.'=0');

        if ($result) {
                $cols = db_numfields($result);

                echo 'Create a new '.$unit.' below:
                        <form name="add" 
action="'.$PHP_SELF.'?function=postadd&lang='.$lang.'" method="post">
                        <table>';

                for ($i = 0; $i < $cols; $i++) {
                        $fieldname = db_fieldname($result, $i);

                        echo '<tr><td><strong>'.$fieldname.'</strong></td>';
                        echo '<td><input type="text" name="'.$fieldname.'" 
value="" /></td></tr>';
                }
                echo '</table><input type="submit" value="Submit New 
'.ucwords($unit).'" /></form>
                        <form name="cancel" action="'.$PHP_SELF.'" 
method="post">
                        <input type="submit" value="Cancel" />
                        </form>';
        } else {
                echo db_error();
        }
}

/**
 *      admin_table_postadd() - update the database based on a submitted change
 *
 *      @param $table - the table to act on
 *      @param $unit - the name of the "units" described by the table's records
 *      @param $primary_key - the primary key of the table
 */
function admin_table_postadd($table, $unit, $primary_key, $lang) {
        global $HTTP_POST_VARS;

        $sql = "INSERT INTO $table ("
                . join(',', array_keys($HTTP_POST_VARS))
                . ") VALUES ('"
                . htmlspecialchars(join("','", array_values($HTTP_POST_VARS)))
                . "')";

        if (db_query($sql)) {
                echo ucfirst($unit).' successfully added.';
        } else {
                echo db_error();
        }
}

/**
 *      admin_table_confirmdelete() - present a form to confirm requested 
record deletion
 *
 *      @param $table - the table to act on
 *      @param $unit - the name of the "units" described by the table's records
 *      @param $primary_key - the primary key of the table
 *      @param $id - the id of the record to act on
 */
function admin_table_confirmdelete($table, $unit, $primary_key, $id, $lang) {
        global $PHP_SELF;

        $result = db_query("SELECT * FROM $table WHERE $primary_key=$id AND 
language_id='".$lang."'");

        if ($result) {
                $cols = db_numfields($result);

                echo 'Are you sure you want to delete this '.$unit.'?
                        <ul>';
                for ($i = 0; $i < $cols; $i++) {
                        echo '<li><strong>'.db_fieldname($result,$i).'</strong> 
'.db_result($result,0,$i).'</li>';
                }
                echo '</ul>
                        <form name="delete" 
action="'.$PHP_SELF.'?function=delete&lang='.$lang.'&amp;id='.$id.'" 
method="post">
                        <input type="submit" value="Delete" />
                        </form>
                        <form name="cancel" action="'.$PHP_SELF.'" 
method="post">
                        <input type="submit" value="Cancel" />
                        </form>';
        } else {
                echo db_error();
        }
}

/**
 *      admin_table_delete() - delete a record from the database after 
confirmation
 *
 *      @param $table - the table to act on
 *      @param $unit - the name of the "units" described by the table's records
 *      @param $primary_key - the primary key of the table
 *      @param $id - the id of the record to act on
 */
//function admin_table_delete($table, $unit, $primary_key, $id, $lang) {
function admin_table_delete($table, $unit, $primary_key, $whereclause, 
$columns, $edit, $id, $lang) {
        if (db_query("DELETE FROM $table WHERE $primary_key=$id AND 
language_id='".$lang."'")) {
                echo ucfirst($unit).' successfully deleted.';
        } else {
                echo db_error();
        }
        admin_table_show($table, $unit, $primary_key, $whereclause, $columns, 
$edit, $lang);
}

/**
 *      admin_table_edit() - present a form for editing a record in the 
specified table
 *
 *      @param $table - the table to act on
 *      @param $unit - the name of the "units" described by the table's records
 *      @param $primary_key - the primary key of the table
 *      @param $id - the id of the record to act on
 */
function admin_table_edit($table, $unit, $primary_key, $id, $lang) {
        global $PHP_SELF;

        $query="SELECT * FROM $table WHERE $primary_key=$id AND 
language_id='".$lang."'";
        //$result = db_query("SELECT * FROM $table WHERE $primary_key=$id AND 
language_id='".$lang."'");
        //echo "$query<br>\n";
        $result = db_query($query);

        if ($result) {
                $cols = db_numfields($result);

                echo 'Modify the '.$unit.' below:
                        <form name="edit" 
action="'.$PHP_SELF.'?function=postedit&lang='.$lang.'&amp;id='.$id.'" 
method="post">
                        <table>';

                for ($i = 0; $i < $cols; $i++) {
                        $fieldname = db_fieldname($result, $i);
                        $value = db_result($result, 0, $i);

                        echo '<tr><td><strong>'.$fieldname.'</strong></td>';

                        if ($fieldname == $primary_key) {
                                echo "<td>$value</td></tr>";
                        } elseif ($fieldname =='tstring')  {
                                //echo '<td><textarea type="text" 
name="'.$fieldname.'" cols="50" 
rows="10"/>'.stripslashes($value).'</textarea></td></tr>';
                                echo '<td><textarea type="text" 
name="'.$fieldname.'" cols="50" 
rows="10"/>'.stripslashes(util_unconvert_htmlspecialchars($value)).'</textarea></td></tr>';
                        } else {
                                echo '<td><input type="text" 
name="'.$fieldname.'" value="'.$value.'"/></td></tr>';
                        }
                }
                echo '</table><input type="submit" value="Submit Changes" 
/></form>
                        <form name="cancel" 
action="'.$PHP_SELF.'?function=show&lang='.$lang.'" method="post">
                        <input type="submit" value="Cancel" />
                        </form>';
        } else {
                echo db_error();
        }
}

/**
 *      admin_table_postedit() - update the database to reflect submitted 
modifications to a record
 *
 *      @param $table - the table to act on
 *      @param $unit - the name of the "units" described by the table's records
 *      @param $primary_key - the primary key of the table
 *      @param $id - the id of the record to act on
 */
//function admin_table_postedit($table, $unit, $primary_key, $id, $lang) {
function admin_table_postedit($table, $unit, $primary_key, $whereclause, 
$columns, $edit, $id, $lang) {
        global $HTTP_POST_VARS;

        $sql = 'UPDATE '.$table.' SET ';
        while (list($var, $val) = each($HTTP_POST_VARS)) {
                if ($var != $primary_key) {
                        $sql .= "$var='". htmlspecialchars($val) ."', ";
                }
        }
        $sql = ereg_replace(', $', ' ', $sql);
        $sql .= "WHERE $primary_key=$id AND language_id='".$lang."'";

        if (db_query($sql)) {
                echo ucfirst($unit) . ' successfully modified.';
        } else {
                echo db_error();
        }
        //echo '
        //              <form name="cancel" 
action="'.$PHP_SELF.'?function=show&lang='.$lang.'" method="post">
        //              <input type="submit" value="Edit More" />
        //              </form>';
        echo admin_table_show($table, $unit, $primary_key, $whereclause, 
$columns, $edit, $lang);
}

/**
 *      admin_table_show() - display the specified table, sorted by the primary 
key, with links to add, edit, and delete
 *
 *      @param $table - the table to act on
 *      @param $unit - the name of the "units" described by the table's records
 *      @param $primary_key - the primary key of the table
 */
function admin_table_show($table, $unit, $primary_key, $whereclause, $columns, 
$edit, $lang) {
        global $HTML, $PHP_SELF;

        //CB// echo "<h1>SELECT * FROM $table $whereclause</h1>";
        $result = db_query("SELECT $columns FROM $table $whereclause;");

        if ($result) {
                $rows = db_numrows($result);
                $cols = db_numfields($result);
                if (! $edit) $cols .=-1;

                echo '<table border="0" width="100%">
                <tr bgcolor="'.$HTML->COLOR_HTMLBOX_TITLE.'">
                <td colspan="'.($cols+1).'"><strong><span style="color:'. 
$HTML->FONTCOLOR_HTMLBOX_TITLE .'">'. ucwords($unit) .'s</span></strong>';
                if ($edit) echo '<a 
href="'.$PHP_SELF.'?function=add&lang='.$lang.'">[add new]</a>';
                echo "</td></tr>\n";

                if ($edit) echo '
                        <tr><td width="5%"></td>';
                else echo '
                        <tr>';

                for ($i = 0; $i < $cols; $i++) {
                        echo 
'<td><strong>'.db_fieldname($result,$i).'</strong></td>';
                }
                echo "</tr>\n";

                for ($j = 0; $j < $rows; $j++) {
                        echo '<tr '. $HTML->boxGetAltRowStyle($j) . '>';

                        $id = db_result($result,$j,0);
                        if ($edit) echo '<td><a 
href="'.$PHP_SELF.'?function=edit&lang='.$lang.'&amp;id='.$id.'">[edit]</a>';
                        if ($edit) echo '<a 
href="'.$PHP_SELF.'?function=confirmdelete&lang='.$lang.'&amp;id='.$id.'">[delete]</a>
 </td>';
                        for ($i = 0; $i < $cols; $i++) {
                                //echo '<td>'. 
stripslashes(htmlspecialchars(db_result($result, $j, $i))) .'</td>';
                                echo '<td>'. stripslashes(db_result($result, 
$j, $i)) .'</td>';
                        }
                        echo "</tr>\n";
                }
                echo "</table>\n";
        } else {
                echo db_error();
        }
}


require_once('pre.php');
session_require(array('group'=>'1','admin_flags'=>'A'));

$HTML->header(array('title'=>'Edit the '. $lang .' Language '. ucwords($unit) 
.'s'));

echo '<h3>Edit the '. $lang .' Language ' . ucwords($unit) .'s</h3>
<p><a href="/admin/">Site Admin Home</a></p>
<p>&nbsp;</p>';

switch ($function) {
        case 'add' : {
                admin_table_add($table, $unit, $primary_key, $lang);
                break;
        }
        case 'postadd' : {
                admin_table_postadd($table, $unit, $primary_key, $lang);
                break;
        }
        case 'confirmdelete' : {
                admin_table_confirmdelete($table, $unit, $primary_key, $id, 
$lang);
                break;
        }
        case 'delete' : {
                //admin_table_delete($table, $unit, $primary_key, $id, $lang);
                admin_table_delete($table, $unit, $primary_key, $whereclause, 
$columns, $edit, $id, $lang);
                break;
        }
        case 'edit' : {
                admin_table_edit($table, $unit, $primary_key, $id, $lang);
                break;
        }
        case 'postedit' : {
                //admin_table_postedit($table, $unit, $primary_key, $id, $lang);
                admin_table_postedit($table, $unit, $primary_key, $whereclause, 
$columns, $edit, $id, $lang);
                break;
        }
        case 'show' : {
                admin_table_show($table, $unit, $primary_key, $whereclause, 
$columns, $edit, $lang);
                break;
        }
}


$HTML->footer(array());

?>

--- NEW FILE: editdouble.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: editdouble.php,v 1.1 2004/09/29 15:10:41 cbayle Exp $
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " WHERE language_id||pagename||category IN (SELECT 
language_id||pagename||category FROM (SELECT count(*) AS 
cnt,language_id,pagename,category  FROM tmp_lang WHERE pagename!='#' GROUP BY 
language_id,pagename,category) AS cntdouble where cnt>1 AND 
language_id='".$lang."') AND pagename!='' ORDER BY 
language_id,pagename,category,seq ";
$columns     = "seq, tmpid, pagename, category, tstring";
$edit        = 'yes';

include_once('admintabfiles.php');

?>

--- NEW FILE: editnotinbasetabfiles.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: editnotinbasetabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle 
Exp $
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " WHERE language_id='".$lang."' AND pagename!='#' AND 
pagename||category NOT IN (select pagename||category FROM $table WHERE 
language_id='Base' ) ORDER BY seq";
$columns     = "seq, tmpid, pagename, category, tstring";
$edit        = 'yes';

include_once('admintabfiles.php');

?>

--- NEW FILE: editnotranstabfiles.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: editnotranstabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle 
Exp $
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " WHERE language_id='" . $lang . "' AND tmpid='-1' ORDER BY seq";
$columns     = "seq, tmpid, pagename, category, tstring";
$edit        = 'yes';

include_once('admintabfiles.php');

?>

--- NEW FILE: edittabfiles.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: edittabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle Exp $
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " WHERE language_id='" . $lang . "' AND tmpid!='-1' ORDER BY 
seq";
$columns     = "seq, tmpid, pagename, category, tstring";
$edit        = 'yes';

include_once('admintabfiles.php');

?>

--- NEW FILE: edittranstabfiles.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: edittranstabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle Exp $
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " WHERE language_id='" . $lang . "' ORDER BY seq";
$columns     = "seq, tmpid, pagename, category, tstring";
$edit        = 'yes';

include_once('admintabfiles.php');

?>

--- NEW FILE: gettabfiles.php ---
<?php
/**
  *
  * @version   $Id: gettabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle Exp $
  *
  */


require_once('pre.php');
require_once('common/include/account.php');
require_once('www/admin/admin_utils.php');
require_once('www/include/BaseLanguage.class');

session_require(array('group'=>'1','admin_flags'=>'A'));

header('Content-Type: application/octet-stream');
header("Content-Disposition: attachment; filename=$lang.tab");

$result=db_query("SELECT * from tmp_lang WHERE language_id='".$lang."' AND 
tmpid!='-1' AND pagename='#' ORDER BY seq");
for ($i=0; $i<db_numrows($result) ; $i++) {
        
$tstring=stripslashes(util_unconvert_htmlspecialchars(db_result($result, $i, 
'tstring')));
        echo $tstring;
}
$result=db_query("SELECT * from tmp_lang WHERE language_id='".$lang."' AND 
tmpid!='-1' AND pagename!='#' ORDER BY pagename,category");
for ($i=0; $i<db_numrows($result) ; $i++) {
        $pagename=db_result($result, $i, 'pagename');
        $category=db_result($result, $i, 'category');
        
$tstring=stripslashes(util_unconvert_htmlspecialchars(db_result($result, $i, 
'tstring')));
        echo "$pagename $category       $tstring";
}

?>

--- NEW FILE: loadtabfiles.php ---
<?php
/**
 * //TODO DESCRIPTION
 *
 * @version   $Id: loadtabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle Exp $
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


require_once('pre.php');
require_once('common/include/account.php');
require_once('www/admin/admin_utils.php');
require_once('www/include/BaseLanguage.class');

session_require(array('group'=>'1','admin_flags'=>'A'));

if ($purgeall) {
        db_query("DROP TABLE tmp_lang;");
}

if ($loadall) {
        db_query("DROP TABLE tmp_lang;");
        db_query("CREATE TABLE tmp_lang (tmpid integer, language_id text, seq 
integer , pagename text, category text, tstring  text);");
        //db_commit();
        $rep= $sys_urlroot . 'include/languages/';
        //chdir($rep);
        $dir = opendir("$rep");
        while($file = readdir($dir)) {
                if(ereg("(.*)\.tab$",$file,$regs)){
                        $tmpid=0;
                        $language_id=$regs[1];
                        $ary = file($rep . $file,1);
                        for ($i=0; $i<sizeof($ary); $i++) {
                                $seq=$i*10;
                                if (substr($ary[$i], 0, 1) == '#') {
                                        $query="INSERT INTO tmp_lang values(". 
$seq . ",'" . $language_id . "'," . $seq . ",'#','#" . $seq . "','" . $ary[$i] 
. "')";
                                        $tmpid++;
                                        db_query($query);
                                        continue;
                                }
                                $line = explode("\t", $ary[$i], 3);
                                //$query="INSERT INTO tmp_lang values(". $seq . 
",'" . $language_id . "'," . $seq . ",'" . $line[0] . "','" . $line[1] . "','" 
. $line[2] ."')";
                                $query="INSERT INTO tmp_lang values(". $seq . 
",'" . $language_id . "'," . $seq . ",'" . $line[0] . "','" . $line[1] . "','" 
. addslashes(quotemeta(htmlspecialchars($line[2]))) ."')";
                                //$query="INSERT INTO tmp_lang values(". $seq . 
",'" . $language_id . "'," . $seq . ",'" . $line[0] . "','" . $line[1] . "','" 
. base64_encode($line[2]) ."')";
                                $tmpid++;
                                $res=db_query($query);
                                if (!$res){
                                        echo '<br />'.$query.'<br />'. 
db_error();
                                }
                        }
                }
        }
        rewinddir($dir);
        while($file = readdir($dir)) {
                if(ereg("(.*)\.tab$",$file,$regs)){
                        $language_id=$regs[1];
                        $query="INSERT INTO tmp_lang SELECT 
-1,'".$language_id."',seq+5,pagename,category,tstring FROM tmp_lang WHERE 
language_id='Base' AND pagename!='#' AND pagename||category NOT IN (select 
pagename||category FROM tmp_lang WHERE language_id='" . $language_id . "' ) 
ORDER BY seq";
                        $res=db_query($query);
                        if (!$res){
                                echo '<br />'.$query.'<br />'. db_error();
                        }
                }
        }
        closedir($dir);
        //db_commit();
}

site_admin_header(array('title'=>"Site Admin"));
?>

<form name="mload" method="post" action="<?php echo $PHP_SELF; ?>">

<input type="submit" name="loadall" value="<?php echo "(Re)Load all language 
files"; ?>" />
<input type="submit" name="purgeall" value="<?php echo "Purge loaded data"; ?>" 
/>

</form>

<p />

<?php
$result1=db_query("select language_id, count(language_id) AS count from 
tmp_lang where pagename!='#' and tmpid!='-1' group by language_id");
$result2=db_query("select language_id, count(language_id) AS count from 
tmp_lang where pagename!='#' group by language_id");
if (db_numrows($result1)>0) {
?>
        <h3 style="color:red">Tables loaded:</h3>
<?php
        echo '
        <table border="0" bgcolor=white width="100%">
                <tr bgcolor=blue>
                        <td><b><font color="white">Language</b></font></td>
                        <td colspan=2><b><font 
color="white">Translated</b></font></td>
                        <td colspan=2><b><font 
color="white">Extra</b></font></td>
                        <td><b><font color="white">Double</b></font></td>
                        <td><b><font color="white">Translation</b></font></td>
                        <td><b><font color="white">To Translate</b></font></td>
                        <td><b><font color="white">Not in Base</b></font></td>
                        <td><b><font color="white">Tab file</b></font></td>
                </tr>';
                
        $maxtrans=0;
        for ($i=0; $i<db_numrows($result1) ; $i++) {
                $howmany1=db_result($result1, $i, 'count');
                //if ($howmany>$maxtrans) $maxtrans=$howmany;
                $lang=db_result($result1, $i, 'language_id');
                if ($lang=='Base') $maxtrans=$howmany1;
        }
        for ($i=0; $i<db_numrows($result1) ; $i++) {
                $howmany1=db_result($result1,$i,'count');
                $howmany2=db_result($result2,$i,'count')-$maxtrans;
                $rate1=$howmany1 * 100 / $maxtrans;
                $rate2=$howmany2 * 100 / $maxtrans;
                $language_id=db_result($result1,$i,'language_id');
                echo "\n<tr bgcolor=lightblue><td>$language_id</td>";
                printf("<td>%d</td><td>%3.2f",$howmany1,$rate1);
                echo "%</td>";
                if ($rate2!=0) {
                        printf("<td>%d</td><td>%3.2f",$howmany2,$rate2);
                        echo "%</td>";
                } else {
                        printf("<td colspan=2></td>");
                }
?>
<td>
        <a href="editdouble.php?function=show&lang=<?php echo "$language_id"; 
?>">[edit]</a>
</td>
<td>
        <a href="seetranstabfiles.php?function=show&lang=<?php echo 
"$language_id"; ?>">[see]</a>
        <a href="edittranstabfiles.php?function=show&lang=<?php echo 
"$language_id"; ?>">[edit]</a>
</td>
<td>
        <a href="seenotranstabfiles.php?function=show&lang=<?php echo 
"$language_id"; ?>">[see]</a>
        <a href="editnotranstabfiles.php?function=show&lang=<?php echo 
"$language_id"; ?>">[edit]</a>
</td>
<td>
        <a href="seenotinbasetabfiles.php?function=show&lang=<?php echo 
"$language_id"; ?>">
        <? if ($rate2!=0) echo "[see]";?></a>
        <a href="editnotinbasetabfiles.php?function=show&lang=<?php echo 
"$language_id"; ?>">
        <? if ($rate2!=0) echo "[edit]";?></a>
</td>
<td>
        <a href="seetabfiles.php?function=show&lang=<?php echo "$language_id"; 
?>">[see]</a>
        <a href="edittabfiles.php?function=show&lang=<?php echo "$language_id"; 
?>">[edit]</a>
        <a href="gettabfiles.php?function=show&lang=<?php echo "$language_id"; 
?>">[get]</a>
</td>
<?php
                echo "</tr>";
        }
        echo "\n</table>";
} else {
?>
        <h3 style="color:red">Available Tables:</h3>
                <table border="0">
<?php
        $rep= $sys_urlroot . 'include/languages/';
        //chdir($rep);
        $dir = opendir("$rep");
        while($file = readdir($dir)) {
                if(ereg("(.*)\.tab$",$file,$regs)){
                        $language_id=$regs[1];
                        echo "\n<tr><td>$language_id</td>";
                        echo "<tr>";
                }
        }
        echo "\n</table>";
}

site_admin_footer(array());

?>

--- NEW FILE: seenotinbasetabfiles.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: seenotinbasetabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle 
Exp $
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " WHERE language_id='".$lang."' AND pagename!='#' AND 
pagename||category NOT IN (select pagename||category FROM $table WHERE 
language_id='Base' ) ORDER BY seq";
$columns     = "seq, pagename, category, tstring";
include_once('admintabfiles.php');

?>

--- NEW FILE: seenotranstabfiles.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: seenotranstabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle Exp 
$
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " WHERE language_id='".$lang."' AND pagename!='#' AND tmpid='-1' 
ORDER BY seq";
$columns     = "seq, pagename, category, tstring";
include_once('admintabfiles.php');

?>

--- NEW FILE: seetabfiles.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: seetabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle Exp $
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " WHERE language_id='" . $lang . "' AND tmpid!='-1' ORDER BY 
seq";
$columns     = "seq, pagename, category, tstring";

include_once('admintabfiles.php');

?>

--- NEW FILE: seetranstabfiles.php ---
<?php
/**
  *
  * Site Admin page to edit File Release System processor types
  *
  * SourceForge: Breaking Down the Barriers to Open Source Development
  * Copyright 1999-2001 (c) VA Linux Systems
  * http://sourceforge.net
  *
  * @version   $Id: seetranstabfiles.php,v 1.1 2004/09/29 15:10:41 cbayle Exp $
  *
  */


$unit        = 'item';
$table       = 'tmp_lang';
$primary_key = 'seq';
$whereclause = " lang1 ,tmp_lang lang2 WHERE lang1.language_id='Base' AND 
lang2.language_id='" . $lang . "' AND lang1.pagename=lang2.pagename AND 
lang1.category=lang2.category AND lang1.pagename!='#' AND lang2.pagename!='#' 
AND lang2.tmpid!='-1' ORDER BY lang1.seq";
$columns     = "lang1.seq, lang1.pagename, lang1.category, lang1.tstring, 
lang2.tstring";

include_once('admintabfiles.php');

?>





reply via email to

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