[insert_php] $db_host=”office.avea.cn”;
$db_user=”webuser”;
$db_pwd=”avea.cc”;
$db_name=”attend”;

if (!mysql_connect($db_host,$db_user,$db_pwd)) {
die( “Unable to connect host”);
}

if (!mysql_select_db($db_name)) {
die( “Unable to select database”);
}

$now=time();
$st=date(‘Y-m-d H:i:s’,$now);
$default=1;
$display=20;

echo ““;
echo “

“;
$auto=30;
echo ““;

echo ““;

if ($display) {
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

\n”;

$query = “SELECT”;
$query .= ” logs.code,”;
$query .= ” logs.ulen,”;
$query .= ” logs.uid,”;
$query .= ” logs.uida,”;
$query .= ” logs.stamp,”;
$query .= ” logs.server,”;
$query .= ” logs.host,”;
$query .= ” logs.mode,”;
$query .= ” logs.type,”;
$query .= ” logs.result,”;
$query .= ” persons.name”;
$query .= ” FROM logs”;
$query .= ” LEFT JOIN persons ON persons.code=logs.code”;

$model=$_GET[“model”];
if ($model) {
$query .= ” where logs.mode=’$model'”;
}
$query .= ” ORDER BY logs.server DESC, logs.stamp DESC”;
$query .= ” limit $display”;
$result = mysql_query($query);

$counter=$default;
while ($myrow = mysql_fetch_object($result)) {
$counter++;
if ($counter & 1) {
echo “

“;
} else {
echo “

“;
}
echo “

“;
if ($myrow->stamp==”2007-01-01 00:00:01”) {
echo “

“;
} else {
echo “

“;
}
echo “

“;
echo “

“;
if ($myrow->name) {
echo “

“;
} else {
if ($myrow->code > 0) {
if ($myrow->mode==MF2A) {
echo “

“;
} else {
if ($myrow->mode == MF2) {
echo “

“;
} else {
echo “

“;
}
}
} else {
echo “

“;
}
}
echo “

“;
echo “

“;
echo “

“;
echo “

\n”;
}

echo “

Reader’s Time Server’s Time Reader’s IP Staff/Code/UID Model Source Command
N.A. $myrow->stamp $myrow->server $myrow->host $myrow->name $myrow->uida $myrow->uid $myrow->code N.A. $myrow->mode $myrow->type $myrow->result

“;

echo “

“;
echo ““;
}
[/insert_php]