Exemplo n.º 1
0
<th class="th1 sorttable_numeric clickable">Unkn.<br />%</th>
</tr>

<?php 
        $sql = 'select TxID, TxTitle, LgName, TxAudioURI, TxSourceURI, length(TxAnnotatedText) as annotlen, ifnull(concat(\'[\',group_concat(distinct T2Text order by T2Text separator \', \'),\']\'),\'\') as taglist from ((' . $tbpref . 'texts left JOIN ' . $tbpref . 'texttags ON TxID = TtTxID) left join ' . $tbpref . 'tags2 on T2ID = TtT2ID), ' . $tbpref . 'languages where LgID=TxLgID ' . $wh_lang . $wh_query . ' group by TxID ' . $wh_tag . ' order by ' . $sorts[$currentsort - 1] . ' ' . $limit;
        if ($debug) {
            echo $sql;
        }
        $res = do_mysql_query($sql);
        $showCounts = getSettingWithDefault('set-show-text-word-counts') + 0;
        while ($record = mysql_fetch_assoc($res)) {
            if ($showCounts) {
                flush();
                $txttotalwords = textwordcount($record['TxID']);
                $txtworkedwords = textworkcount($record['TxID']);
                $txtworkedexpr = textexprcount($record['TxID']);
                $txtworkedall = $txtworkedwords + $txtworkedexpr;
                $txttodowords = $txttotalwords - $txtworkedwords;
                $percentunknown = 0;
                if ($txttotalwords != 0) {
                    $percentunknown = round(100 * $txttodowords / $txttotalwords, 0);
                    if ($percentunknown > 100) {
                        $percentunknown = 100;
                    }
                    if ($percentunknown < 0) {
                        $percentunknown = 0;
                    }
                }
            }
            $audio = $record['TxAudioURI'];
            if (!isset($audio)) {
Exemplo n.º 2
0
right to use this work for any purpose, without any conditions, 
unless such conditions are required by law.

Developed by J.P. in 2011, 2012.
***************************************************************/
/**************************************************************
Call: ajax_word_counts.php?id=[textid]
Calculating Word Counts, Ajax call in edit_texts.php
***************************************************************/
include "connect.inc.php";
include "settings.inc.php";
include "utilities.inc.php";
$id = $_POST["id"] + 0;
$txttotalwords = textwordcount($id);
$txtworkedwords = textworkcount($id);
$txtworkedexpr = textexprcount($id);
$txtworkedall = $txtworkedwords + $txtworkedexpr;
$txttodowords = $txttotalwords - $txtworkedwords;
$percentunknown = 0;
if ($txttotalwords != 0) {
    $percentunknown = round(100 * $txttodowords / $txttotalwords, 0);
    if ($percentunknown > 100) {
        $percentunknown = 100;
    }
    if ($percentunknown < 0) {
        $percentunknown = 0;
    }
}
$r = array();
$r[] = '<span title="Total">&nbsp;' . $txttotalwords . '&nbsp;</span>';
$r[] = '<span title="Saved" class="status4">&nbsp;' . ($txtworkedall > 0 ? '<a href="edit_words.php?page=1&amp;query=&amp;status=&amp;tag12=0&amp;tag2=&amp;tag1=&amp;text=' . $id . '">' . $txtworkedwords . '+' . $txtworkedexpr . '</a>' : '0') . '&nbsp;';