示例#1
0
 function logToFile($msg)
 {
     global $site_home;
     if (!$this->sqlLogging) {
         return;
     }
     if ($this->logFilename == '') {
         $this->logFilename = $site_home . '/log/log' . date('YmdHis') . '.txt';
     }
     error_log("\n---------" . date('Y-m-d H:i:s') . "---------\n" . $msg . "\n" . stacktracestring(2) . "\n" . $this->getContext() . "\n", 3, $this->logFilename);
 }
示例#2
0
        $grp_names[$i] = pg_escape_string($grp_names[$i]);
        $sql .= "update prj_tutor set tutor_id= {$tutors[$i]},grp_name='{$grp_names[$i]}' where prjtg_id={$prjtg_ids[$i]};\n";
    }
    $sql .= "commit;";
    //echo "<pre>$sql</pre>";
    $resultSet = $dbConn->Execute($sql);
    if ($resultSet === false) {
        echo "<br>Cannot set prj tutors with <pre>\"" . $sql . '"</pre>, cause ' . $dbConn->ErrorMsg() . "<br>";
        stacktrace(1);
        die;
    }
}
$sql = "select assessment_due from prj_milestone where prjm_id={$prjm_id}";
$resultSet = $dbConn->Execute($sql);
if ($resultSet === false) {
    $dbConn->log('<br>Cannot set prj tutors with <pre>' . $sql . '</pre> cause ' . $dbConn->ErrorMsg() . "<br/>" . stacktracestring(1));
} else {
    if (!$resultSet->EOF) {
        extract($resultSet->fields);
    }
}
$page_opening = "Select the number of groups and allocate the tutors. prjm_id {$prjm_id} prj_id {$prj_id} milestone {$milestone}";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$nav->setInterestMap($tabInterestCount);
$sqltut = "select prjtg_id,t.tutor,pt.tutor_id,pt.grp_num, " . "gs.size as scount, rtrim(grp_name) as grp_name\n" . " from prj_tutor pt \n" . " join tutor t on (t.userid=pt.tutor_id)\n" . " left join grp_size gs using(prjtg_id)\n" . "where prjm_id={$prjm_id} \n" . "order by grp_num asc";
//echo "<pre>$sqltut</pre>";
$resultSet = $dbConn->Execute($sqltut);
if ($resultSet === false) {
    echo "<br>Cannot get groups with \"" . $sqltut . '", cause ' . $dbConn->ErrorMsg() . "<br>";
    stacktrace(1);
    die;