Displaying junk code in index.php

Help
Swaroop. S
2007-03-07
2013-04-24
  • Swaroop. S
    Swaroop. S
    2007-03-07

    Dear all,

    I have installed PhpmyLibrary and after installation it asks to remove the install folder. After removing the install folder i get a page full of code and somewhere in that long page he asks for username and password. If I give the username and password it says "you are not authorized to view this page". Please do help me in this regard.

    Waiting for the reply at the earliest...

     
    • David Robley
      David Robley
      2007-03-25

      There seems to be a mixture of short and long open tags used throughout the application - either you need to set short_open_tag = Off for the directory you installed in, or go through the scripts and change <? to <?php

       
    • Gowda
      Gowda
      2007-04-06

      For me also it showing some code after i click the &quot;View Site&quot;
      
      
      here is code wat i&nbsp; got 
      
      
      
      Execute\($sql\); return; \} // added to get just the value. apr-29-2006 polerio function GetConfigVar\($name=''\) \{ list\($dbconn\) = Polerio::DBGetConn\(\); $table = Polerio::DBGetTables\(\); $v = $table\['vars'\]; $vc = $table\['vars\_column'\]; $sql = &quot; SELECT &quot;; $sql .= &quot; $vc\[value\] &quot;; $sql .= &quot; from $v WHERE $vc\[name\]='$name'&quot;; //echo $sql; $recordSet = $dbconn-&gt;Execute\($sql\); list\($value\) = $recordSet-&gt;fields; return $value; \} function SelectModuleVar\($name=''\) \{ list\($dbconn\) = Polerio::DBGetConn\(\); $table = Polerio::DBGetTables\(\); $v = $table\['vars'\]; $vc = $table\['vars\_column'\]; $sql = &quot; SELECT &quot;; $sql .= &quot; $vc\[id\], $vc\[category\], $vc\[user\], $vc\[group\], $vc\[name\], $vc\[value\] &quot;; $sql .= &quot; from $v WHERE $vc\[name\]='$name'&quot;; //echo $sql; $recordSet = $dbconn-&gt;Execute\($sql\); list\($id, $category, $user, $group, $name, $value\) = $recordSet-&gt;fields; $ret = array\('id'=&gt;$id, 'category'=&gt;$category, 'user'=&gt;$user, 'group'=&gt;$group, 'name'=&gt;$name, 'value'=&gt;$value\); //print\_r\($ret\); return $ret; \} function UpdateModuleVar\($name='', $value=''\) \{ list\($dbconn\) = Polerio::DBGetConn\(\); $table = Polerio::DBGetTables\(\); $v = $table\['vars'\]; $vc = $table\['vars\_column'\]; $sql = &quot; UPDATE $v SET &quot;; $sql .= &quot; $vc\[value\]='$value'&quot;; $sql .= &quot; WHERE $vc\[name\]='$name'&quot;; //echo $sql; $recordSet = $dbconn-&gt;Execute\($sql\); return; \} function DeleteModuleVar\(\) \{ list\($dbconn\) = Polerio::DBGetConn\(\); $table = Polerio::DBGetTables\(\); $v = $table\['vars'\]; $vc = $table\['vars\_column'\]; \} function Linux\_Server\(\) \{ if\(\(ereg\(&quot;Linux&quot;,getenv\(&quot;SERVER\_SOFTWARE&quot;\)\)\) || \(ereg\(&quot;Unix&quot;,getenv\(&quot;SERVER\_SOFTWARE&quot;\)\)\) \) return true; \} function PostNuke\(\) \{ global $op, $name; if\($op &amp;&amp; $name\) return true; else return false; \} /\*\* \* get base URI \* @returns string \* @return base URI \*/ function GetBaseURI\(\) \{ global $HTTP\_SERVER\_VARS; // Get the name of this URI // Start of with REQUEST\_URI if \(isset\($HTTP\_SERVER\_VARS\['REQUEST\_URI'\]\)\) \{ $path = $HTTP\_SERVER\_VARS\['REQUEST\_URI'\]; \} else \{ $path = getenv\('REQUEST\_URI'\); \} if \(\(empty\($path\)\) || \(substr\($path, -1, 1\) == '/'\)\) \{ // REQUEST\_URI was empty or pointed to a path // Try looking at PATH\_INFO $path = getenv\('PATH\_INFO'\); if \(empty\($path\)\) \{ // No luck there either // Try SCRIPT\_NAME if \(isset\($HTTP\_SERVER\_VARS\['SCRIPT\_NAME'\]\)\) \{ $path = $HTTP\_SERVER\_VARS\['SCRIPT\_NAME'\]; \} else \{ $path = getenv\('SCRIPT\_NAME'\); \} \} \} $path = preg\_replace\('/\[\#\?\].\*/', '', $path\); $path = dirname\($path\); if \(preg\_match\('\!^\[/\\\\\\\]\*$\!', $path\)\) \{ $path = ''; \} return $path; \} function GetBaseURL\(\) \{ global $HTTP\_SERVER\_VARS; if \(empty\($HTTP\_SERVER\_VARS\['HTTP\_HOST'\]\)\) \{ $server = getenv\('HTTP\_HOST'\); \} else \{ $server = $HTTP\_SERVER\_VARS\['HTTP\_HOST'\]; \} $path = Polerio::GetBaseURI\(\); if\(Polerio::PostNuke\(\)\) return &quot;http://$server$path/&quot;; return &quot;http://$server$path/&quot;; \} /\*\* \* private function \* @returns string \*/ function GetRoot\(\) \{ global $HTTP\_SERVER\_VARS; if \(empty\($HTTP\_SERVER\_VARS\['DOCUMENT\_ROOT'\]\)\) \{ $root= getenv\('DOCUMENT\_ROOT'\); \} else \{ $root = $HTTP\_SERVER\_VARS\['DOCUMENT\_ROOT'\]; \} return $root; \} /\*\* \* generate c:/htodcs/modulename/polerio/ \* generate /var/www/html/ . . . \* @returns string \*/ function GetPolerioURI\(\) \{ $PolerioModuleRoot = './polerio/'; if\(PostNuke\(\)\) $PolerioModuleRoot = './modules/PhpMyLibrary/polerio/'; return $PolerioModuleRoot; \} function GetPolerioURL\(\) \{ global $name; // For postnuke if\(Polerio::PostNuke\(\)\) $PolerioModuleRoot = Polerio::GetBaseURL\(\).'modules/'.$name.'/polerio/'; else $PolerioModuleRoot = Polerio::GetBaseURL\(\).'/polerio/'; return $PolerioModuleRoot; \} /\*\* \* generate c:/htodocs/modulename/polerio/module/ . . . \* generate /var/www/html/ . . . \* @returns string \*/ function GetModuleURI\(\) \{ return Polerio::GetPolerioURI\(\).'PhpMyLibrary/'; \} /\*\* \* generate http://modulename/polerio/module/index.php \* @returns string \*/ function GetModuleURL\(\) \{ global $op, $name, $file; // For postnuke compatibility if\(Polerio::PostNuke\(\)\) $link = 'modules.php?op=modload&amp;name='.$name.'&amp;file=index'; else $link = 'index.php'; return Polerio::GetBaseURL\(\).$link; \} /\*\* \* to generate static color \* @returns static color \*/ function useColora\(\) \{ global $pmlconfig; if\($pmlconfig\['PnThOver'\]\!=0\) \{ $bcolor2 = $pmlconfig\['bgcolor1'\]; $bcolor1 = $pmlconfig\['bgcolor3'\]; \} else \{ global $bgcolor1,$bgcolor2,$bgcolor3; $bcolor2 = $bgcolor1; $bcolor1 = $bgcolor3; \} static $ColorValue; if\($ColorValue==$bcolor2\) $ColorValue=$bcolor1; else $ColorValue=$bcolor2; return\($ColorValue\); \} /\*\* \* check to see if this is a local referral \* @returns bool \* @return true if locally referred, false if not \*/ function pnLocalReferer\(\) \{ global $HTTP\_SERVER\_VARS; if \(empty\($HTTP\_SERVER\_VARS\['HTTP\_HOST'\]\)\) \{ $server = getenv\('HTTP\_HOST'\); \} else \{ $server = $HTTP\_SERVER\_VARS\['HTTP\_HOST'\]; \} if \(empty\($HTTP\_SERVER\_VARS\['HTTP\_REFERER'\]\)\) \{ $referer = getenv\('HTTP\_REFERER'\); \} else \{ $referer = $HTTP\_SERVER\_VARS\['HTTP\_REFERER'\]; \} if \(preg\_match\(&quot;\!^http://$server/\!&quot;, $referer\)\) \{ return true; \} else \{ return false; \} \} function Med\(\) \{ $Med = &quot;?&quot;; if\(Polerio::PostNuke\(\)\) $Med = &quot;&amp;&quot;; return $Med; \} // pn start function Init\(\) \{ // proper error\_repoting // E\_ALL for development // error\_reporting\(E\_ALL\); // without warnings and notices for release //development error\_reporting\(E\_ALL\); //release //error\_reporting\(E\_ALL &amp; ~E\_NOTICE &amp; ~E\_WARNING\); //phpinfo\(\); // Hack for some weird PHP systems that should have the // LC\_\* constants defined, but don't if \(\!defined\('LC\_TIME'\)\) \{ define\('LC\_TIME', 'LC\_TIME'\); \} // register globals anti-hack from mambo globals.php define\( 'RG\_EMULATION', 1 \); if \(RG\_EMULATION == 0\) \{ // force register\_globals = off Polerio::unregisterGlobals\(\); \} else if \(ini\_get\('register\_globals'\) == 0\) \{ // php.ini has register\_globals = off and emulate = on Polerio::registerGlobals\(\); \} else \{ // php.ini has register\_globals = on and emulate = on // just check for spoofing Polerio::checkInputArray\( $\_FILES \); Polerio::checkInputArray\( $\_ENV \); Polerio::checkInputArray\( $\_GET \); Polerio::checkInputArray\( $\_POST \); Polerio::checkInputArray\( $\_COOKIE \); Polerio::checkInputArray\( $\_SERVER \); if \(isset\( $\_SESSION \)\) \{ Polerio::checkInputArray\( $\_SESSION \); \} \} //Installation sub folder check, removed for work with SVN if \(file\_exists\( 'installation/index.php' \)\) \{ define\( '\_INSTALL\_CHECK', 1 \); include \('offline.php'\); exit\(\); \} // ADODB configuration define\('POLERIO\_ADODB\_DIR',Polerio::GetPolerioURI\(\)\); include POLERIO\_ADODB\_DIR.'adodb/adodb.inc.php'; include POLERIO\_ADODB\_DIR.'adodb/tohtml.inc.php'; // Load filtering include\_once Polerio::GetPolerioURI\(\).'phpInputFilter/class.inputfilter.php'; // Load templating class include\_once Polerio::GetPolerioURI\(\).'patTemplate/patErrorManager.php'; include\_once Polerio::GetPolerioURI\(\).'patTemplate/patTemplate.php'; // Initialise and load configuration global $config; $config = array\(\); include Polerio::GetPolerioURI\(\).'config/conf.php'; // Initialise and load tables global $table; $table = array\(\); include Polerio::GetPolerioURI\(\).'lib/tables.php'; // Connect to database if \(\!Polerio::DBInit\(\)\) \{ die\('Database initialisation failed'\); \} // Load filtering if \(\!Polerio::FilteringInit\(\)\) \{ die\('Filtering initialisation failed'\); \} // Load pat Templating if \(\!Polerio::TemplateInit\(\)\) \{ die\('Filtering initialisation failed'\); \} // Start Session to non-post-nuked site if\(\!Polerio::PostNuke\(\)\) \{ // session management include Polerio::GetPolerioURI\(\).'lib/Session2.php'; if \(Polerio::ConfigGetVar\('anonymoussessions'\) || \!empty\($\_REQUEST\['POLERIOSID'\]\)\) \{ // Start session if \(\!SessionSetup\(\)\) \{ die\('Session setup failed'\); \} if \(\!SessionInit\(\)\) \{ die\('Session initialisation failed'\); \} \} \} //global $absolutePath; return true; \} // Init\(\) function TemplateInit\(\) \{ global $template; $template = new patTemplate\(\); $tmpldir = Polerio::GetModuleURI\(\).'templates'; $template-&gt;setBasedir\($tmpldir\); return true; \} function Template\(\) \{ global $template; return $template; \} function FilteringInit\(\) \{ global $filter; $filter = new InputFilter\(\); return true; \} function Filtering\(\) \{ global $filter; return $filter; \} function InputFilter\($input=&quot;&quot;\) \{ $filter = Polerio::Filtering\(\); $ret = $filter-&gt;process\($input\); return $ret; \} // aprl 30, 2006 by polerio. needed in block //$tags = array\(&quot;em&quot;, &quot;br&quot;\); //$attributes = array\(&quot;title&quot;, &quot;selected&quot;\); //http://cyberai.com/inputfilter/examples/string.php function CustomInputFilter\($input=&quot;&quot;, $tags=array\(\), $attributes=array\(\)\) \{ $myFilter = new InputFilter\($tags, $attributes\); $ret = $myFilter-&gt;process\($input\); return $ret; \} function DBInit\(\) \{ // Get database parameters global $config; $dbtype = $config\['dbtype'\]; $dbhost = $config\['dbhost'\]; $dbname = $config\['dbname'\]; $dbuname = $config\['dbuname'\]; $dbpass = $config\['dbpass'\]; // Database connection is a global \(for now\) global $dbconn; // Start connection $dbconn = ADONewConnection\($dbtype\); $dbh = $dbconn-&gt;Connect\($dbhost, $dbuname, $dbpass, $dbname\); if \(\!$dbh\) \{ $dbpass = &quot;&quot;; die\(&quot;$dbtype://$dbuname:$dbpass@$dbhost/$dbname failed to connect&quot; . $dbconn-&gt;ErrorMsg\(\)\); \} global $ADODB\_FETCH\_MODE; $ADODB\_FETCH\_MODE = ADODB\_FETCH\_NUM; // force oracle to a consistent date format for comparison methods later on if \(strcmp\($dbtype, 'oci8'\) == 0\) \{ $dbconn-&gt;Execute\(&quot;alter session set NLS\_DATE\_FORMAT = 'YYYY-MM-DD HH24:MI:SS'&quot;\); \} return true; \} /\*\* \* get a list of database connections \* @returns array \* @redturn array of database connections \*/ function DBGetConn\(\) \{ global $dbconn; return array\($dbconn\); \} function DBGetTables\(\) \{ global $table; return $table; \} function PhpMyLibrary\(\) \{ global $site\_footer; $some = &quot;@ PhpMyLibrary 2.0.3-1&quot;; return $site\_footer\[1\].&quot;
      
      &quot;; \} function Mail\($recipient=&quot;&quot;, $subject=&quot;&quot;, $body=&quot;&quot;, $headers=&quot;&quot;\) \{ mail\($recipient, $subject, $body, $headers\); \} function GetBrowser\(\) \{ /\* Get the Browser data \*/ if\(\(ereg\(&quot;Nav&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(ereg\(&quot;Gold&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(ereg\(&quot;X11&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(ereg\(&quot;Mozilla&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(ereg\(&quot;Netscape&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) AND \(\!ereg\(&quot;MSIE&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) AND \(\!ereg\(&quot;Konqueror&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\)\) $browser = &quot;Netscape&quot;; // Opera needs to be above MSIE as it pretends to be an MSIE clone elseif\(ereg\(&quot;Opera&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $browser = &quot;Opera&quot;; elseif\(ereg\(&quot;MSIE&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $browser = &quot;MSIE&quot;; elseif\(ereg\(&quot;Lynx&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $browser = &quot;Lynx&quot;; elseif\(ereg\(&quot;WebTV&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $browser = &quot;WebTV&quot;; elseif\(ereg\(&quot;Konqueror&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $browser = &quot;Konqueror&quot;; elseif\(\(eregi\(&quot;bot&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(ereg\(&quot;Google&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(ereg\(&quot;Slurp&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(ereg\(&quot;Scooter&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(eregi\(&quot;Spider&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(eregi\(&quot;Infoseek&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\)\) $browser = &quot;Bot&quot;; else $browser = &quot;Other&quot;; return $browser; \} function GetOS\(\) \{ /\* Get the Operating System data \*/ if\(ereg\(&quot;Win&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $os = &quot;Windows&quot;; elseif\(\(ereg\(&quot;Mac&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) || \(ereg\(&quot;PPC&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\)\) $os = &quot;Mac&quot;; elseif\(ereg\(&quot;Linux&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $os = &quot;Linux&quot;; elseif\(ereg\(&quot;FreeBSD&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $os = &quot;FreeBSD&quot;; elseif\(ereg\(&quot;SunOS&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $os = &quot;SunOS&quot;; elseif\(ereg\(&quot;IRIX&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $os = &quot;IRIX&quot;; elseif\(ereg\(&quot;BeOS&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $os = &quot;BeOS&quot;; elseif\(ereg\(&quot;OS/2&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $os = &quot;OS/2&quot;; elseif\(ereg\(&quot;AIX&quot;, getenv\(&quot;HTTP\_USER\_AGENT&quot;\)\)\) $os = &quot;AIX&quot;; else $os = &quot;Other&quot;; return $os; \} /\* \* I've read about microtime\(\) \* I think it is more useful than calling the random \* The purpose of this is just to make distinct number \* Advantage, fixed distance in microtime. rand is not. \* srand\(\(double\)microtime\(\)\*1000000\); \* return time\(\).rand\(\); \* \*/ function TimeAndRandom\(\) \{ $tim = microtime\(\); $mtime = substr\($tim,11,10\).substr\($tim,2,8\); return $mtime; \} function CheckEmailPassed\($email=&quot;&quot;\) \{ if \(\!eregi \(&quot;^\(\[a-z0-9\_\]|\\\\-|\\\\.\)+@\(\(\[a-z0-9\_\]|\\\\-\)+\\\\.\)+\\\\.\)+\[a-z\]\{2,4\}$&quot;, $email\)\) die \(&quot;Invalid Email&quot;\); return; \} /\*\* \* Get a session variable \* \* @param name $ name of the session variable to get \*/ function SessionGetVar\($name\) \{ if\(isset\($name\) &amp;&amp; isset\($\_SESSION\['PMLV' . $name\]\)\) \{ return $\_SESSION\['PMLV' . $name\]; \} return false; \} /\*\* \* Set a session variable \* \* @param name $ name of the session variable to set \* @param value $ value to set the named session variable \*/ function SessionSetVar\($name, $value=''\) \{ if \(\!isset\($name\)\) \{ return false; \} $\_SESSION\['PMLV' . $name\] = $value; return true; \} /\*\* \* Delete a session variable \* \* @param name $ name of the session variable to delete \* @return success or error \*/ function SessionDelVar\($name\) \{ // if empty or not set in both globals, return if \(empty\($name\) || \!\(isset\($\_SESSION\['PMLV' . $name\]\) || \!isset\($GLOBALS\['PMLV' . $name\]\)\)\)\{ return false; \} // Unset the session var unset\($\_SESSION\['PMLV' . $name\]\); // This unsets the variable if register globals are on unset\($GLOBALS\['PMLV' . $name\]\); return true; \} function VarPrepForStore\(\) \{ $resarray = array\(\); foreach \(func\_get\_args\(\) as $ourvar\) \{ // Prepare var if \(\!get\_magic\_quotes\_runtime\(\)\) \{ $ourvar = addslashes\($ourvar\); \} // Add to array array\_push\($resarray, $ourvar\); \} // Return vars if \(func\_num\_args\(\) == 1\) \{ return $resarray\[0\]; \} else \{ return $resarray; \} \} function Redirect\($redirecturl\) \{ if \(preg\_match\('\!^http\!', $redirecturl\)\) \{ // Absolute URL - simple redirect Header\(&quot;Location: $redirecturl&quot;\); return; \} else \{ // Removing leading slashes from redirect url $redirecturl = preg\_replace\('\!^/\*\!', '', $redirecturl\); // Get base URL $baseurl = Polerio::GetBaseURL\(\); Header\(&quot;Location: $baseurl$redirecturl&quot;\); \} \} /\* \* Added sep 24, 2002 for use in selecting color \* returns array bgcolor \*/ function SelectColor\(\) \{ global $pmlconfig; if\($pmlconfig\['PnThOver'\]\!=0\) \{ $bgcolor\[3\] = $pmlconfig\['bgcolor3'\]; $bgcolor\[2\] = $pmlconfig\['bgcolor2'\]; $bgcolor\[1\] = $pmlconfig\['bgcolor1'\]; \} else \{ global $bgcolor1,$bgcolor2,$bgcolor3; $bgcolor\[3\] = $bgcolor3; $bgcolor\[2\] = $bgcolor2; $bgcolor\[1\] = $bgcolor1; \} return $bgcolor; \} /\*\* \* clean user input \* 
      \* Gets a global variable, cleaning it up to try to ensure that \* hack attacks don't work \* @param var name of variable to get \* @param ... \* @returns string/array \* @return prepared variable if only one variable passed \* in, otherwise an array of prepared variables \*/ function VarCleanFromInput\(\) \{ $search = array\('||si', '||si', '||si', '||si', '||si', '||si', '||si', '|STYLE\s\*=\s\*&quot;\[^&quot;\]\*&quot;|si'\); $replace = array\(''\); $resarray = array\(\); foreach \(func\_get\_args\(\) as $var\) \{ // Get var global $$var; if \(empty\($var\)\) \{ return; \} $ourvar = $$var; if \(\!isset\($ourvar\)\) \{ array\_push\($resarray, NULL\); continue; \} if \(empty\($ourvar\)\) \{ array\_push\($resarray, $ourvar\); continue; \} // Add to result array array\_push\($resarray, $ourvar\); \} // Return vars if \(func\_num\_args\(\) == 1\) \{ return $resarray\[0\]; \} else \{ return $resarray; \} \} /\* Added some security scripts do elimiante simultaneous send error which \* cause to much delete, update, or insert \*/ /\*\* \* generate an authorisation key \* 
      \* The authorisation key is used to confirm that actions requested by a \* particular user have followed the correct path. Any stage that an \* action could be made \(e.g. a form or a 'delete' button\) this function \* must be called and the resultant string passed to the client as either \* a GET or POST variable. When the action then takes place it first calls \* pnSecConfirmAuthKey\(\) to ensure that the operation has \* indeed been manually requested by the user and that the key is valid \* \* @public \* @param modname the module this authorisation key is for \(optional\) \* @returns string \* @return an encrypted key for use in authorisation of operations \*/ function SecGenAuthKey\($modname=''\) \{ if \(empty\($modname\)\) \{ $modname = Polerio::VarCleanFromInput\('module'\); \} // Date gives extra security but leave it out for now // $key = pnSessionGetVar\('rand'\) . $modname . date \('YmdGi'\); $key = Polerio::SessionGetVar\('rand'\) . $modname; // Encrypt key $authid = md5\($key\); // Return encrypted key return $authid; \} /\*\* \* confirm an authorisation key is valid \* 
      \* See description of pnSecGenAuthKey for information on \* this function \* @public \* @returns bool \* @return true if the key is valid, false if it is not \*/ function SecConfirmAuthKey\($authid=''\) \{ // Regenerate static part of key $partkey = Polerio::SessionGetVar\('rand'\); // Not using time-sensitive keys for the moment // // Key life is 5 minutes, so search backwards and forwards 5 // // minutes to see if there is a match anywhere // for \($i=-5; $i&lt;=5; $i++\) \{ // $testdate = mktime\(date\('G'\), date\('i'\)+$i, 0, date\('m'\) , date\('d'\), date\('Y'\)\); // // $testauthid = md5\($partkey . date\('YmdGi', $testdate\)\); // if \($testauthid == $authid\) \{ // // Match // // // We've used up the current random // // number, make up a new one // srand\(\(double\)microtime\(\)\*1000000\); // pnSessionSetVar\('rand', rand\(\)\); // // return true; // \} // \} if \(\(md5\($partkey\)\) == $authid\) \{ // Match - generate new random number for next key and leave happy srand\(\(double\)microtime\(\)\*1000000\); Polerio::SessionSetVar\('rand', rand\(\)\); return true; \} // Not found, assume invalid return false; \} /\*\* \* To activate multi-admin capability \* the program should get his/her gid or group id \* The uid resides in the session \*/ function SelectGID\(\) \{ $id = Polerio::SessionGetVar\('uid'\); if\(empty\($id\)\) $id = 0; $table = Polerio::DBGetTables\(\); $users = $table\['users'\]; $users\_col = $table\['users\_column'\]; list\($dbconn\) = Polerio::DBGetConn\(\); $sql=&quot;select $users\_col\[gid\] from $users where $users\_col\[uid\]=$id&quot;; $result = $dbconn-&gt;Execute\($sql\); list\($gid\) = $result-&gt;fields; return $gid; \} // taken from php.net // function \_make\_seed\(\) \{ list\($usec, $sec\) = explode\(' ', microtime\(\)\); return \(float\) $sec + \(\(float\) $usec \* 100000\); \} function makePass\(\) \{ define\('\_SYLLABELS', &quot;abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789&quot;\); define\('\_MAKEPASS\_LEN', 8\); define\('\_MAKEPASS\_BOX', 5000\); // init some $result = ''; mt\_srand\(Polerio::\_make\_seed\(\)\); $syllabels = \_SYLLABELS; $len = strlen\($syllabels\) - 1; $box = &quot;&quot;; // create box for\($i = 0; $i &lt; \_MAKEPASS\_BOX; $i++\) \{ $ch = $syllabels\[mt\_rand\(0, $len\)\]; // about 20% upper case letters if \(mt\_rand\(0, $len\) % 5 == 1\) \{ $ch = strtoupper\($ch\); \} // filling up the box with random chars $box .= $ch; \} // now collect password from box for\($i = 0; $i &lt; \_MAKEPASS\_LEN; $i++\) \{ $result .= $box\[mt\_rand\(0, \(\_MAKEPASS\_BOX - 1\)\)\]; \} return $result; \} // function makePass //================globals.php /\*\* \* @version $Id: globals.php 1145 2005-11-20 22:57:55Z Jinx $ \* @package Joomla \* @copyright Copyright \(C\) 2005 Open Source Matters. All rights reserved. \* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php \* Joomla\! is free software and parts of it may contain or be derived from the \* GNU General Public License or other free or open source software licenses. \* See COPYRIGHT.php for copyright notices and details. \*/ /\*\* \* Use 1 to emulate register\_globals = on \* \* Use 0 to emulate regsiter\_globals = off \*/ /\*\* \* Adds an array to the GLOBALS array and checks that the GLOBALS variable is \* not being attacked \* @param array \* @param boolean True if the array is to be added to the GLOBALS \*/ function checkInputArray\( &amp;$array, $globalise=false \) \{ static $banned = array\( '\_files', '\_env', '\_get', '\_post', '\_cookie', '\_server', '\_session', 'globals' \); foreach \($array as $key =&gt; $value\) \{ if \(in\_array\( strtolower\( $key \), $banned \) \) \{ die\( 'Illegal variable ' . implode\( ' or ', $banned \) . ' passed to script.' \); \} if \($globalise\) \{ $GLOBALS\[$key\] = $value; \} \} \} /\*\* \* Emulates register globals = off \*/ function unregisterGlobals \(\) \{ Polerio::checkInputArray\( $\_FILES \); Polerio::checkInputArray\( $\_ENV \); Polerio::checkInputArray\( $\_GET \); Polerio::checkInputArray\( $\_POST \); Polerio::checkInputArray\( $\_COOKIE \); Polerio::checkInputArray\( $\_SERVER \); if \(isset\( $\_SESSION \)\) \{ Polerio::checkInputArray\( $\_SESSION \); \} $REQUEST = $\_REQUEST; $GET = $\_GET; $POST = $\_POST; $COOKIE = $\_COOKIE; if \(isset \( $\_SESSION \)\) \{ $SESSION = $\_SESSION; \} $FILES = $\_FILES; $ENV = $\_ENV; $SERVER = $\_SERVER; foreach \($GLOBALS as $key =&gt; $value\) \{ if \( $key \!= 'GLOBALS' \) \{ unset \( $GLOBALS \[ $key \] \); \} \} $\_REQUEST = $REQUEST; $\_GET = $GET; $\_POST = $POST; $\_COOKIE = $COOKIE; if \(isset \( $SESSION \)\) \{ $\_SESSION = $SESSION; \} $\_FILES = $FILES; $\_ENV = $ENV; $\_SERVER = $SERVER; \} /\*\* \* Emulates register globals = on \*/ function registerGlobals\(\) \{ Polerio::checkInputArray\( $\_FILES, true \); Polerio::checkInputArray\( $\_ENV, true \); Polerio::checkInputArray\( $\_GET, true \); Polerio::checkInputArray\( $\_POST, true \); Polerio::checkInputArray\( $\_COOKIE, true \); Polerio::checkInputArray\( $\_SERVER, true \); if \(isset\( $\_SESSION \)\) \{ Polerio::checkInputArray\( $\_SESSION, true \); \} foreach \($\_FILES as $key =&gt; $value\)\{ $GLOBALS\[$key\] = $\_FILES\[$key\]\['tmp\_name'\]; foreach \($value as $ext =&gt; $value2\)\{ $key2 = $key . '\_' . $ext; $GLOBALS\[$key2\] = $value2; \} \} \} //================pnAPI.php postnuke 02212006 /\*\* \* Functions \*/ /\*\* \* get a configuration variable \* \* @param name $ the name of the variable \* @return mixed value of the variable, or false on failure \*/ function ConfigGetVar\($name\) \{ if \(\!isset\($name\)\) \{ return null; \} if \(isset\($GLOBALS\['polerioconfig'\]\[$name\]\)\) \{ $result = $GLOBALS\['polerioconfig'\]\[$name\]; \} if \(\!isset\($result\)\) \{ return null; \} return $result; \} /\*\* \* set a configuration variable \* \* @param name $ the name of the variable \* @param value $ the value of the variable \* @return bool true on success, false on failure \*/ function ConfigSetVar\($name, $value=''\) \{ $name = isset\($name\) ? \(string\)$name : ''; // The database parameter are not allowed to change if \(empty\($name\) || \($name == 'dbtype'\) || \($name == 'dbhost'\) || \($name == 'dbuname'\) || \($name == 'dbpass'\) || \($name == 'dbname'\) || \($name == 'system'\) || \($name == 'prefix'\) || \($name == 'encoded'\)\) \{ return false; \} // set the variable $GLOBALS\['polerioconfig'\]\[$name\] = $value; return true; \} /\*\* \* delete a configuration variable \* \* @param name $ the name of the variable \* @return bool true on success, false on failure \*/ function ConfigDelVar\($name\) \{ if \(\!isset\($name\)\) \{ return false; \} // The database parameter are not allowed to be deleted if \(empty\($name\) || \($name == 'dbtype'\) || \($name == 'dbhost'\) || \($name == 'dbuname'\) || \($name == 'dbpass'\) || \($name == 'dbname'\) || \($name == 'system'\) || \($name == 'prefix'\) || \($name == 'encoded'\)\) \{ return false; \} // Update my vars unset\($GLOBALS\['polerioconfig'\]\[$name\]\); // success return true; \} /\*\* \* Gets a server variable \* \* Returns the value of $name from $\_SERVER array. \* Accepted values for $name are exactly the ones described by the \* \{@link http://www.php.net/manual/en/reserved.variables.html\#reserved.variables.server PHP manual\}. \* If the server variable doesn't exist void is returned. \* \* @author Marco Canini , Michel Dalle \* @access public \* @param name string the name of the variable \* @return mixed value of the variable \*/ function ServerGetVar\($name\) \{ // Check the relevant superglobals if \(\!empty\($name\) &amp;&amp; isset\($\_SERVER\[$name\]\)\) \{ return $\_SERVER\[$name\]; \} return null; // we found nothing here \} \} //end class Polerio ?&gt; offset = &quot;&quot;; \} function HeaderOpen\(\) \{ $Header = &quot; Pi 
      &quot;; \} function Login\(\) \{ $login =' 
      User login
       Username:&nbsp;&nbsp; 
      Password:&nbsp;&nbsp; 
      Remember me:&nbsp; 
      &nbsp; 
      
      '; return $login; \} function print\_menu\(\) \{ global $PHP\_SELF; global $SITE\_URL; global $ADMIN\_MODE; global $HOME\_URL; global $HOUR; global $MINUTE; global $conf; $polerio\_base\_url = $conf\['main'\]\['polerio\_base\_url'\]; $phpmylibrary\_url = $polerio\_base\_url.&quot;/phpmylibrary&quot;; $GetModuleURL = Polerio::GetModuleURL\(\); $Med = Polerio::Med\(\); $\_import = $GetModuleURL; $\_import .= $Med; $\_import .= &quot;\_a=1&quot;; $\_webpac = $GetModuleURL; $\_cataloging = $GetModuleURL; $\_cataloging .= $Med; $\_cataloging .= &quot;\_a=2&quot;; if\(Phpmylibrary::IsLoggedIn\(\)\!=1\) \{ $\_login = $GetModuleURL; $\_login .= $Med; $\_login .= &quot;\_a=3&amp;\_aa=2&quot;; $loginmsg = &quot;Log-in&quot;; \} else \{ $\_login = $GetModuleURL; $\_login .= $Med; $\_login .= &quot;\_a=3&amp;\_aa=1&quot;; $loginmsg = &quot;Log-out&quot;; \} $bcolor1 = $conf\['table'\]\['bcolor1'\]; $bcolor2 = $conf\['table'\]\['bcolor2'\]; $bcolor3 = $conf\['table'\]\['bcolor3'\]; $year = date\(&quot;y&quot;\); $mon = date\(&quot;m&quot;\); $day = date\(&quot;D&quot;\); $hour = date\(&quot;h&quot;\); $min = date\(&quot;i&quot;\); $orgdate = date\(&quot;l F dS, Y h:i A&quot;,gmmktime\($hour+8,$min+10,$sec,$mon,$day,$year\)\); $orgdate = date\(&quot;M d y h:i a&quot;,gmmktime\($hour+$HOUR,$min+$MINUTE\)\); print&quot;&nbsp;&nbsp;&nbsp; PhpMyLibrary 1.0.4b 
      WebPAC&quot;; if\(Phpmylibrary::IsLoggedIn\(\)==1\) print&quot;
      Import MARC&quot;; if\(Phpmylibrary::IsLoggedIn\(\)==1\) print&quot;
      Cataloging&quot;; print&quot;
      $loginmsg 
       
      &quot;; return; \} function print\_query\($file=&quot;&quot;\) \{ global $pmlconfig; global $searchableflds; if\($pmlconfig\['PnThOver'\]\!=0\) \{ $pmlbgcolor3 = $pmlconfig\['bgcolor3'\]; $pmlbgcolor2 = $pmlconfig\['bgcolor2'\]; $pmlbgcolor1 = $pmlconfig\['bgcolor1'\]; \} else \{ global $bgcolor1,$bgcolor2,$bgcolor3; $pmlbgcolor3 = $bgcolor3; $pmlbgcolor2 = $bgcolor2; $pmlbgcolor1 = $bgcolor1; \} $getmoduleurl = Polerio::GetModuleURL\(\); $pmlsearchquery = \_PMLSEARCHQUERY; $pmlany = \_PMLANY; $pmlauthor = $searchableflds\[1\]\[0\]; // if you want to translate this, go to polerio/module/config/conf.php $pmltitle = $searchableflds\[2\]\[0\]; $pmlsubject = $searchableflds\[3\]\[0\]; $pmlpublisher = $searchableflds\[4\]\[0\]; $pmlnotes = $searchableflds\[5\]\[0\]; $pmlabstract = ''.@$searchableflds\[6\]\[0\].'&nbsp; '; if \(empty\($searchableflds\[6\]\[0\]\)\) $pmlabstract = ''; $pmlsearch = \_PMLSEARCH; $pmlsearchfor = \_PMLSEARCHFOR; $pmlclearsearch = \_PMLCLEARSEARCH; $pmlmediatype = \_PMLMEDIATYPE; $pmlbooks = \_PMLBOOKS; $pmlserials = \_PMLSERIALS; $pmlmaps = \_PMLMAPS; $pmlmusic = \_PMLMUSIC; $pmlvisualmaterial = \_PMLVISUALMATERIAL; $pmlcomputerfiles = \_PMLCOMPUTERFILES; $pmlmixedmaterial = \_PMLMIXEDMATERIAL; $pmlthesis = \_PMLTHESIS; $pmllogical = \_PMLLOGICAL; $pmland = \_PMLAND; $pmlor = \_PMLOR; $pmlnot = \_PMLNOT; $pmllimit = \_PMLLIMIT; global $library\_type; $data = array\(\); $sel = ''; while \(list\($key1, $value1\) = each \($library\_type\)\) \{ while \(list\($key2, $value2\) = each \($value1\)\) \{ $a = 1; \} $sel = $sel.''.$value1\[2\].''; \} $selectbranch = 'Any'.$sel.'&nbsp; '; $authid = Polerio::SecGenAuthKey\(\); $template = polTemplate::LoadTemplate\(Polerio::GetModuleURI\(\).'templates/search.html'\); $vars = array\(&quot;pol::getmoduleurl&quot;,&quot;pol::pmlsearchquery&quot;,&quot;pol::pmlany&quot;,&quot;pol::pmlauthor&quot;, &quot;pol::pmltitle&quot;,&quot;pol::pmlsubject&quot;,&quot;pol::pmlpublisher&quot;,&quot;pol::pmlnotes&quot;,&quot;pol::pmlabstract&quot;, &quot;pol::pmlsearch&quot;,&quot;pol::pmlsearchfor&quot;,&quot;pol::pmlsearchfor&quot;,&quot;pol::pmlclearsearch&quot;, &quot;pol::pmlbooks&quot;,&quot;pol::pmlserials&quot;,&quot;pol::pmlmaps&quot;,&quot;pol::pmlmusic&quot;, &quot;pol::pmlvisualmaterial&quot;,&quot;pol::pmlcomputerfiles&quot;,&quot;pol::pmlmixedmaterial&quot;,&quot;pol::pmlthesis&quot;, &quot;pol::pmlmediatype&quot;,&quot;pol::pmllogical&quot;,&quot;pol::pmland&quot;,&quot;pol::pmlor&quot;,&quot;pol::pmlnot&quot;,&quot;pol::pmllimit&quot;, &quot;pol::pmlbgcolor1&quot;,&quot;pol::pmlbgcolor2&quot;,&quot;pol::pmlbgcolor3&quot;,&quot;pol::authid&quot; \); $vals = array\(&quot;$getmoduleurl&quot;,&quot;$pmlsearchquery&quot;,&quot;$pmlany&quot;,&quot;$pmlauthor&quot;, &quot;$pmltitle&quot;,&quot;$pmlsubject&quot;,&quot;$pmlpublisher&quot;,&quot;$pmlnotes&quot;,&quot;$pmlabstract&quot;, &quot;$pmlsearch&quot;,&quot;$pmlsearchfor&quot;,&quot;$pmlsearchfor&quot;,&quot;$pmlclearsearch&quot;, &quot;$pmlbooks&quot;,&quot;$pmlserials&quot;,&quot;$pmlmaps&quot;,&quot;$pmlmusic&quot;, &quot;$pmlvisualmaterial&quot;,&quot;$pmlcomputerfiles &quot;,&quot;$pmlmixedmaterial&quot;,&quot;$pmlthesis&quot;, &quot;$pmlmediatype&quot;,&quot;$pmllogical&quot;,&quot;$pmland&quot;,&quot;$pmlor&quot;,&quot;$pmlnot&quot;,&quot;$pmllimit&quot;, &quot;$pmlbgcolor1&quot;,&quot;$pmlbgcolor2&quot;,&quot;$pmlbgcolor3&quot;,&quot;$authid&quot; \); $template = polTemplate::ReplaceStatic\($template, $vars, $vals\); return $template; \} function sql\_generator \($keywords=&quot;&quot;,$Media=&quot;&quot;,$Heading=&quot;&quot;,$Operator=&quot;&quot;,$offset=&quot;&quot;,$limit=&quot;&quot;,$mode=&quot;&quot;\) \{ global $conf; global $pmlconfig; global $encodingtype; list\($dbconn\) = Polerio::DBGetConn\(\); $table = Polerio::DBGetTables\(\); if\($Operator==&quot;NOT&quot;\) $NOT = &quot;NOT&quot;; else $NOT=''; //print&quot;sql\_gen key $keywords, med $Media, hea $Heading, ope $Operator, off $offset, lim $limit&quot;; // Heading evaluation to produce tbl to search start if\($Heading==0\) \{ $tablea= $table\['tblanyindex'\]; $tableb = $table\['tblanybibrelation'\]; $tablea\_col= &amp;$table\['tblanyindex\_column'\]; $tableb\_col = &amp;$table\['tblanybibrelation\_column'\]; \} elseif\($Heading==1\) \{ $tablea= $table\['tblauthorindex'\]; $tableb = $table\['tblauthorbibrelation'\]; $tablea\_col= &amp;$table\['tblauthorindex\_column'\]; $tableb\_col = &amp;$table\['tblauthorbibrelation\_column'\]; \} elseif\($Heading==2\) \{ $tablea= $table\['tbltitleindex'\]; $tableb = $table\['tbltitlebibrelation'\]; $tablea\_col= &amp;$table\['tbltitleindex\_column'\]; $tableb\_col = &amp;$table\['tbltitlebibrelation\_column'\]; \} elseif\($Heading==3\) \{ $tablea= $table\['tblsubjectindex'\]; $tableb = $table\['tblsubjectbibrelation'\]; $tablea\_col= &amp;$table\['tblsubjectindex\_column'\]; $tableb\_col = &amp;$table\['tblsubjectbibrelation\_column'\]; \} elseif\($Heading==4\) \{ $tablea= $table\['tblpublisherindex'\]; $tableb = $table\['tblpublisherbibrelation'\]; $tablea\_col= &amp;$table\['tblpublisherindex\_column'\]; $tableb\_col = &amp;$table\['tblpublisherbibrelation\_column'\]; \} elseif\($Heading==5\) \{ $tablea= $table\['tblnotesindex'\]; $tableb = $table\['tblnotesbibrelation'\]; $tablea\_col= &amp;$table\['tblnotesindex\_column'\]; $tableb\_col = &amp;$table\['tblnotesbibrelation\_column'\]; \} elseif\($Heading==6\) \{ $tablea= $table\['tblabstractindex'\]; $tableb = $table\['tblabstractbibrelation'\]; $tablea\_col= &amp;$table\['tblabstractindex\_column'\]; $tableb\_col = &amp;$table\['tblabstractbibrelation\_column'\]; \} $tablec = $table\['tblbib'\]; $tablec\_col = $table\['tblbib\_column'\]; // Heading evaluation to produce tbl to search end // Media evaluation to produce what category i.e book to search start if\($Media==0\) \{ $catid=&quot;0&quot;; \} elseif\($Media==1\) \{ $catid=&quot;1&quot;; \} elseif\($Media==2\) \{ $catid=&quot;2&quot;; \} elseif\($Media==3\) \{ $catid=&quot;3&quot;; \} elseif\($Media==4\) \{ $catid=&quot;4&quot;; \} elseif\($Media==5\) \{ $catid=&quot;5&quot;; \} elseif\($Media==6\) \{ $catid=&quot;6&quot;; \} elseif\($Media==7\) \{ $catid=&quot;7&quot;; \} elseif\($Media==8\) \{ $catid=&quot;8&quot;; \} elseif\($Media==9\) \{ $catid=&quot;9&quot;; \} // Media evaluation to produce what category i.e book to search stop $limits = &quot;LIMIT $offset,$limit&quot;; $tblbib = $conf\['table'\]\['marc'\]; $catid = &quot;= $Media&quot;; //print&quot;current mode is $mode&quot;; if\($Media &gt; 0\) $webpac\_total\_cat\_id = &quot;AND catid = $Media&quot;; if\($mode==&quot;catalog\_stats&quot;\) \{ $sql = &quot;SELECT \* FROM $tblbib WHERE \(approved = 1\) AND catid $catid &quot;; \} elseif\($mode==&quot;webpac\_total&quot;\) \{ $sql = &quot;SELECT id FROM $table WHERE \(approved = 1\) $webpac\_total\_cat\_id ORDER BY id &quot;; \} elseif\($mode==&quot;catalog\_browse&quot;\) \{ $sql = &quot;SELECT id, marc, catid, approved FROM $tblbib WHERE \(approved = 1\) AND catid $catid ORDER BY id $limits&quot;; \} elseif\($mode==&quot;catalog\_total&quot;\) \{ $sql = &quot;SELECT id FROM $table WHERE \(approved = 1\) AND catid $catid&quot;; \} elseif\($mode==&quot;catalog\_search&quot;\) \{ //print&quot;this is $offset &quot;; if\(empty\($offset\)\) \{ $limits = &quot;LIMIT 0,$limit&quot;; \} else \{ $limits = &quot;LIMIT $offset,$limit&quot;; \} if\(empty\($limit\)\) \{ $limits=&quot;&quot;; \} $DEBUG = &quot;\n&quot;; // set DEBUG == &quot;\n&quot; to see this query $keywordsforabstracts = $keywords; $keywords = trim\(urldecode\($keywords\)\); $keywords = ereg\_replace\(&quot;\(\[ \]+\)&quot;,&quot; &quot;,$keywords\); if\(\!ereg\(&quot; &quot;,$keywords\)\) \{ // Only 1 keyword $KeyWords\[0\] = &quot;$keywords&quot;; \} else \{ $KeyWords = explode\(&quot; &quot;,$keywords\); \} if\($Media==0\) \{ $Med = &quot;\($tablec\_col\[approved\] = 1\) &quot;; if\(Phpmylibrary::IsLoggedIn\(\)\) $Med = &quot;\($tablec\_col\[approved\] = '0' OR $tablec\_col\[approved\] = '1'\) &quot;; \} else \{ $Med = &quot;\($tablec\_col\[approved\] = 1\) AND \($tablec\_col\[catid\] = $Media\)&quot;; if\(Phpmylibrary::IsLoggedIn\(\)\) $Med = &quot;\($tablec\_col\[approved\] = 1 OR $tablec\_col\[approved\] = 0\) AND \($tablec\_col\[catid\] = $Media\)&quot;; \} $sql = &quot;SELECT DISTINCT $tablec\_col\[id\], $tablec\_col\[marc\], $tablec\_col\[catid\], $tablec\_col\[accessid\], $tablec\_col\[approved\] FROM $tablea, $tableb, $tablec WHERE $DEBUG \( &quot;; $count = count\($KeyWords\); if\( $count == 1 &amp;&amp; $Heading\!=5\) \{ $single = $KeyWords\[0\]; // discard if keyword length is &lt; 4 if\(strlen\($single\) &lt; $pmlconfig\['keyword\_length'\]\) \{ return false; \} $sql .= &quot; \( $tablea\_col\[any\] $NOT LIKE '%$single%'\) AND \($tableb\_col\[anyid\]=$tablea\_col\[id\]\) AND \($tablec\_col\[id\]=$tableb\_col\[bibid\]\) AND $Med \) ORDER by $tablec\_col\[id\] $limits $DEBUG &quot;; \} elseif\( $Heading== 6 \) // meaning this is abstract \{ $single = $keywordsforabstracts; // discard if keyword length is &lt; 4 if\(strlen\($single\) &lt; $pmlconfig\['keyword\_length'\]\) \{ return false; \} $sql .= &quot; \( MATCH $tablea\_col\[any\] AGAINST \('$single'\)\) AND \($tableb\_col\[anyid\]=$tablea\_col\[id\]\) AND \($tablec\_col\[id\]=$tableb\_col\[bibid\]\) AND $Med \) ORDER by $tablec\_col\[id\] $limits $DEBUG &quot;; \} else \{ $ticker = 0; while \( list \($key,$word\) = each \($KeyWords\) \) \{ if\($Operator==&quot;NOT&quot;\) \{ $Operator = &quot;AND NOT&quot;; \} $ticker++; if\(\!empty\($word\)\) \{ if\($ticker \!= $count\) \{ if\(strlen\($word\) &lt; $pmlconfig\[keyword\_length\]\) \{ return false; \} $sql .= &quot;\($tablea\_col\[any\] LIKE '%$word%' \) AND \($tableb\_col\[anyid\]=$tablea\_col\[id\]\) AND \($tablec\_col\[id\]=$tableb\_col\[bibid\]\) $Operator $DEBUG &quot;; \} else \{ // Last condition, omit the trailing OR $sql .= &quot; \($tablea\_col\[any\] LIKE '%$word%'\) AND \($tableb\_col\[anyid\]=$tablea\_col\[id\]\) AND \($tablec\_col\[id\]=$tableb\_col\[bibid\]\) $DEBUG &quot;; \} \} \} $sql .= &quot; \) AND $Med ORDER BY $tablec\_col\[id\] $limits $DEBUG&quot;; \} /\*if\(\!empty\($DEBUG\)\) \{ echo &quot;
      $sql\nTicker \[$ticker\]\nCount \[$count\]
      \n&quot;; \}\*/ \} //$results = $this-&gt;select\($sql\); //print&quot;$sql&quot;; return $sql; \} function Marc\($selected\_tbl=&quot;&quot;\) \{ $table = Polerio::DBGetTables\(\); list\($dbconn\) = Polerio::DBGetConn\(\); $tblbib = $table\['tblbib'\]; $tblbib\_col = $table\['tblbib\_column'\]; $i=0; $zipmarc = &quot;&quot;; while\($i &lt;= \(count\($selected\_tbl\)-1\)\) \{ $query = &quot;SELECT \* FROM $tblbib WHERE $tblbib\_col\[id\]=$selected\_tbl\[$i\]&quot;; $recordSet = $dbconn-&gt;Execute\($query\); $row = $recordSet-&gt;fields; $zipmarc .= $row\[1\].chr\(29\); $i++; \} return $zipmarc; \} function View\($selected\_tbl=&quot;&quot;\) \{ $table = Polerio::DBGetTables\(\); list\($dbconn\) = Polerio::DBGetConn\(\); $tblbib = $table\['tblbib'\]; $tblbib\_col = $table\['tblbib\_column'\]; include\_once Polerio::GetModuleURI\(\).'/lib/marcdefs.php'; $total = count\($selected\_tbl\); $j=0; $viewmarc = &quot;&quot;; $row = array\(\); while\($j &lt;= \(count\($selected\_tbl\)-1\)\) \{ $query = &quot;SELECT \* FROM $tblbib WHERE $tblbib\_col\[id\]=$selected\_tbl\[$j\]&quot;; $recordSet = $dbconn-&gt;Execute\($query\); list\($id, $content, $catid, $approved \) = $recordSet-&gt;fields; $marc\_field\_explode = explode\(chr\(30\),$content\); $marc\_field\_explode\_count = count\($marc\_field\_explode\); $i = 1; $tags\_i = 1; $marc\_fields\_count = \(\(strlen\($marc\_field\_explode\[0\]\)-24\)/12\); $rj = 0; $\_j = 0; while \( $i &lt;= $marc\_fields\_count\) \{ $tags = substr\($marc\_field\_explode\[0\],23,strlen\($marc\_field\_explode\[0\]\)\); $tags = substr\($tags,$tags\_i,3\); $tag\_value = $marc\_field\_explode\[$i\]; $tag\_value = ereg\_replace\(31,&quot;$&quot;,$tag\_value\); $tags\_i = $tags\_i + 12; $ktag\[$rj\] = $tags; $tag\_names\[$i\] = @$tag\_name\[$ktag\[$rj\]\]; $tag\_content\[$i\] = Phpmylibrary::convertit\($tag\_value\); $tag\_name\_marc\[$i\] = $tags; $tag\_content\_marc\[$i\] = $tag\_value; $i++; \} $\_j = $\_j+1; $viewmarc .= &quot;&quot;.\_PMLRECORDNO.&quot;. $\_j &quot;.\_PMLOF.&quot; $total
      &quot;; $viewmarc .= ''; $total\_fields = count\($tag\_names\); $i=1; while\($i &lt;= $total\_fields\) \{ $bcolor = &quot;ffffff&quot;; if\($tag\_names\[$i\]\) $viewmarc .= &quot; $tag\_names\[$i\]&nbsp;&nbsp;&nbsp;&nbsp; $tag\_content\[$i\] 
      &quot;; $i++; \} $viewmarc .= &quot; 
      
      &quot;; $j++; \} return $viewmarc; \} function convertit2\($text=&quot;&quot;\) \{ $x = $text; $ptext = substr\($text,2,strlen\($text\)-2\); $etext = explode\('^',$ptext\); $ctext = count\($etext\); $i = 0; $text2 = &quot; &quot;; while \($i &lt; $ctext\) \{ $text2 = $text2.' '.substr\($etext\[$i\],1,strlen\($etext\[$i\]\)-1\); $i++; \} return substr\($text2, 3, strlen\($text2\)\); \} function ViewPrintPreview\($selected\_tbl=&quot;&quot;\) \{ $table = Polerio::DBGetTables\(\); list\($dbconn\) = Polerio::DBGetConn\(\); $tblbib = $table\['tblbib'\]; $tblbib\_col = $table\['tblbib\_column'\]; include\_once Polerio::GetModuleURI\(\).'/lib/marcdefs.php'; $total = count\($selected\_tbl\); $j=0; $viewmarc = &quot;&quot;; $row = array\(\); $data = array\(\); while\($j &lt;= \(count\($selected\_tbl\)-1\)\) \{ $query = &quot;SELECT \* FROM $tblbib WHERE $tblbib\_col\[id\]=$selected\_tbl\[$j\]&quot;; $recordSet = $dbconn-&gt;Execute\($query\); list\($id, $content, $catid, $approved \) = $recordSet-&gt;fields; $marc\_field\_explode = explode\(chr\(30\),$content\); $marc\_field\_explode\_count = count\($marc\_field\_explode\); $i = 1; $tags\_i = 1; $marc\_fields\_count = \(\(strlen\($marc\_field\_explode\[0\]\)-24\)/12\); $rj = 0; $\_j = 0; $accno = ''; while \( $i &lt;= $marc\_fields\_count\) \{ $tags = substr\($marc\_field\_explode\[0\],23,strlen\($marc\_field\_explode\[0\]\)\); $tags = substr\($tags,$tags\_i,3\); $mytags = $tags; $tag\_value = $marc\_field\_explode\[$i\]; $tag\_value = ereg\_replace\(31,&quot;$&quot;,$tag\_value\); $tags\_i = $tags\_i + 12; $ktag\[$rj\] = $tags; $tag\_names\[$i\] = @$tag\_name\[$ktag\[$rj\]\]; $tag\_content\[$i\] = Phpmylibrary::convertit\($tag\_value\); $tag\_name\_marc\[$i\] = $tags; $tag\_content\_marc\[$i\] = $tag\_value; $tagtag\[$mytags\] = $tag\_value; $i++; $author = Phpmylibrary::convertit2\($tagtag\['100'\]\); $title = Phpmylibrary::convertit2\($tagtag\['245'\]\); if \($tags=='949'\) $accno = $accno.' '.Phpmylibrary::convertit2\($tagtag\['949'\]\); $calln = Phpmylibrary::convertit2\($tagtag\['082'\]\); $subject = Phpmylibrary::convertit2\($tagtag\['650'\]\); //$subject1 = $subject1.&quot;\n&quot;.$subject; \} $authtitle = &quot;$author $title&quot;; $newar = array\('no'=&gt;$j+1,'accno'=&gt;$accno,'calln'=&gt;$calln,'author'=&gt;$author,'authtitle'=&gt;$authtitle,'subject'=&gt;$subject\); array\_push\($data, $newar\); $\_j = $\_j+1; $j++; \} return $data; \} function ViewCatalogPreview\($selected\_tbl=&quot;&quot;\) \{ $table = Polerio::DBGetTables\(\); list\($dbconn\) = Polerio::DBGetConn\(\); $tblbib = $table\['tblbib'\]; $tblbib\_col = $table\['tblbib\_column'\]; include\_once Polerio::GetModuleURI\(\).'/lib/marcdefs.php'; $total = count\($selected\_tbl\); $j=0; $viewmarc = &quot;&quot;; $row = array\(\); while\($j &lt;= \(count\($selected\_tbl\)-1\)\) \{ $query = &quot;SELECT \* FROM $tblbib WHERE $tblbib\_col\[id\]=$selected\_tbl\[$j\]&quot;; $recordSet = $dbconn-&gt;Execute\($query\); list\($id, $content, $catid, $approved \) = $recordSet-&gt;fields; $marc\_field\_explode = explode\(chr\(30\),$content\); $marc\_field\_explode\_count = count\($marc\_field\_explode\); $i = 1; $tags\_i = 1; $marc\_fields\_count = \(\(strlen\($marc\_field\_explode\[0\]\)-24\)/12\); $rj = 0; $\_j = 0; while \( $i &lt;= $marc\_fields\_count\) \{ $tags = substr\($marc\_field\_explode\[0\],23,strlen\($marc\_field\_explode\[0\]\)\); $tags = substr\($tags,$tags\_i,3\); $tag\_value = $marc\_field\_explode\[$i\]; $tag\_value = ereg\_replace\(31,&quot;$&quot;,$tag\_value\); $tags\_i = $tags\_i + 12; $ktag\[$rj\] = $tags; $tag\_names\[$i\] = @$tag\_name\[$ktag\[$rj\]\]; $tag\_content\[$i\] = Phpmylibrary::convertit\($tag\_value\); $tag\_name\_marc\[$i\] = $tags; $tag\_content\_marc\[$i\] = $tag\_value; $i++; \} $\_j = $\_j+1; $viewmarc .= &quot;&quot;.\_PMLRECORDNO.&quot;. $\_j &quot;.\_PMLOF.&quot; $total
      &quot;; $viewmarc .= ''; $total\_fields = count\($tag\_names\); $i=1; while\($i &lt;= $total\_fields\) \{ $bcolor = &quot;ffffff&quot;; if\($tag\_names\[$i\]\) $viewmarc .= &quot; $tag\_names\[$i\]&nbsp;&nbsp;&nbsp;&nbsp; $tag\_content\[$i\] 
      &quot;; $i++; \} $viewmarc .= &quot; 
      
      &quot;; $j++; \} return $viewmarc; \} function Viewnohtml\($selected\_tbl=&quot;&quot;\) \{ $table = Polerio::DBGetTables\(\); $tblbib = $table\['tblbib'\]; $tblbib\_col = $table\['tblbib\_column'\]; include\_once Polerio::GetModuleURI\(\).'/lib/marcdefs.php'; list\($dbconn\) = Polerio::DBGetConn\(\); $total = count\($selected\_tbl\); $j=0; $viewmarc .= &quot;\r\n&quot;; $viewmarc .= &quot;Polerio::PhpMyLibrary http://phpmylibrary.sourceforge.net\r\n&quot;; $viewmarc .= &quot;Copyleft 2002 PhpMyLibrary GNU/GPL License\r\n&quot;; $viewmarc .= &quot;\r\n&quot;; $viewmarc .= &quot;--------------------------------------&quot;; $viewmarc .= &quot;--------------------------------------&quot;; $viewmarc .= &quot;\r\n&quot;; $viewmarc .= &quot;\r\n&quot;; while\($j &lt;= \(count\($selected\_tbl\)-1\)\) \{ $query = &quot;SELECT \* FROM $tblbib WHERE $tblbib\_col\[id\]=$selected\_tbl\[$j\]&quot;; $recordSet = $dbconn-&gt;Execute\($query\); $row = $recordSet-&gt;fields; $id = $row\[0\]; $content = $row\[1\]; $catid = $row\[2\]; $approved = $row\[3\]; $marc\_field\_explode = explode\(chr\(30\),$content\); $marc\_field\_explode\_count = count\($marc\_field\_explode\); $i = 1; $tags\_i = 1; $marc\_fields\_count = \(\(strlen\($marc\_field\_explode\[0\]\)-24\)/12\); $rj = 0; while \( $i &lt;= $marc\_fields\_count\) \{ $bib = $bibid; $tags = substr\($marc\_field\_explode\[0\],23,strlen\($marc\_field\_explode\[0\]\)\); $tags = substr\($tags,$tags\_i,3\); $tag\_value = $marc\_field\_explode\[$i\]; $tag\_value = ereg\_replace\(31,&quot;$&quot;,$tag\_value\); $tags\_i = $tags\_i + 12; $ktag\[$rj\] = $tags; $tag\_names\[$i\] = $tag\_name\[$ktag\[$rj\]\]; //$tag\_name\[$i\] = Phpmylibrary::get\_tag\_name\($tags\); $tag\_content\[$i\] = Phpmylibrary::convertit\($tag\_value\); $tag\_name\_marc\[$i\] = $tags; $tag\_content\_marc\[$i\] = $tag\_value; $i++; \} $\_j = $\_j+1; $viewmarc .= &quot;\r\n&quot;; $viewmarc .= &quot;&quot;.\_PMLRECORDNO.&quot;. $id &quot;.\_PMLRESULT.&quot; $\_j &quot;.\_PMLOF.&quot; $total\r\n\r\n&quot;; $total\_fields = count\($tag\_names\); $i=1; while\($i &lt;= $total\_fields\) \{ $bcolor = Polerio::useColora\(\); if\($tag\_names\[$i\]\) $viewmarc .= &quot;$tag\_names\[$i\]: $tag\_content\[$i\]\r\n\r\n&quot;; $i++; \} $viewmarc .= &quot;\r\n&quot;; $viewmarc .= &quot;--------------------------------------&quot;; $viewmarc .= &quot;--------------------------------------&quot;; $viewmarc .= &quot;\r\n&quot;; $j++; \} $viewmarc .= &quot;\r\n&quot;; $viewmarc .= &quot;Polerio::PhpMyLibrary http://phpmylibrary.sourceforge.net\r\n&quot;; $viewmarc .= &quot;Copyleft 2002 PhpMyLibrary GNU/GPL License\r\n&quot;; $viewmarc .= &quot;\r\n&quot;; return $viewmarc; \} // function to convert $a's with space start function convertit\($text=&quot;&quot;\) \{ $x = $text; $ptext = substr\($text,2,strlen\($text\)-2\); $etext = explode\(&quot;^&quot;,$ptext\); $ctext = count\($etext\); $i = 0; $text2 = &quot; &quot;; while \($i &lt; $ctext\) \{ $text2 = $text2.' '.substr\($etext\[$i\],1,strlen\($etext\[$i\]\)-1\); $i++; \} return $text2; \} function IsLoggedIn\($msg=&quot;&quot;\) \{ global $pmlconfig; if\(Polerio::SessionGetVar\('uid'\) &gt;= 2 \) \{ if\(empty\($msg\)\) \{ return Polerio::SessionGetVar\('uid'\); \} else \{ $stress = &quot;$msg Error: &quot;.\_PMLYOUMUSTLOGINFIRST.&quot;\!.&quot;; $res = &quot;
      
      $stress
      
      &quot;; return $res; \} \} else \{ $stress = &quot;$msg Error: &quot;.\_PMLYOUMUSTLOGINFIRST.&quot;\!.&quot;; $res = &quot;
      
      $stress
      
      &quot;; return $res; \} \} function ToSearchAll\(\) \{ global $pmlconfig; $tosearchall = ''; if\($pmlconfig\['note\_lkeywords'\] == 1\) \{ $c=$pmlconfig\['keyword\_length'\]; $i=1; $h=&quot;&quot;; while\($i &lt;= $c\) \{ $h = $h.&quot;%&quot;; $i++; \} if\(empty\($h\)\) $h='%%%'; $tosearchall = &quot;
      &quot;.\_PMLTYPE.&quot; $h &quot;.\_PMLTOBROWSEALLRECORDS.&quot;\!
      &quot;; \} return $tosearchall; \} function Message\($msg=&quot;&quot;\) \{ $msg = &quot;
      
      $msg
      
      
      &quot;; return $msg; \} function bgcolor1\(\) \{ if\(Phpmylibrary::PnThOver\(\)\) \{ global $bgcolor1; \} else \{ global $pmlconfig; $bgcolor1 = $pmlconfig\['bgcolor1'\]; \} return $bgcolor1; \} function bgcolor2\(\) \{ if\(Phpmylibrary::PnThOver\(\)\) \{ global $bgcolor2; \} else \{ global $pmlconfig; $bgcolor2 = $pmlconfig\['bgcolor2'\]; \} return $bgcolor2; \} function bgcolor3\(\) \{ if\(Phpmylibrary::PnThOver\(\)\) \{ global $bgcolor3; \} else \{ global $pmlconfig; $bgcolor3 = $pmlconfig\['bgcolor3'\]; \} return $bgcolor3; \} function MouseOver\(\) \{ global $pmlconfig; $MouseOver = $pmlconfig\['mouseover'\]; return $MouseOver; \} /\*\* \* to generate static color \* @returns static color \*/ function useColora\(\) \{ global $pmlconfig; if\($pmlconfig\['PnThOver'\]\!=0\) \{ $bcolor2 = $pmlconfig\['bgcolor1'\]; $bcolor1 = $pmlconfig\['bgcolor3'\]; \} else \{ global $bgcolor1,$bgcolor2,$bgcolor3; $bcolor2 = $bgcolor1; $bcolor1 = $bgcolor3; \} static $ColorValue; if\($ColorValue==$bcolor2\) $ColorValue=$bcolor1; else $ColorValue=$bcolor2; return\($ColorValue\); \} function PnThOver\(\) \{ global $pmlconfig; if\($pmlconfig\['PnThOver'\]==0\) return true; \} function BackToDecoder\($bakto=&quot;&quot;\) \{ $temp = explode\(&quot;~&quot;,$bakto\); for\($i=0;$i $value\) \{ if\($i==$c-1\) $tl = ''; $tm = $tm.$key.'^'.$value.$tl; $i++; \} //echo $bakto; return $tm; \} function BackToEncoder\($bakto=&quot;&quot;\) \{ $bakto = ereg\_replace\(&quot;=&quot;,&quot;^&quot;,$bakto\); $bakto = ereg\_replace\(&quot;&amp;&quot;,&quot;~&quot;,$bakto\); return $bakto; \} \} ?&gt; &quot;; \} fclose\($myFile\); \} else include\($fname\); \} else echo &quot;Error\!\!\!
      
      Failed to open $fcontent.
      
      &quot;; \} elseif\($\_a==&quot;settings&quot;\) \{ if\(\(Polerio::SelectGID\(\)==2\) || \(Polerio::SelectGID\(\)==4\) || \(Polerio::SessionGetVar\('uid'\)==2\)\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/settings.php&quot;; if\($test\) \{ Settings::ShowSettingsArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Refresh Global&quot;\) \{ Settings::ShowSettingsChangeGlobalArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Update Global&quot;\) \{ Settings::ProcessChangeGlobal\(Polerio::InputFilter\($\_POST\)\); Settings::ShowSettingsChangeGlobalArea\(\); \} elseif\($changeglobals\) \{ Settings::ShowSettingsChangeGlobalArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Refresh Blocks&quot;\) \{ Settings::ShowSettingsChangeBlocksArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Update Blocks&quot;\) \{ $tags = array\(&quot;em&quot;, &quot;br&quot;, &quot;a&quot;, &quot;href&quot;,&quot;strong&quot;,&quot;p&quot;\); $attributes = array\(&quot;title&quot;, &quot;selected&quot;, &quot;a&quot;, &quot;href&quot;,&quot;strong&quot;,&quot;p&quot;\); Settings::ProcessChangeBlocks\(Polerio::CustomInputFilter\($\_POST, $tags, $attributes\)\); Settings::ShowSettingsChangeBlocksArea\(\); \} elseif\($changeblocks\) \{ Settings::ShowSettingsChangeBlocksArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Refresh Mailer&quot;\) \{ Settings::ShowSettingsChangeMailerArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Update Mailer&quot;\) \{ Settings::ProcessChangeMailer\(Polerio::InputFilter\($\_POST\)\); Settings::ShowSettingsChangeMailerArea\(\); \} elseif\($changemailer\) \{ Settings::ShowSettingsChangeMailerArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Refresh Library&quot;\) \{ Settings::ShowSettingsChangeLibraryArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Update Library&quot;\) \{ Settings::ProcessChangeLibrary\(Polerio::InputFilter\($\_POST\)\); Settings::ShowSettingsChangeLibraryArea\(\); \} elseif\($changelibrary\) \{ Settings::ShowSettingsChangeLibraryArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Refresh Theme&quot;\) \{ Settings::ShowSettingsChangeThemeArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Update Theme&quot;\) \{ Settings::ProcessChangeTheme\(Polerio::InputFilter\($\_POST\)\); Settings::ShowSettingsChangeThemeArea\(\); \} elseif\($changetheme\) \{ Settings::ShowSettingsChangeThemeArea\(\); \} else \{ Settings::ShowSettingsArea\(\); \} \} else echo Phpmylibrary::IsLoggedIn\(&quot;Protected Area&quot;\); \} elseif\($\_a==&quot;inquiry&quot;\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/inquiry.php&quot;; if\($\_POST\['flag'\]==&quot;Send Inquiry&quot;\) \{ Inquiry::ProcessInquiry\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\)\); \} else \{ Inquiry::ShowFieldArea\(\); \} \} elseif\($\_a==&quot;circulation2&quot;\) \{ if\(\(Polerio::SelectGID\(\)==2\) || \(Polerio::SelectGID\(\)==4\) || \(Polerio::SessionGetVar\('uid'\)==2\)\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/circulation2.php&quot;; $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); if\($checkout\) \{ Circulation::ShowCirculationCheckoutArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Set Temp Due Date&quot;\) \{ Circulation::ProcessSetTempDueDate\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Hold&quot;\) \{ Circulation::ProcessHold2\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Patron Submit - Hold&quot;\) \{ Circulation::ProcessHold1\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Clear Hold&quot;\) \{ Circulation::ProcessClearHold\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Renew&quot;\) \{ Circulation::ProcessRenew\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Check In&quot;\) \{ Circulation::ProcessCheckIn\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($checkin\) \{ Circulation::ShowCirculationCheckinArea\(\); \} elseif\($\_POST\['flag'\]==&quot;Check Out&quot;\) \{ Circulation::ProcessCheckOut\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Patron Submit&quot;\) \{ Circulation::ShowPatronInfoAndTransactionInfo\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($renew\) \{ Circulation::ShowCirculationRenewArea\(\); \} elseif\($hold\) \{ Circulation::ShowCirculationHoldArea\(\); \} elseif\($clearhold\) \{ Circulation::ShowCirculationClearHoldArea\(\); \} elseif\($cleartempduedate\) \{ Circulation::ProcessClearTempDueDate\(\); \} elseif\($settempduedate\) \{ Circulation::ShowCirculationSetTempDueDateArea\(\); \} else \{ Circulation::ShowCirculationCheckoutArea\(\); \} \} else echo Phpmylibrary::IsLoggedIn\(&quot;Protected Area&quot;\); \} elseif\($\_a==&quot;permissions&quot;\) \{ if\(\(Polerio::SelectGID\(\)==2\) || \(Polerio::SelectGID\(\)==4\) || \(Polerio::SessionGetVar\('uid'\)==2\)\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/permissions.php&quot;; $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); if\($\_POST\['flag'\]==&quot;Search&quot;\) \{ Permissions::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Update&quot;\) \{ Permissions::ProcessUpdate\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['pos'\] = $baktovars\['pos'\]; Permissions::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($delete\) \{ Permissions::ProcessDelete\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['pos'\] = $baktovars\['pos'\]; Permissions::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($pos\) \{ $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; Permissions::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($nav\) \{ $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; Permissions::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Add User&quot;\) \{ Permissions::ProcessAddUser\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $\_POST\['searchindex'\] = 1; $\_POST\['searchterm'\] = '%'; Permissions::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Search&quot;\) \{ echo &quot;Search Administrators&quot;; Permissions::ShowPermissionsManagementArea\(\); \} elseif\($showall\) \{ $\_POST\['searchindex'\] = 1; $\_POST\['searchterm'\] = '%'; Permissions::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($newrecord\) \{ Permissions::ShowAddNewPermissionRecordArea\(\); \} elseif\($importlnk\) \{ echo &quot;importlnk&quot;; Permissions::ShowPermissionsManagementArea\(\); \} elseif\($exportlnk\) \{ echo &quot;exportlnk&quot;; Permissions::ShowPermissionsManagementArea\(\); \} elseif\($reinitializerec\) \{ echo &quot;reinitializerec&quot;; Permissions::ShowPermissionsManagementArea\(\); \} else \{ Permissions::ShowPermissionsManagementArea\(\); \} \} else echo Phpmylibrary::IsLoggedIn\(&quot;Protected Area&quot;\); \} elseif\($\_a==&quot;serials&quot;\) \{ if\(\(Polerio::SelectGID\(\)==2\) || \(Polerio::SelectGID\(\)==4\) || \(Polerio::SessionGetVar\('uid'\)==2\)\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/serials.php&quot;; $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); if\($\_POST\['flag'\]==&quot;Search&quot;\) \{ Serials::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Add Serial Copy&quot;\) \{ Serials::ProcessAddCopyHoldings\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($addbookidtoserial\) \{ Serials::ShowAddCopySerialHoldings\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($serialscatalognav\) \{ Serials::ProcessSerialsCatalogNav\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($serdelete\) \{ Serials::ProcessDelete\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['serialspos'\] = $baktovars\['serialspos'\]; Serials::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($serialspos\) \{ //$baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); //print\_r\($\_POST\); //print\_r\($\_GET\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; Serials::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($serialsnav\) \{ //$baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); //print\_r\($\_POST\); //print\_r\($\_GET\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; Serials::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Save&quot;\) \{ Serials::ProcessSave\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $\_POST\['searchindex'\] = 1; $\_POST\['searchterm'\] = '%'; Serials::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Update&quot;\) \{ Serials::ProcessUpdate\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['serialspos'\] = $baktovars\['serialspos'\]; Serials::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Received&quot;\) \{ Serials::ProcessReceived\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($newrecord\) \{ Serials::ShowAddNewSerialRecordArea\(\); \} elseif\($importlnk\) \{ echo &quot;importlnk&quot;; Serials::ShowSerialsManagementArea\(\); \} elseif\($exportlnk\) \{ echo &quot;exportln&quot;; Serials::ShowSerialsManagementArea\(\); \} elseif\($showall\) \{ $\_POST\['searchindex'\] = 1; $\_POST\['searchterm'\] = '%'; Serials::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($reinitializerec\) \{ echo &quot;reinitializerec&quot;; Serials::ShowSerialsManagementArea\(\); \} else \{ Serials::ShowSerialsManagementArea\(\); \} \} else echo Phpmylibrary::IsLoggedIn\(&quot;Protected Area&quot;\); \} elseif\($\_a==&quot;patron2&quot;\) \{ if\(\(Polerio::SelectGID\(\)==2\) || \(Polerio::SelectGID\(\)==4\) || \(Polerio::SessionGetVar\('uid'\)==2\)\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/patron2.php&quot;; $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); if\($patronnav\) \{ //$baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); //print\_r\($\_POST\); //print\_r\($\_GET\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; Patron::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($patrondeleteid\) \{ Patron::ProcessDeletePatronID\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $\_POST\['searchindex'\] = 1; $\_POST\['searchterm'\] = '%'; Patron::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Update Patron&quot;\) \{ Patron::ProcessUpdatePatronRecord\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $\_GET\['editpatronid'\] = $\_POST\['patronupdateid'\]; Patron::ShowEditNewPatronRecordArea\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($editpatronid\) \{ Patron::ShowEditNewPatronRecordArea\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($showallpatron\) \{ $\_POST\['searchindex'\] = 1; $\_POST\['searchterm'\] = '%'; Patron::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Search&quot;\) \{ Patron::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Add Patron&quot;\) \{ $uid = Patron::ProcessInsertNewPatronRecord\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); if\($uid\) \{ $\_GET\['editpatronid'\] = $uid; Patron::ShowEditNewPatronRecordArea\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} \} elseif\($newpatronrecord\) \{ Patron::ShowAddNewPatronRecordArea\(\); \} elseif\($searchterm\) \{ Patron::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} else \{ Patron::ShowPatronManagementArea\(\); \} \} else echo Phpmylibrary::IsLoggedIn\(&quot;Protected Area&quot;\); \} elseif\($\_a==&quot;webopac2&quot;\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/webopac2.php&quot;; if\($\_POST\['flag'\]==&quot;Search&quot;\) \{ Webopac::WebopacShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\)\); \} elseif\($catalogpos\) \{ //$baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); //print\_r\($\_POST\); //print\_r\($\_GET\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $EditID = Webopac::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); Webopac::ShowHoldingsValues\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($bakto\)\); \} elseif\($catalognav\) \{ //$baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); //print\_r\($\_POST\); //print\_r\($\_GET\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; Webopac::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID\) \{ $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $bakto = Webopac::MARCNormalViewToggler\(Polerio::InputFilter\($bakto\)\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['catalogpos'\] = $baktovars\['catalogpos'\]; Webopac::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} else \{ //Webopac::WebopacShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), // Polerio::InputFilter\($\_GET\)\); Webopac::ShowSearchCatalogArea\(\); \} \} elseif\($\_a==&quot;cataloging3&quot;\) \{ if\(\(Polerio::SelectGID\(\)==2\) || \(Polerio::SelectGID\(\)==4\) || \(Polerio::SessionGetVar\('uid'\)==2\)\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/cataloging3.php&quot;; $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); if\($importmarclnk\) \{ Cataloging::ShowUploadMARCRecords\(Polerio::InputFilter\($bakto\)\); \} elseif\($editholdings\) \{ Cataloging::ShowEditCopyHoldings\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($deleteholdingspos\) \{ Cataloging::ProcessDeleteCopyHoldings\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $EditID = Cataloging::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); Cataloging::ShowHoldingsValues\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($bakto\)\); \} elseif\($addcopy\) \{ Cataloging::ShowAddCopyHoldings\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($catalogpos\) \{ //$baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); //print\_r\($\_POST\); //print\_r\($\_GET\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $EditID = Cataloging::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); Cataloging::ShowHoldingsValues\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($bakto\)\); \} elseif\($catalognav\) \{ //$baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); //print\_r\($\_POST\); //print\_r\($\_GET\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; Cataloging::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Search&quot;\) \{ Cataloging::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\)\); \} elseif\($\_POST\['flag'\]==&quot;Update Copy&quot;\) \{ $barcodeid = Cataloging::ProcessUpdateCopyHoldings\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); $\_GET\['editholdings'\] = $barcodeid; Cataloging::ShowEditCopyHoldings\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Add Copy&quot;\) \{ Cataloging::ProcessAddCopyHoldings\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); //$baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); //print\_r\($\_POST\); //print\_r\($\_GET\); $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $EditID = Cataloging::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); Cataloging::ShowHoldingsValues\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($bakto\)\); \} elseif\($\_POST\['flag'\]==&quot;Import MARC&quot;\) \{ Cataloging::ShowUploadMARCRecords\(Polerio::InputFilter\($bakto\)\); Cataloging::ProcessMARCImport\(Polerio::InputFilter\($\_FILES\), Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($exportmarclnk\) \{ echo &quot;exportmarclnk&quot;; \} elseif\($reinitializerec\) \{ Cataloging::ReInitializeCatalogTables\(\); Cataloging::ShowCatalogManagementArea\(\); \} elseif\($showallrecords\) \{ $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = 0; $\_POST\['searchterm'\] = '%'; Cataloging::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} elseif\($subfieldmarctoggle\) \{ $bakto = Cataloging::MARCNormalViewToggler\(Polerio::InputFilter\($bakto\)\); Cataloging::ShowSelectedFieldTypeEncodingArea\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($bakto\)\); \} elseif\($marcviewtoggle\) \{ $bakto = Cataloging::MARCNormalViewToggler\(Polerio::InputFilter\($bakto\)\); list\($content, $tag, $value, $ldr\) = Cataloging::ConvertMARCToTagsAndValues\(Polerio::InputFilter\($EditID\)\); Cataloging::GetReOrderAndSaveMARCAndReIndex\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($ldr\)\); if\(empty\($baktovars\['catalogpos'\]\)\) \{ Cataloging::ShowCatalogFieldListing\(Polerio::InputFilter\($disp\), Polerio::InputFilter\($action\),Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($approved\), Polerio::InputFilter\($EditID\), Polerio::InputFilter\($catid\), Polerio::InputFilter\($content\), Polerio::InputFilter\($level\), Polerio::InputFilter\($bakto\), Polerio::InputFilter\($ldr\)\); \} else \{ $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['catalogpos'\] = $baktovars\['catalogpos'\]; $EditID = Cataloging::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); Cataloging::ShowHoldingsValues\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($bakto\)\); \} \} elseif\($EditID &amp;&amp; $\_POST\['flag'\]==&quot;Submit Field Addition&quot;\) \{ Cataloging::EditIDSubmitFieldAddition\(Polerio::InputFilter\($\_GET\),Polerio::InputFilter\($\_POST\)\); list\($content, $tag, $value, $ldr\) = Cataloging::ConvertMARCToTagsAndValues\($EditID\); Cataloging::GetReOrderAndSaveMARCAndReIndex\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($ldr\)\); if\(empty\($baktovars\['catalogpos'\]\)\) \{ Cataloging::ShowCatalogFieldListing\(Polerio::InputFilter\($disp\), Polerio::InputFilter\($action\),Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($approved\), Polerio::InputFilter\($EditID\), Polerio::InputFilter\($catid\), Polerio::InputFilter\($content\), Polerio::InputFilter\($level\), Polerio::InputFilter\($bakto\), Polerio::InputFilter\($ldr\)\); \} else \{ $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['catalogpos'\] = $baktovars\['catalogpos'\]; Cataloging::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} \} elseif\($EditID &amp;&amp; $deleterecord \) \{ Cataloging::EditIDDeleteRecord\(Polerio::InputFilter\($EditID\)\); echo &quot;Record deleted\!&quot;; if\(empty\($baktovars\['catalogpos'\]\)\) \{ /\* if\(empty\($bakto\)\) $bakto = &quot;KeyWords^%%%~Media^~Heading^~Operator^AND~offset^0~total^1~limit^10&quot;; list\($KeyWords,$Media,$Heading,$Operator,$offset, $total, $limit\) = Phpmylibrary::BackToDecoder\($bakto\); $GetModuleURI = Polerio::GetModuleURI\(\); echo Phpmylibrary::print\_query\(\); include\_once &quot;$GetModuleURI/lib/webpac.class.php&quot;; $webpac = new Webpac\_html; $recordSet = $webpac-&gt;GetBriefResult\($KeyWords,$Media,$Heading,$Operator,$limit,$offset,$total\); echo $webpac-&gt;GetBriefResult\_html\($recordSet\); \*/ \} else \{ $baktovars = PhpMyLibrary::BackToDecoder2\($bakto\); $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['catalogpos'\] = $baktovars\['catalogpos'\]; Cataloging::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} \} elseif\($EditID &amp;&amp; $gottagnum \) \{ Cataloging::ShowEditIDAddFieldGotTagNum\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($showaddingfield\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID &amp;&amp; $showaddingfield \) \{ Cataloging::ShowEditIDAddField\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($showaddingfield\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID &amp;&amp; $fieldindex &amp;&amp; $subfieldnavi \) \{ Cataloging::ShowSelectedFieldTypeEncodingArea\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($bakto\), Polerio::InputFilter\($subfieldnavi\)\); \} elseif\($EditID &amp;&amp; $fieldindex &amp;&amp; $deletefield \) \{ list\($content, $tag, $value, $ldr\) = Cataloging::EditIDFieldIndexDeleteField\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($bakto\)\); Cataloging::ShowCatalogFieldListing\(Polerio::InputFilter\($disp\), Polerio::InputFilter\($action\),Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($approved\), Polerio::InputFilter\($EditID\), Polerio::InputFilter\($catid\), Polerio::InputFilter\($content\), Polerio::InputFilter\($level\), Polerio::InputFilter\($bakto\), Polerio::InputFilter\($ldr\)\); \} elseif\($EditID &amp;&amp; $fieldindex &amp;&amp; $addsubfieldtotagnum \) \{ Cataloging::EditIDFieldIndexAddSubFieldShow\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($addsubfieldtotagnum\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID &amp;&amp; $fieldindex &amp;&amp; $addsubfield \) \{ Cataloging::EditIDFieldIndexAddSubField\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($addsubfield\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID &amp;&amp; $fieldindex &amp;&amp; $\_POST\['flag'\]==&quot;Save Modified and Add Subfield&quot;\) \{ Cataloging::EditIDFieldIndexSaveModifiedandAddSubfield\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID &amp;&amp; $fieldindex &amp;&amp; $\_POST\['flag'\]==&quot;Save Modified and Repeat Field&quot;\) \{ Cataloging::EditIDFieldIndexSaveModifiedandRepeatField\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID &amp;&amp; $fieldindex &amp;&amp; $\_POST\['flag'\]==&quot;Save Modified Field&quot;\) \{ Cataloging::EditIDFieldIndexSaveModifiedField\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($\_POST\)\); Cataloging::ShowSelectedFieldTypeEncodingArea\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID &amp;&amp; $fieldindex &amp;&amp; $delimindex &amp;&amp; $delimaction &amp;&amp; $bakto\) \{ Cataloging::EditIDFieldIndexDelimIndexDelimAction\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($delimindex\), Polerio::InputFilter\($delimaction\), Polerio::InputFilter\($bakto\)\); Cataloging::ShowSelectedFieldTypeEncodingArea\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID &amp;&amp; $fieldindex \) \{ Cataloging::ShowSelectedFieldTypeEncodingArea\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($fieldindex\), Polerio::InputFilter\($bakto\)\); \} elseif\($EditID\) \{ list\($content, $tag, $value, $ldr\) = Cataloging::ConvertMARCToTagsAndValues\(Polerio::InputFilter\($EditID\)\); Cataloging::GetReOrderAndSaveMARCAndReIndex\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($ldr\)\); if\(empty\($baktovars\['catalogpos'\]\)\) \{ Cataloging::ShowCatalogFieldListing\(Polerio::InputFilter\($disp\), Polerio::InputFilter\($action\),Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($approved\), Polerio::InputFilter\($EditID\), Polerio::InputFilter\($catid\), Polerio::InputFilter\($content\), Polerio::InputFilter\($level\), Polerio::InputFilter\($bakto\), Polerio::InputFilter\($ldr\)\); \} else \{ $\_POST\['Heading'\] = $baktovars\['Heading'\]; $\_POST\['searchterm'\] = $baktovars\['searchterm'\]; $\_GET\['catalogpos'\] = $baktovars\['catalogpos'\]; Cataloging::ShowDetailedRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\), Polerio::InputFilter\($bakto\)\); \} \} elseif\($rectype &amp;&amp; $rectype\_submitted==&quot;1&quot;\) \{ $EditID = Cataloging::SaveSelectedRecordTypeEncodingArea\(Polerio::InputFilter\($\_POST\)\); list\($content, $tag, $value, $ldr\) = Cataloging::ConvertMARCToTagsAndValues\(Polerio::InputFilter\($EditID\)\); Cataloging::GetReOrderAndSaveMARCAndReIndex\(Polerio::InputFilter\($EditID\), Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($ldr\)\); Cataloging::ShowCatalogFieldListing\(Polerio::InputFilter\($disp\), Polerio::InputFilter\($action\),Polerio::InputFilter\($tag\), Polerio::InputFilter\($value\), Polerio::InputFilter\($approved\), Polerio::InputFilter\($EditID\), Polerio::InputFilter\($catid\), Polerio::InputFilter\($content\), Polerio::InputFilter\($level\), Polerio::InputFilter\($bakto\), Polerio::InputFilter\($ldr\)\); \} elseif\($rectype\) \{ Cataloging::ShowSelectedRecordTypeEncodingArea\(Polerio::InputFilter\($rectype\)\); \} elseif\($newcatalogrecord\) \{ Cataloging::ShowSelectRecordType\(\); \} elseif\($searchterm\) \{ Cataloging::ShowSearchRecordsUsingIndexName\(Polerio::InputFilter\($\_POST\), Polerio::InputFilter\($\_GET\)\); \} else \{ Cataloging::ShowCatalogManagementArea\(\); \} \} else echo Phpmylibrary::IsLoggedIn\(&quot;Protected Area&quot;\); \} elseif\($\_a==&quot;support&quot;\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/support.php&quot;; Support::ShowSupportArea\(\); \} elseif\($\_a==4\) \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/webopac2.php&quot;; if\($msg==1\) echo&quot;Succesfully Login\! &quot;.Webopac::ShowSearchCatalogArea\(\); elseif\($msg==2\) echo&quot;Please Retry\!&quot;; elseif\($msg==3\) echo &quot;Wrong Password\!&quot;.Phpmylibrary::Login\(\); elseif\($msg==4\) echo &quot;Wrong Username and Password\!&quot;.Phpmylibrary::Login\(\); elseif\($msg==5\) echo&quot;Successfully Logged-out&quot;.Phpmylibrary::Login\(\); else echo Phpmylibrary::IsLoggedIn\(&quot;Protected Area&quot;\); \}elseif\($\_a==3 \) \{ if\($q==&quot;login&quot;\) \{ echo Phpmylibrary::Login\(\); \} elseif\($q==&quot;logout&quot;\) \{ echo &quot;Successfully Logged-out&quot;; \} else echo Phpmylibrary::IsLoggedIn\(&quot;Protected Area&quot;\); \} else \{ include\_once Polerio::GetModuleURI\(\).&quot;/lib/webopac2.php&quot;; Webopac::ShowSearchCatalogArea\(\); \} if\(Polerio::PostNuke\(\)\) \{ CloseTable\(\); include\(&quot;./footer.php&quot;\); \} else \{ CloseTable\(\); include './footer.php'; \} ?&gt;