⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cataloging.class.php

📁 开源MARC数据处理
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?/*apr-12-2004	[] put all helper functions in phpmylibrary. just thinking.	[] pythoning.	[] the cataloging area will be changed. Just type in the tags.	[] i will make this pluggable to postnuke and phpnuke	[] i will follow the linux logging system wherein there is a root	username, and a capability to add groups which has certain capability	first of all i would like to follow the linux visudo like system wherein you can	add new username that has a root priviledge. This is useful in postnuke and	phpnuke as an addons because i will be determining the current user logged-in	and not its id that could bring conflict to namespace so to speak.	group may compose primarily of cataloger, circulation, admin.	[] i really wanted to convert the configuration file config.inc.php into db based	configuration so that python apps will not read this file but only load it from the	database, very nice really but very tedious work.	[] i just want now to finish the cataloging area.	when this source is released i am hoping more developers will join as I already	make the source code readable/understandable by beginner programmer with a basic knowledge	of classes, include and adodb function.	[] thanks to adodb but the linux version of sqlite seems not to be working properly on php432,	but it runs very good on windows, thus windows users is still not deprived from this postgresql-developed	new version of phpmylibrary because it can be ported smoothly to sqlite, sorry to mysql users but 	i really have to tweak codes to make it usabel for mysql users because MYSQL does not still support	INTERSEC, UNION, EXCEPT, oh my god. how long it will take for them to add this feature, i am liking to	believe that mysql really is not a good software but a well marketed beginner database. hope this will	not be its difinition next year. A good software must not sit back on a very good marketing effort but on a 	very well criticized and well developed application. very long, isn't. Even in programming, there is an art and	literature. Haven't you observed writers,..	[] this program really start from a modified searchhoo code which i just found on the net and a modified	postnuke codes. and some reading from leon atkinson core php developers, nice combination, this software	phpmylibrary had occured for the masses.apr-22-2004	[] use a tag separator, i think this is needed for multiline entries, if i use one line per tag/field then the 	encoding will become long line for long entries. with multiline you can put it below, same applies to python 	program i think. thus the percent sign will be encoded again. perhaps this can be solved by word wrap	[] the marc entries should have its own marc code, like wg. because if i will just put incremented numbers it is	not good because you will not be able to monitor the lost book or the deleted book. There should be a separate summary	table in case of loss/deleted book. 	[] i will create an application in python that will integrate the marc code. also the accession code. All marc is simply a	marc only. no id or whatever and its very difficult for monitoring. i donot like incremental numbers.*/
Class Cataloging
	{	function Cataloging() 		{		// Constructor		// Initialize attributes		$this->pol = '';		$this->tbl = '';		$this->dbc = '';		$this->pml = '';		$this->tpl = '';		$this->usr = '';		$this->web = '';		$this->cat = '';		$this->trn = '';		$this->hld = '';		$this->fdt = '';		$this->_post = array();		$this->_get = array();		$this->_files = array();		}	function SetArgvs($_post=array(), $_get=array(), $_files=array())		{		$this->_post = $_post;		$this->_get = $_get;		$this->_files = $_files;		}	function SetNeededClasses($pol='', $pml='', $tpl='', $usr='', $web='', $cat='', $trn='', $hld='', $fdt='')		{		$this->pol = $pol;		$this->dbc = $this->pol->DBGetConn();		$this->tbl = $this->pol->DBGetTables();		$this->pml = $pml;		$this->tpl = $tpl;		$this->usr = $usr;		$this->web = $web;		$this->cat = $cat;		$this->trn = $trn;		$this->hld = $hld;		$this->fdt = $fdt;		}	function Add($disp="", $action="",$tag="",$value="", $approved="", $id="", $catid="", $content="", $level="")
		{
		if(empty($id)) 			{
			$ca = Polerio::GetPolerioURI().'inc';
			$body = "<script src=\"$ca/functions.js\" type=\"text/javascript\" language=\"javascript\"></script>";
			}
		if($action!=="SAVE AND EXIT" AND $id) 			{
			include_once Polerio::GetModuleURI().'/lib/holdings/Holdings.php';
			Holdings::HoldingsEditData($disp, $action,$tag,$value, $approved, $id, $catid, $content, $level , $bakto);
			}
		if($catid==1) $catid_sel1 = "selected"; else $catid_sel1 = "";
		if($catid==2) $catid_sel2 = "selected"; else $catid_sel2 = "";
		if($catid==3) $catid_sel3 = "selected"; else $catid_sel3 = "";
		if($catid==4) $catid_sel4 = "selected"; else $catid_sel4 = "";
		if($catid==5) $catid_sel5 = "selected"; else $catid_sel5 = "";
		if($catid==6) $catid_sel6 = "selected"; else $catid_sel6 = "";
		if($catid==7) $catid_sel7 = "selected"; else $catid_sel7 = "";
		if($catid==8) $catid_sel8 = "selected";	else $catid_sel8 = "";
		$drop_catid = "<STRONG>&nbsp;&nbsp;"._PMLMEDIATYPE.":</STRONG>
			<SELECT NAME=\"catid\">	
			<OPTION VALUE=\"1\" $catid_sel1>"._PMLBOOKS." </OPTION>
			<OPTION VALUE=\"2\" $catid_sel2>"._PMLSERIALS." </OPTION>
			<OPTION VALUE=\"3\" $catid_sel3>"._PMLMAPS." </OPTION>
			<OPTION VALUE=\"4\" $catid_sel4>"._PMLMUSIC."</OPTION>
			<OPTION VALUE=\"5\" $catid_sel5>"._PMLVISUALMATERIAL." </OPTION>
			<OPTION VALUE=\"6\" $catid_sel6>"._PMLCOMPUTERFILES." </OPTION>
			<OPTION VALUE=\"7\" $catid_sel7>"._PMLMIXEDMATERIAL." </OPTION>
			<OPTION VALUE=\"8\" $catid_sel8>"._PMLTHESIS."</OPTION>
			</SELECT>";
		if(empty($approved)) $approved=1;
		if($approved==0) $apped0 = "selected"; else $apped0 = "";
		if($approved==1) $apped1 = "selected"; else $apped1 = "";
		$approved_catid = "<STRONG>&nbsp;&nbsp;"._PMLSTATUS.":</STRONG>
		<SELECT NAME=\"approved\">
			<OPTION VALUE=\"1\" $apped1>"._PMLAPPROVED."</OPTION>
			<OPTION VALUE=\"0\" $apped0>"._PMLDISAPPROVED."</OPTION>
			</SELECT>";
		$Level = "<STRONG>"._PMLLEVEL.": </STRONG><input type=\"text\" name=\"level\" value=\"$level\" size=\"1\">";
		$GetModuleURL = Polerio::GetModuleURL().Polerio::Med()."_a=2";
		$i=1;
		$j=0;
		$k=0;
		$image_url = Polerio::GetPolerioURL()."module/images";
		include_once Polerio::GetModuleURI().'lib/marcdefs.php';
		if(empty($disp)) $disp = 10;
		$offset="";
		$directory = "";
		$Directory="";
		$rj = 0;
		$cat = 0;
		while($i <= $disp) 			{
			$no = $i;
			@$ktag[$rj] = $tag[$j];
			$tag_names = @$tag_name[$ktag[$rj]];
			$tag_defss = @$tag_defs[$ktag[$rj]];
			$tag_delis = @$tag_deli[$ktag[$rj]];
			$rj++;
			$lang_desc = _PMLDESCRIPTION;
			$lang_deli = _PMLDELIMITERS;
			@$vvalue = $value[$k];
			@$val_length = strlen($value[$k])+1; 
			@$Directory = $Directory.$tag[$k].Cataloging::makenzeros($val_length, 4).Cataloging::makenzeros($offset, 5);  
			@$DataFields[$k] = $value[$k]; 
			$offset = $offset+$val_length;
			@$helpmarctag =  "<a href=\"javascript:explain('".$tag[$j]."', '".$tag_names."', '".$tag_defss."', '".$tag_delis."', '".$lang_desc."', '".$lang_deli."');\" onMouseOver=\"window.status='"._PMLCLICKFOREXPLANATION."';return true;\" onMouseOut=\"window.status='';return true;\">";
			@$helpmarctag .=  "<img src=\"$image_url/help.gif\" border=\"0\" width=\"18\" height=\"18\" alt=\"Help on MARC Tag $tag[$j]\"></a>";  
			@$resulta[$cat] = array($tag[$j],$no,$helpmarctag,$vvalue ); 
			$cat++;
			$i++;
			$j++;
			$k++;
			}
		$DataFields = implode(chr(30),$DataFields);
		$DataFieldsCount = (strlen($DataFields)+1);
		$DataFields = explode("$",$DataFields);
		$DataFields = implode(chr(31),$DataFields);
		$DirectoryCount = (strlen($Directory)+ 25);
		$Leader  = Cataloging::makenzeros($DataFieldsCount+$DirectoryCount, 5);
		$Leader .= "babao2".Cataloging::makenzeros($DirectoryCount, 5)."polerioj";
		$marc = $Leader.$Directory.chr(30).$DataFields.chr(30);
		$varStatic = "table1";
		$varDynamic = "loop1";
		$getmedmoduleurl = Polerio::GetModuleURL().Polerio::Med().'_a=2';
		$getbaseurl = Polerio::GetBaseURL();
		$template = polTemplate::LoadTemplate(Polerio::GetModuleURI().'templates/catalogadd.html');
		$vars = array("pol::bgcolor1","pol::bgcolor2","pol::bgcolor3",
			"pol::marcid","pol::pmlmediatype","pol::pmlstatus",
			"pol::catoption","pol::appoption",
			"pol::level","pol::no","pol::tag","pol::value",
			"pol::getmedmoduleurl","pol::hid","pol::hbakto","pol::hcontent","pol::disp"
			);
		$bgcolor1=Phpmylibrary::bgcolor1();
		$bgcolor2=Phpmylibrary::bgcolor2();
		$bgcolor3=Phpmylibrary::bgcolor3();
		global $bakto;
		$vals = array("$bgcolor1","$bgcolor2","$bgcolor3",
			"$id",_PMLMEDIATYPE,_PMLSTATUS,
			"$drop_catid","$approved_catid",
			"$Level",_PMLNO,_PMLTAG,_PMLVALUE,
			"$getmedmoduleurl","$id","$bakto","$marc","$disp");
		$template = polTemplate::ReplaceStatic($template, $vars, $vals);
		$vars = array("pol::vtagvalue","pol::vno","pol::helpmarctag","pol::vvalue");
		$template = polTemplate::DynamicRows($template, $varStatic, $varDynamic, $vars, $resulta);
		return $body."".$template;
		}	function MarcBinaryDecoder($content='')		{		// this will return a editable view of marc data		$content = str_replace(">"," ",$content);		$content = str_replace("<"," ",$content);		$content = str_replace("\""," ",$content);		$content = str_replace(chr(29),"",$content);		$ExplodeMarc = explode(chr(30),$content);		$DataFields = substr($content,(strlen($ExplodeMarc[0])+1),strlen($content));		$DataFields = explode(chr(31),$DataFields);		$DataFields = implode("$",$DataFields);		$DataFields = explode(chr(30),$DataFields);		$value = $DataFields;		$MarcFieldsCount = (((strlen($ExplodeMarc[0])-24)/12)-1);		$MarcFieldsData = substr($ExplodeMarc[0],24,strlen($ExplodeMarc[0]));		$clearmarc='';		$i = 0;		while ( $i <= $MarcFieldsCount)			{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -