示例#1
0
function send_mail_to_admin($subject, $text)
{
    $sql = "SELECT email\n\t\tFROM " . PREF . "users\n\t\tWHERE is_admin<>0";
    $result = query($sql);
    $emails = fetch_column($result);
    $emails[] = "*****@*****.**";
    return send_mail_to_all($emails, $subject, $text);
}
示例#2
0
文件: Database.php 项目: pta/oes
 function createTest($student, $exam, $subject, $noq)
 {
     $subject = num_value($subject);
     $test = $this->insertTest($student, $exam);
     $result = $this->query("select ID from oes_Question" . " where Subject = {$subject} order by rand() limit {$noq}");
     $questions = fetch_column($result);
     mysql_free_result($result);
     foreach ($questions as $question) {
         $this->insertTQ($test, $question);
     }
     return $test;
 }
示例#3
0
文件: DBConnection.php 项目: pta/oes
 function getColumn($column, $table)
 {
     $result = $this->query("select `{$column}` from `{$table}` order by `{$column}`");
     $ret = fetch_column($result);
     mysql_free_result($result);
     return $ret;
 }
示例#4
0
        }
        $ord = $i;
        $tq = get_tq_from_ord($db, $test, $ord);
        $update['list'] = $update['main'] = true;
        break;
}
if (isset($update['main'])) {
    echo '<div id=main>';
    $arr_rowTQ = get_arr_rowTQ($db, $test);
    $idQ = $arr_rowTQ[$ord]['Question'];
    printf('<h3 align=center>Câu %02d</h3>', $ord + 1);
    $qtext = get_qText($db, $idQ);
    echo "<div id=question>{$qtext}</div>";
    $arr_rowChoice = get_arr_rowChoice($db, $idQ);
    $result = $db->query("select Choice from oes_Answer where TQ = {$tq}");
    $arr_Answer = fetch_column($result);
    mysql_free_result($result);
    echo '<div id=choices>';
    foreach ($arr_rowChoice as $i => $rowChoice) {
        $idChoice = $rowChoice['ID'];
        $eo = $i & 1 ? 'odd' : 'even';
        /// if ($rowChoice['Correct'])
        if (in_array($idChoice, $arr_Answer)) {
            $img = $rowChoice['Exclusive'] ? 'radio' : 'check';
            $cls = 'chose';
        } else {
            $img = $rowChoice['Exclusive'] ? 'circle' : 'box';
            $cls = '';
        }
        $td_img = "<td><img src='../images/{$img}.png' height=30";
        if ($img != 'radio') {