$res = mysql_query($sql); if ($res == FALSE) { die("Invalid Query: {$sql}"); } $record = mysql_fetch_assoc($res); if ($record) { $word = $record['WoText']; $trans = repl_tab_nl($record['WoTranslation']) . getWordTagList($wid, ' ', 1, 0); $roman = $record['WoRomanization']; } else { die("Error: No results"); } mysql_free_result($res); pagestart("Term: " . $word, false); $m1 = runsql('update words set WoStatus = ' . $_REQUEST['status'] . ', WoStatusChanged = NOW(),' . make_score_random_insert_update('u') . ' where WoID = ' . $wid, 'Status changed'); echo '<p>OK, this term has status ' . get_colored_status_msg($status) . ' from now!</p>'; ?> <script type="text/javascript"> //<![CDATA[ var context = window.parent.frames['l'].document; var contexth = window.parent.frames['h'].document; var status = '<?php echo $status; ?> '; var title = make_tooltip(<?php echo prepare_textdata_js($word); ?> , <?php echo prepare_textdata_js($trans); ?>
$status = $oldstatus + $stchange; if ($status < 1) { $status = 1; } if ($status > 5) { $status = 5; } } $word = get_first_value("select WoText as value from words where WoID = " . $wid); pagestart("Term: " . $word, false); $m1 = runsql('update words set WoStatus = ' . $status . ', WoStatusChanged = NOW(),' . make_score_random_insert_update('u') . ' where WoID = ' . $wid, 'Status changed'); $newscore = get_first_value('select greatest(0,round(WoTodayScore,0)) AS value from words where WoID = ' . $wid) + 0; if ($oldstatus == $status) { echo '<p>Status ' . get_colored_status_msg($status) . ' not changed.</p>'; } else { echo '<p>Status changed from ' . get_colored_status_msg($oldstatus) . ' to ' . get_colored_status_msg($status) . '.</p>'; } echo "<p>Old score was " . $oldscore . ", new score is now " . $newscore . ".</p>"; $totaltests = $_SESSION['testtotal']; $wrong = $_SESSION['testwrong']; $correct = $_SESSION['testcorrect']; $notyettested = $totaltests - $correct - $wrong; if ($notyettested > 0) { if ($stchange >= 0) { $_SESSION['testcorrect']++; } else { $_SESSION['testwrong']++; } } ?> <script type="text/javascript">
} ?> <tr> <td class="td1 right">Sentence<br />Term in {...}:</td> <td class="td1" <?php echo $scrdir; ?> ><?php echo tohtml($record['WoSentence']); ?> </td> </tr> <tr> <td class="td1 right">Status:</td> <td class="td1"><?php echo get_colored_status_msg($record['WoStatus']); ?> </span> </td> </tr> </table> <script type="text/javascript"> //<![CDATA[ window.parent.frames['l'].focus(); window.parent.frames['l'].setTimeout('cClick()', 100); //]]> </script> <?php }