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

📄 cataloging.class.php

📁 开源MARC数据处理
💻 PHP
📖 第 1 页 / 共 2 页
字号:
			$tag[$i] = substr($MarcFieldsData,$gonine,3);			$gonine = $gonine + 12;			$clearmarc = $clearmarc.$tag[$i].$DataFields[$i]."\r";			$i++;			}				return $clearmarc;		}	function Edit($disp="", $action="",$tag="",$value="", $approved="", $id="", $catid="", $content="", $level="", $bakto="")
		{
		// start MARC from db
		if(!$content)
			{
			$table = Polerio::DBGetTables();
			$tblbib = $table['tblbib'];
			$tblbib_col = $table['tblbib_column'];
			list($dbconn) = Polerio::DBGetConn();
			$sql = "SELECT id, data, mattype FROM marc where id=".$id." ";			$recordSet = $dbconn->Execute($sql);			$approved=1;			if (!$recordSet->EOF) 				{				list($id, $content, $catid) = $recordSet->fields;				}			$marcentries = $this->MarcBinaryDecoder($content);			}		else			{			$marcentries = $content;			}		$Level = "<STRONG>"._PMLLEVEL.": </STRONG><input type=\"text\" name=\"level\" value=\"$level\" size=\"1\">";
		$rec_id = "<STRONG>MARC ID: <b>$id</b></STRONG>";
		$GetModuleURL = Polerio::GetModuleURL().Polerio::Med()."_a=2";
		if($action!=="SAVE AND EXIT") 			{			include_once Polerio::GetModuleURI().'lib/holdings.class.php';
			//$holdingseditdata = Holdings::HoldingsEditData($disp, $action,$tag,$value, $approved, $id, $catid, $content, $level , $bakto);
			//echo $holdingseditdata;
			}
		$i=1;
		$j=0;
		$k=0;
		$c_tag = count($tag);
		$image_url = Polerio::GetModuleURI()."images";
		if(empty($disp)) $disp = $c_tag; 
		if(empty($disp)) $disp = 10;
		$offset="";
		$directory = "";
		$rj = 0;
		$cat=0;
		$Directory='';		if($action=="SAVE" || $action=="SAVE AND EXIT") 			{
			Cataloging::UpdateMARC($marcentries,$id);
			}
		$varStatic = "table1";
		$varDynamic = "loop1";
		$getmedmoduleurl = Polerio::GetModuleURL().Polerio::Med().'_a=2';
		$getbaseurl = Polerio::GetBaseURL();
		$template = polTemplate::LoadTemplate(Polerio::GetModuleURI().'templates/catalogingedit2.html');
		$vars = array("pol::bgcolor1","pol::bgcolor2","pol::bgcolor3",
			"pol::marcid","pol::pmlmediatype","pol::pmlstatus",
			"pol::pmllevel","pol::catoption",
			"pol::level","pol::no","pol::tag","pol::value",
			"pol::getmedmoduleurl","pol::hid","pol::hbakto","pol::hcontent","pol::marcentries"
			);
		$bgcolor1 = Phpmylibrary::bgcolor1();
		$bgcolor2 = Phpmylibrary::bgcolor2();
		$bgcolor3 = Phpmylibrary::bgcolor3();
		$vals = array("$bgcolor1","$bgcolor2","$bgcolor3",
			"$id",_PMLMEDIATYPE,_PMLSTATUS,
			_PMLLEVEL,"$drop_catid",
			"$Level",_PMLNO,_PMLTAG,_PMLVALUE,
			"$getmedmoduleurl","$id","$bakto","$marc","$marcentries"
			);
		$template = polTemplate::ReplaceStatic($template, $vars, $vals);
		return $template;
		}	function DeleteIndexes($id="")
		{
		global $config;
		}
	function UpdateMARC($content="", $id="")
		{
		$binarymarc = $this->MarcBinaryEncoder($content);		
		}	function MarcBinaryEncoder($content='')		{		// this will make the clear marc into binary format		$data = explode("\r",$content);		$tag = array();		$value = array();		$a = 0;		$directory = '';		$offset = 0;		while ($a <= (count($data)-1))			{			if ($a==0) 				{				$tagcontent = substr($data[$a],0,3);				$tagmarc = substr($data[$a],3,strlen($data[$a]));				}			else				{				$tagcontent = substr($data[$a],1,3);				$tagmarc = substr($data[$a],4,strlen($data[$a]));				}			array_push($tag, $tagcontent);			$tagmarc = explode("$",$tagmarc);			$tagmarc = implode(chr(31),$tagmarc);			array_push($value, $tagmarc);			$directory = $directory.$tagcontent.$this->makenzeros(strlen($data[$a]), 4).$this->makenzeros($offset, 5);			$offset = $offset  +  strlen($data[$a]);			$a++;			}		$leader = '00000000000000000000000';		$values = implode(chr(30),$value);		$marc = $leader.$directory.chr(30).$values.chr(30);		return $marc;		}	function createz($z="")		{		$zs = "0";		$zss='';		$i=1;		while($i <= $z)			{			$zss = $zss.$zs;			$i++;			}		return $zss;		}	function makenzeros($no="", $zeros="")		{		$lno = strlen($no);		$no = $this->createz($zeros-$lno).$no;		return $no;		}	function InsertIndexes($id="", $content="")
		{
		global $config;
		return;
		}

	function AddRecordButton()
		{
		$_admin_action='';
		if(Phpmylibrary::IsLoggedIn()==2 || Polerio::SelectGID()==2) {
		$GetModuleURL = Polerio::GetModuleURL().Polerio::Med()."_a=2";
		$_admin_action .=  "<form action=\"$GetModuleURL\" method=\"post\"><table><tr><td><input type=\"submit\" name=\"admin_action\" value=\"Add Record\">";
		$_admin_action .=  "</td></tr></table></form>";
		
		}
		return $_admin_action;
		}	
	
	function InsertMARC($content="", $catid="", $approved="")
		{
		
			$Debug=""; 
			global $config;
			$Debug = "";
			list($dbconn) = Polerio::DBGetConn();
			$table = Polerio::DBGetTables();
			$TblBib       = $table['tblbib']; 	
			$TblBibCol    =    &$table['tblbib_column']; 	
			$accessid = Polerio::TimeAndRandom();
			$query = "INSERT INTO $TblBib ($TblBibCol[id], $TblBibCol[marc], $TblBibCol[catid] , $TblBibCol[approved] ,$TblBibCol[accessid]) values ('$accessid','$content','$catid','$approved','$accessid')";
			$recordSet = $dbconn->Execute($query);
			if($Debug) print"$query\n";
			
			$id = $accessid;
			return $id;		
		}
	
	function DeleteMARC($id="")
		{
			$Debug=""; 
			global $config;
			list($dbconn) = Polerio::DBGetConn();
			$table = Polerio::DBGetTables();	
			$TblBib       = $table['tblbib']; 	
			$TblBibCol    =    &$table['tblbib_column']; 	
		
			$holdings = $table['holdings'];
			$holdings_col = $table['holdings_column'];	
		
			
			$query = "DELETE FROM $TblBib WHERE $TblBibCol[id]=$id";
			$recordSet = $dbconn->Execute($query);
			
			$query2 = "DELETE FROM $holdings WHERE $holdings_col[holdingsid]=$id";
			$recordSet = $dbconn->Execute($query2);
			
			
			if($Debug) print"$query\n"; 
			Cataloging::DeleteIndexes($id);
			return;
		}
	function DeleteMultipleMARC($selected_tbl=array())
		{
		
			for($ii=0;$ii<count($selected_tbl);$ii++)
			{
			
			Cataloging::DeleteMARC($selected_tbl[$ii]);
			}
			return '<br><br><b>Selected Bibliographic Entries Succesfully Deleted!</b><br><br>';
		}
}

?>

⌨️ 快捷键说明

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