📄 content.inc.php
字号:
<?php
/*apr 2, 2004 []all inclusion of files should be in here. there should be no files that will be loaded inside the class. this is a rule that should be followed. [] make pythonic view. [] this problem has just flash back in my mind, the language selection is not working fine. in addition the french translation, indonesian and spanish has been submitted but is not yet adopted in the directory. [] because i am not now using the mysql, % counting will not be allowed thus the program should still give the total number of collection without using the % so that in the future I will be able to see the total collection of every library that are using phpmylibrary [] so many things happend during the year that passed. I learned python and postgresql and now I was able to adopt this in phpmylibrary. the tabulated alignment has been inspired from python programming using wxPython. then the new database functionality was discovered in postgresql. i really need the intersect, union and except or else i have to do it manually which i do not like. i am worried to windows users because they might not be able to use it given the postgresql database which only run in linux, there's a soultion, using cygwin, but i haven't done anything using that practice that i assume it is not workable. the last resort could be, is the sqlite which i've just learned just recently, it has the same functionality like the postgresql, intersect, union and except, and it runs 2 times faster than mysql and postgresql on normal operation, and it is embedded database, meaning you can install the phpmylibrary without installing a separate database server, but it is only available on php5 version which i think could in stable production state one year from now. [] from the current code, i've discovered that explicit definition of the administrator id, I'm think of putting a variable for it so that it is not clearly assigned in there. [] i will be using smarty, and replaced all the logs message [] i will replace the :: to -> to make it more consistentapr-8-2004 [] change the login or authentication scheme. do not detect the id but the username. if it is admin then it is the superuser. also detect the group name. the security level will depend on the username and groupname.*/$_post = $_POST;$_get = $_GET;$_files = $_FILES;
$pol = new Polerio;$pml = new PhpMyLibrary;$tpl = new polTemplate;$usr = new UserMan;$web = new Webpac_html;$cat = new Cataloging;$trn = new Transaction;$hld = new Holdings;$fdt = new FetchDetailed;$pol->Init();$usr->SetArgvs($_post, $_get, $_files);$usr->SetNeededClasses($pol, $pml, $tpl, $usr, $web, $cat, $trn, $hld, $fdt);$web->SetArgvs($_post, $_get, $_files);$web->SetNeededClasses($pol, $pml, $tpl, $usr, $web, $cat, $trn, $hld, $fdt);$cat->SetArgvs($_post, $_get, $_files);$cat->SetNeededClasses($pol, $pml, $tpl, $usr, $web, $cat, $trn, $hld, $fdt);$trn->SetArgvs($_post, $_get, $_files);$trn->SetNeededClasses($pol, $pml, $tpl, $usr, $web, $cat, $trn, $hld, $fdt);$hld->SetArgvs($_post, $_get, $_files);$hld->SetNeededClasses($pol, $pml, $tpl, $usr, $web, $cat, $trn, $hld, $fdt);$fdt->SetArgvs($_post, $_get, $_files);$fdt->SetNeededClasses($pol, $pml, $tpl, $usr, $web, $cat, $trn, $hld, $fdt);$fdt->SetTags($tag_name, $tag_defs,$tag_deli);// webpac arguments valuesif(empty($offset)) $offset=0;$argvs = array();$argvs['KeyWords'] = strtoupper($KeyWords);$argvs['Media'] = $Media;$argvs['Heading'] = $Heading;$argvs['Operator'] = $Operator;$argvs['limit'] = $limit;$argvs['offset'] = $offset;$argvs['total'] = $total;$argvs['marc'] = $marc;$argvs['bakto'] = $bakto;$argvs['fetch_detailed'] = $fetch_detailed;// postnuke hack
if(!$pol->PostNuke()) {
include './functions.php';
pnThemeLoad();
include './header.php';
OpenTable();
}
if($my_content) { // i really don;t know yet what is this // i see, this is for the loading of the static contents. like the announcements.html, etc.
global $library_content;
$fname = "polerio/contents/".$fcontent;
if($pol->PostNuke()) $fname = $fname = "modules/PhpMyLibrary/polerio/contents/".$fcontent;
$inc_file = @filesize($fname);
if($inc_file) {
if(substr($fcontent,strlen($fcontent)-3,3)=="txt") {
$myFile = fopen($fname,"r");
while(!feof($myFile))
{
$myLine = fgetss($myFile, 255);
echo $myLine."<br>";
}
fclose($myFile);
}
else { include($fname); }
}
else { echo "<b>Error!!!<br><br>Failed to open <i>$fcontent</i>.<br><br></b>"; }
} elseif($_a=="pgs") { // the loussy polgensql program that should be discarded
include_once $pol->GetModuleURI()."/lib/polgensql.php";
echo polGenSQL::output();
} elseif($div=="usr") { // user management tasks
if($acc=="pub") {
if($pml->IsLoggedIn()>=2) {
if($q=="res" && !empty($id)) {
if($pol->SecConfirmAuthKey($sessid)) {
if(gettype($trn->GetStatus($id))=='NULL') {
$trn->Reserve($id);
echo "<b>Succesfully Reserved!</b>";
}
} else { echo "<b>Session Expired!</b>"; }
list($fetch_detailed, $KeyWords,$Media,$Heading,$Operator,$offset, $total, $limit, $marc) = $pml->BackToDecoder($bakto);
echo $pml->print_query();
echo $hld->ListHoldings($fetch_detailed,$bakto);
echo $web->fetch_detailed($fetch_detailed, $KeyWords,$Media,$Heading,$Operator,$offset,$limit, $total, $marc);
}
if($q=="mya") {
$uid = $pol->SessionGetVar('uid');
echo $trn->UserTransaction();
echo $trn->ManageTransaction(); if($ac=="bib") echo $fdt->fetch_one($bibid);
echo $usr->UserAction();
}
} else { echo $pml->IsLoggedIn("Registered Area"); }
} elseif($acc="priv") {
if(($pol->SelectGID()==2) || ($pol->SelectGID()==3) || ($pol->SessionGetVar('uid')==2)) {
if($q=="man") {
echo $usr->Actions();
echo $usr->Manage();
}
elseif($q=="upd") {
if($pol->SecConfirmAuthKey($sessid)) {
echo "<b>Succesfully Approved!</b><br> <br>";
$trn->Update($tid);
} else { echo "<b>Session Expired!</b><br> <br>"; }
echo $trn->ManageTransaction();
}
elseif($q=="del") {
if($pol->SecConfirmAuthKey($sessid)) {
echo "<b>Succesfully Denied!</b><br> <br>";
$trn->Delete($tid);
} else { echo "<b>Session Expired!</b><br> <br>"; }
echo $trn->ManageTransaction();
}
elseif($q=="view") {
echo $usr->UserAction();
}
elseif($q=="dele") {
if($uid!=2) { echo "<b>User Account and Transaction Succesfully Erased!</b>";
echo $usr->Delete($uid);
echo $usr->Manage();
} else {
echo "<b>Sorry, Admin account cannot be deleted! <br>Admin Transactions has been Deleted!</b>";
$trn->DeleteUserTransactions($uid);
echo $usr->Manage();
}
} }
} else { echo $pml->IsLoggedIn("Admin Area"); }
}
elseif($div=="tra") { // transaction management, approving, denying user reserved materials
if($acc=="pub") {
if($pml->IsLoggedIn()>=2) {
if($q=="res" && !empty($id)) {
if($pol->SecConfirmAuthKey($sessid)) {
if(gettype($trn->GetStatus($id))=='NULL') {
$trn->Reserve($id);
echo "<b>Succesfully Reserved!</b>";
}
} else { echo "<b>Session Expired!</b>"; } $baktoarray = $pml->BackToDecoder($bakto);
echo $pml->print_query(); list($id, $result) = $fdt->fetch_detailed($baktoarray); echo $hld->ListHoldings($id,$bakto); echo $result;
}
} else { echo $pml->IsLoggedIn("Registered Area"); }
} elseif($acc="priv") {
if(($pol->SelectGID()==2) || ($pol->SelectGID()==3) || ($pol->SessionGetVar('uid')==2)) {
if($q=="man") {
echo $trn->ManageTransaction();
if($ac=="bib") echo $fdt->fetch_one($bibid);
elseif($ac=="usv") echo $usr->UserAction();
}
elseif($q=="upd") {
if($pol->SecConfirmAuthKey($sessid)) {
echo "<b>Succesfully Approved!</b><br> <br>";
$trn->Update($tid);
} else {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -