db ();
getint ("fk_books");
getstr ("filemask");
pageheader ("Files for EBook #$fk_books");
p ("Careful! If you change the Ebook number you link the file to a different Ebook.");
p ("Note: you cannot add files to the database. " .
"That is done automagically by a nightly cron job.");
p ("Goto Edit Book Page — " .
"etext/${fk_books}\">Goto Bibrec Page");
function mk_options ($name, $options, $option) {
$ret = "";
foreach ($options as $value => $opt) {
$selected = ($opt == $option) ? " selected=\"selected\"" : "";
$ret .= "\n";
}
return "\n";
}
$filetypes[null] = "unknown";
$db->Exec ("select * from filetypes order by filetype");
if ($db->FirstRow ()) {
do {
$filetypes[$db->Get ("pk")] = $db->Get ("filetype");
} while ($db->NextRow ());
}
$compressions[null] = "unknown";
$db->Exec ("select * from compressions order by compression");
if ($db->FirstRow ()) {
do {
$compressions[$db->Get ("pk")] = $db->Get ("compression");
} while ($db->NextRow ());
}
$encodings[null] = "unknown";
$db->Exec ("select * from encodings order by pk");
if ($db->FirstRow ()) {
do {
$encodings[$db->Get ("pk")] = $db->Get ("pk");
} while ($db->NextRow ());
}
class HeadColumn extends dbtSimpleColumn {
function __construct () {
parent::__construct (null, "", "narrow");
}
function Data ($db) {
$filename = $db->get ("filename");
if (preg_match ("/\.zip$/i", $filename))
return "
";
}
}
class CompressionColumn extends dbtSimpleColumn {
function __construct () {
parent::__construct (null, "Compression", "pgdbfilescompression");
}
function Data ($db) {
global $compressions;
return "
";
}
}
class EncodingColumn extends dbtSimpleColumn {
function __construct () {
parent::__construct (null, "Encoding", "pgdbfilesencoding");
}
function Data ($db) {
global $encodings;
return "