$i++;
    } else {
        $sql2 = "select count(*) as total from {$db_table}";
        $result2 = mysql_query($sql2) or die("Can't select the total count");
        $row2 = mysql_fetch_object($result2);
        $total = $row2->total;
        $g_total += $total;
        // added to give grand total of all strings
        $sql3 = "select count(*) as untrans from {$db_table} where msgstr=\"\"";
        $result3 = mysql_query($sql3) or die("Can't select the untranslated count");
        $row3 = mysql_fetch_object($result3);
        $untrans = $row3->untrans;
        $g_untrans += $untrans;
        // added to give grand total of all untranslated strings
        $sql4 = "select count(*) as sugg_no from {$db_table} where suggestion!=\"\"";
        $result4 = mysql_query($sql4) or die("Can't select the untranslated");
        $row4 = mysql_fetch_object($result4);
        $sugg_no = $row4->sugg_no;
        $g_sugg_no += $sugg_no;
        // added to give grand total of all suggestions made
        $trans = rounded(($total - $untrans) / $total * 100, 0) . "%";
        echo "\n                        <tr bgcolor={$bgcolor}>\n                                <td><a href=editpot.php?lg={$lg}&db_table={$db_table}&view={$view}&total={$total}>{$db_table}</a></td>\n                                <td align=\"right\">{$total}</td>\n                                <td align=\"right\">{$trans}</td>\n                                <td align=\"right\">{$sugg_no}</td>\n                        </tr>\n                        ";
        $i++;
    }
}
$g_trans = rounded(($g_total - $g_untrans) / $g_total * 100, 0) . "%";
echo "\n        <tr>\n                <td id=\"crumbs\"><h3>Grand total:</h3></td>\n                <td align=\"right\" id=\"crumbs\">{$g_total}</td>\n                <td align=\"right\" id=\"crumbs\">{$g_trans}</td>\n                <td align=\"right\" id=\"crumbs\">{$g_sugg_no}</td>\n        </tr>\n        </table>";
echo "<table><tr><td id=\"crumbs\">";
include "includes/navbar.php";
echo "</td></tr></table></div>";
include "includes/footer.php";
示例#2
0
<?php

header("Content-type: image/png");
include "kartouche/config.php";
include "includes/fns.php";
dbconnect();
$sql2 = "select count(*) as total from kabc_file";
$result2 = mysql_query($sql2) or die("Can't select the total count");
$row2 = mysql_fetch_object($result2);
$total = $row2->total;
$sql3 = "select count(*) as untrans from kabc_file where msgstr=\"\"";
$result3 = mysql_query($sql3) or die("Can't select the untranslated count");
$row3 = mysql_fetch_object($result3);
$untrans = $row3->untrans;
$trans = rounded(($total - $untrans) / $total * 100, 0);
$im = imagecreate(200, 10);
$bg_col = imagecolorallocate($im, 255, 204, 255);
$border = imagecolorallocate($im, 153, 0, 51);
$bar = imagecolorallocate($im, 204, 153, 255);
imagefilledrectangle($im, 0, 0, 2 * $trans, 10, $bar);
imagerectangle($im, 0, 0, 199, 9, $border);
imagepng($im);