"Example_Session"));
//Header("Cache-Control: no-cache");
//Header("Pragma: no-cache");
$db = new DB_Example; // That's a DB_Sql subclass.
$t = new Table; // For formatting results
$t->heading = "on"; // We want table headings..
// ◆◇◆◇ 関数の定義 ◆◇◆◇
// Option を表示
function printOption($name="", $ovalue="", $olabel="", $sel="f") {
print(" \n");
}
// RadioButton を表示
function printRadio($name="", $ovalue="", $olabel="", $sel="f", $opt="") {
print(" \n $olabel\n");
}
// Option List の表示
function printOptionList ($table="", $selid="", $name="", $type="option") {
global $db;
if ($table == "") { exit; }
$sql = "select id, label from $table ";
@$result = $db->query($sql); // selectを実行
$rows = $db->num_rows();
for ($rec = 0; $rec < $rows; $rec++) {
$ovalue = pg_result($result,$rec,0);
$olabel = pg_result($result,$rec,1);
$sel = "f";
if ($ovalue == $selid) {
$sel = "t";
}
if ($type == "option") {
printOption($name, $ovalue, $olabel, $sel);
} else {
if ($type == "radio") {
printRadio($name, $ovalue, $olabel, $sel);
} else {
printRadio($name, $ovalue, $olabel, $sel, "quick");
}
}
}
}
// ◆◇◆◇ コマンドの実行 ◆◇◆◇
//データの取り出しと格納
if ($id > 0) {
$id = ereg_replace("\\\\'","'",$id);
$sql = "select * from tblfacility where id = '$id'";
// magic quote を削除
@$result = $db->query($sql); // selectを実行
$fields = $db->num_fields(); // 列数を取得
$rows = $db->num_rows();
for ($i = 0;$i < $fields;$i++) {
$fname = pg_fieldname($result,$i); // 列名の取り出し
$fdata[$fname] = pg_result($result,0,$i); // データの取り出し
//print($fname . ": " . $fdata[$fname] . "
\n");
}
}
?>
|
|