Initial commit.

This commit is contained in:
2026-03-10 21:25:26 +08:00
commit 78739bf725
3089 changed files with 472990 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
// File name: fetchrec.inc.php
// Description: PHP subroutine to fetch items from the database
// Date: 2004-05-26
// Author: imacat <imacat@pristine.com.tw>
// Copyright: Copyright (C) 2004-2007 Pristine Communications
// Set the include path
if (!defined("INCPATH_SET")) {
require_once dirname(__FILE__) . "/incpath.inc.php";
}
// Referenced subroutines
require_once "monica/chkfunc.inc.php";
require_once "monica/getlang.inc.php";
require_once "monica/lninfo.inc.php";
require_once "monica/sql.inc.php";
// fetchrec: Try to fetch a record by its serial number
function fetchrec(&$sn, $table)
{
if (!check_sn($sn)) {
return false;
}
$select = "SELECT * FROM $table WHERE sn=$sn;\n";
$result = sql_query($select);
if (sql_num_rows($result) != 1) {
return false;
}
$row = sql_fetch_assoc($result);
// Hash the multi-lingual columns
foreach (sql_cols_ml($table) as $col) {
$row[$col] = $row[$col . "_" . getlang(LN_DATABASE)];
}
return $row;
}
?>