📄 marcexport.class.php
字号:
<?
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
///
/// PhpMyLibrary is a Php-MySQL driven online library automation, it
/// offers cataloging, circulation, and web public access catalog.
///
/// Copyright (C) 2000 Polerio T. Babao Jr. II
///
/// This program is free software; you can redistribute it and/or modify
/// it under the terms of the GNU General Public License as published by
/// the Free Software Foundation; either version 2 of the License, or
/// (at your option) any later version.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU General Public License for more details.
///
/// You should have received a copy of the GNU General Public License
/// along with this program; if not, write to the Free Software
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
///
/// Refer to http://phpmylibrary.sourceforge.net/phpmylibrary for an online
/// demonstration of the phpmylibrary online application program.
///
/// Modified 21 December 17, 2002 01:25p GMT+8
/// Copy of license at http://phpmylibrary.sourceforge.net/LICENSE
/// http://www.phpmylibrary.n3.net or http://phpmylibrary.sourceforge.net
/// Polerio T. Babao Jr.II http://www.polerio.n3.net
/// 43-A Bagong Lote, Potrero Malabon, Metro Manila Philippines.
///
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
Class MARC
{
function PrintMarc($selected_tbl="")
{
echo Phpmylibrary::Marc($selected_tbl);
}
function Export($selected_tbl="")
{
include Polerio::GetPolerioURI().'/lib/zip.lib.php';
$GetBrowser = Polerio::GetBrowser();
define('PMA_USR_BROWSER_AGENT',"$GetBrowser");
$filename = 'phpmylibraryzip';
$ext = 'zip';
$mime_type = 'application/x-zip';
$data = Phpmylibrary::Marc($selected_tbl);
// Send headers
header('Content-Type: ' . $mime_type);
// lem9 & loic1: IE need specific headers
if (PMA_USR_BROWSER_AGENT == 'MSIE') {
header('Content-Disposition: inline; filename="' . $filename . '.' . $ext . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="' . $filename . '.' . $ext . '"');
header('Expires: 0');
header('Pragma: no-cache');
}
$zipfile = new zipfile();
$zipfile -> addFile($data, $filename.'.txt');
echo $zipfile -> file();
} // end fucntion Export
function EmailMARC($selected_tbl="",$recipient="")
{
$subject="PhpMyLibrary MARC Output";
$body = Phpmylibrary::Marc($selected_tbl);
$headers = "From: phpmylibrary@phpmylibrary.com";
Polerio::Mail($recipient, $subject, $body, $headers);
}
function ZIPDATA($selected_tbl="")
{
include Polerio::GetPolerioURI().'/lib/zip.lib.php';
define('PMA_USR_BROWSER_AGENT','IE');
$file ='phpmylibrary.txt';
$filename = 'phpmylibrarydata';
$ext = 'zip';
$mime_type = 'application/x-zip';
$data = Phpmylibrary::Viewnohtml($selected_tbl);
// Send headers
header('Content-Type: ' . $mime_type);
// lem9 & loic1: IE need specific headers
if (PMA_USR_BROWSER_AGENT == 'IE') {
header('Content-Disposition: inline; filename="' . $filename . '.' . $ext . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="' . $filename . '.' . $ext . '"');
header('Expires: 0');
header('Pragma: no-cache');
}
$zipfile = new zipfile();
$zipfile -> addFile($data, $filename.'.txt');
echo $zipfile -> file();
} // end fucntion Export
function EmailDATA($selected_tbl="",$recipient="")
{
$subject="PhpMyLibrary DATA Output";
$body = Phpmylibrary::Viewnohtml($selected_tbl);
$headers = "From: phpmylibrary@phpmylibrary.com";
Polerio::Mail($recipient, $subject, $body, $headers);
}
} // End Class
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -