📄 usermanage.class.php
字号:
$recordSet = $dbconn->Execute($sql);
Transaction::DeleteBorrowed($uid);
}
function _Update()
{ $f = $this->_files['fupload'];
if($this->pol->SelectGID()==3) $gid=1;
$picture = $this->pol->makePass().$this->pol->TimeAndRandom(); $picture_dir = $this->pml->PictureDir();
if($f['type']=="image/gif" || $f['type']=="image/jpeg" || $f['type']=="image/pjpeg" || $f['type']=="image/x-png") { if($f['size'] <= 10000) { copy($fupload,"$picture_dir/$picture"); } }
$recordSet = $this->Update();
if(empty($recordSet)) { $errorupdate = $upd[uid]; $remarks = "<b>An Error
has Occured!<br>You new Username/UserID already existed!.<br>Please encode
distinct Username/UserID.</b>"; $ac="a"; } else $remarks = "<b>Succesfully
Modified!</b>";
return $remarks;
}
function Add()
{ $f = $this->_files['fupload']; $picture = $this->pol->makePass().$this->pol->TimeAndRandom(); $picture_dir = $this->pml->PictureDir();
if($this->pol->SelectGID()==3) $gid=1;
if($f['type']=="image/gif" || $f['type']=="image/jpeg" || $f['type']=="image/pjpeg" || $f['type']=="image/x-png") {
if($f['size'] <= 10000)
{
copy($fupload,"$picture_dir/$picture");
}
}
$recordSet = $this->Insert();
if(empty($recordSet)) { $remarks = "<b>An Error has Occured!<br>Username/UserID already exist.<br>Please encode distinct Username/UserID.</b>"; $ac="a"; }
else $remarks = "<b>Succesfully Added!</b>";
return $remarks;
}
function UserAction()
{
global $ac,$q;
if($ac=="v" || $q=="mya" || $ac=="usv" )
{
global $uid,$user_type, $user_status,$dept_type,$library_user_type,$bakto,$usvid;
if(empty($usvid)) $usvid=$uid;
list($uid,$gid,$fname,$lname,$uname,$barcode,$pass,$type,$status,$dept,$email,$femail,$url,$telno,$address,$picname) =
$this->SelectVarName($usvid,array('uid','gid','fname','lname','uname','barcode','pass','type','status','dept','email','femail','url','telno','address','picture'));
list($div, $acc,$q,$next_page,$select_user) = $this->pml->BackToDecoder($bakto);
$bakto = '<a href="'.$this->pol->GetModuleURL().$this->pol->Med().'div='.$div.'&acc='.$acc.'&q='.$q.'&next_page='.$next_page.'&select_user='.$select_user.'">Back</a>';
$pass ='*********';
$gid = $library_user_type[$gid][1];
$status = $user_status[$status];
$type = $user_type[$type][5];
$dept = $dept_type[$dept][1];
$color = $this->pol->SelectColor();
$bgcolor1 = $color[1];
$bgcolor2 = $color[2];
$bgcolor3 = $color[3];
global $picture_dir;
$addnewormain = ' <a href="'.$this->pol->GetModuleURL().$this->pol->Med().'div=usr&acc=priv&q=view&uid=&ac=a">Add New User</a>';
$img_file = @filesize($picture_dir.'/'.$picname);
$picmoduleurl = $this->pol->GetBaseURL().'picture_dir';
if($img_file) { $picture = '<br><b>User Picture</b><br><br><img src="'.$picmoduleurl.'/'.$picname.'" height="100" width="80"><br>'; }
else { $picture = '<br><b><u>No Picture</u></b><br>'; }
if(($this->pol->SelectGID()!=2) || ($this->pol->SelectGID()!=4)) { $remarks =""; $addnewormain=""; }
$authid = $this->pol->SecGenAuthKey();
$template = $this->tpl->LoadTemplate($this->pol->GetModuleURI().'templates/usersaddedit.html');
$vars = array( "pol::getmoduleurl","pol::authid","pol::bgcolor1","pol::bgcolor2","pol::bgcolor3",
"pol::uid","pol::gid","pol::fname","pol::lname","pol::uname","pol::barcode",
"pol::pass","pol::type","pol::status","pol::dept","pol::email","pol::femail","pol::url",
"pol::telno","pol::address","pol::submit","pol::remarks","pol::addnewormain","pol::picture","pol::picname","pol::bakto"
);
$vals = array( "$getmoduleurl","$authid","$bgcolor1","$bgcolor2","$bgcolor3",
"$uid","$gid","$fname","$lname","$uname","$barcode",
"$pass","$type","$status","$dept","$email","$femail","$url",
"$telno","$address","$submit","$remarks","$addnewormain","$picture","$picname","$bakto"
);
$template = $this->tpl->ReplaceStatic($template, $vars, $vals);
} elseif($ac=="e")
{
global $uid;
global $q, $uid, $user_type, $user_status,$dept_type,$library_user_type,$bakto; list($div, $acc,$q,$next_page,$select_user) = $this->pml->BackToDecoder($bakto);
$bakto = '<a href="'.$this->pol->GetModuleURL().$this->pol->Med().'div='.$div.'&acc='.$acc.'&q='.$q.'&next_page='.$next_page.'&select_user='.$select_user.'">Back</a>';
$getmoduleurl = $this->pol->GetModuleURL().$this->pol->Med().'div=usr&acc=priv&q=man&next_page='.$next_page.'&select_user='.$select_user;
list($uid,$gid,$fname,$lname,$uname,$barcode,$pass,$type,$status,$dept,$email,$femail,$url,$telno,$address,$picname) =
$this->SelectVarName($uid,array('uid','gid','fname','lname','uname','barcode','pass','type','status','dept','email','femail','url','telno','address','picture'));
$olduid = $uid;
$pass ='**********';
$submit = '<br><b>Upload 2x2 Picture.<br>Preferably 80x100 pixels.<br>Must be in GIF/JPG/PNG Format</b><br><br><input type="file" name="fupload" /><br><br>';
$uid = '<INPUT TYPE="text" NAME="uid" VALUE="'.$uid.'">';
$fname = '<INPUT TYPE="text" NAME="fname" VALUE="'.$fname.'">';
$lname = '<INPUT TYPE="text" NAME="lname" VALUE="'.$lname.'">';
$uname = '<INPUT TYPE="text" NAME="uname" VALUE="'.$uname.'">';
$barcode = '<INPUT TYPE="text" NAME="barcode" VALUE="'.$barcode.'">';
$pass = '<INPUT TYPE="password" NAME="pass" VALUE="'.$pass.'">';
$email = '<INPUT TYPE="text" NAME="email" VALUE="'.$email.'">';
$femail = '<INPUT TYPE="text" NAME="femail" VALUE="'.$femail.'">';
$url = '<INPUT TYPE="text" NAME="url" VALUE="'.$url.'">';
$telno = '<INPUT TYPE="text" NAME="telno" VALUE="'.$telno.'">';
$address = '<INPUT TYPE="text" NAME="address" VALUE="'.$address.'">';
$n=$type;
$type = '<select name="type">';
$type .='';
for($i=0;$i<count($user_type);$i++)
{
if(($i+1)==$n) $selected="selected"; else $selected="";
$type .= '<option value="'.($i+1).'" '.$selected.' >'.$user_type[($i+1)][5].'</option>'."\n";
}
$type .='</select> ';
$n=$status;
$status = '<select name="status">';
$status .='';
for($i=0;$i<count($user_status);$i++)
{
if(($i+1)==$n) $selected="selected"; else $selected="";
$status .= '<option value="'.($i+1).'" '.$selected.' >'.$user_status[($i+1)].'</option>'."\n";
}
$status .= '</select> ';
$n=$dept;
$dept = '<select name="dept">';
$dept .='';
for($i=0;$i<count($dept_type);$i++)
{
if(($i+1)==$n) $selected="selected"; else $selected="";
$dept .= '<option value="'.($i+1).'" '.$selected.' >'.$dept_type[($i+1)][1].'</option>'."\n";
}
$dept .= '</select> ';
$n=$gid;
$gid = '<select name="gid">';
$gid .='';
for($i=0;$i<count($library_user_type);$i++)
{
if(($i+1)==$n) $selected="selected"; else $selected="";
$gid .= '<option value="'.($i+1).'" '.$selected.' >'.$library_user_type[($i+1)][1].'</option>'."\n";
}
$gid .= '</select> ';
if($this->pol->SelectGID()==3) $gid='<input type="hidden" name="gid" value="1"> <b>Normal User</b>';
$submit .= '<INPUT TYPE="hidden" NAME="div" VALUE="'.$div.'">';
$submit .= '<INPUT TYPE="hidden" NAME="acc" VALUE="'.$acc.'">';
$submit .= '<INPUT TYPE="hidden" NAME="q" VALUE="'.$q.'">';
$submit .= '<INPUT TYPE="hidden" NAME="next_page" VALUE="'.$next_page.'">';
$submit .= '<INPUT TYPE="hidden" NAME="select_user" VALUE="'.$select_user.'">';
if($ac=="e") $submit .= '<INPUT TYPE="submit" NAME="action" VALUE="Update"><INPUT TYPE="hidden" NAME="olduid" VALUE="'.$olduid.'">';
if($ac=="a") $submit .= ' <INPUT TYPE="submit" NAME="action" VALUE="Add">';
$submit .= ' <INPUT TYPE="reset" VALUE="Clear">';
$color = $this->pol->SelectColor();
$bgcolor1 = $color[1];
$bgcolor2 = $color[2];
$bgcolor3 = $color[3];
global $picture_dir;
$addnewormain = ' <a href="'.$this->pol->GetModuleURL().$this->pol->Med().'div=usr&acc=priv&q=view&uid=&ac=a">Add New User</a>';
$img_file = @filesize($picture_dir.'/'.$picname);
$picmoduleurl = $this->pol->GetBaseURL().'picture_dir';
if($img_file) { $picture = '<br><b>User Picture</b><br><br><img src="'.$picmoduleurl.'/'.$picname.'" height="100" width="80"><br>'; }
else $picture = '<br><b><u>No Picture</u></b><br>';
$authid = $this->pol->SecGenAuthKey();
$template = $this->tpl->LoadTemplate($this->pol->GetModuleURI().'templates/usersaddedit.html');
$vars = array( "pol::getmoduleurl","pol::authid","pol::bgcolor1","pol::bgcolor2","pol::bgcolor3",
"pol::uid","pol::gid","pol::fname","pol::lname","pol::uname","pol::barcode",
"pol::pass","pol::type","pol::status","pol::dept","pol::email","pol::femail","pol::url",
"pol::telno","pol::address","pol::submit","pol::remarks","pol::addnewormain","pol::picture","pol::picname","pol::bakto"
);
$vals = array( "$getmoduleurl","$authid","$bgcolor1","$bgcolor2","$bgcolor3",
"$uid","$gid","$fname","$lname","$uname","$barcode",
"$pass","$type","$status","$dept","$email","$femail","$url",
"$telno","$address","$submit","$remarks","$addnewormain","$picture","$picname","$bakto"
);
$template = $this->tpl->ReplaceStatic($template, $vars, $vals);
} elseif($ac=="a")
{
global $user_type, $user_status,$dept_type,$library_user_type,$bakto;
list($div, $acc,$q,$next_page,$select_user) = $this->pml->BackToDecoder($bakto);
$bakto = '<a href="'.$this->pol->GetModuleURL().$this->pol->Med().'div='.$div.'&acc='.$acc.'&q='.$q.'&next_page='.$next_page.'&select_user='.$select_user.'">Back</a>';
$rand = $this->pol->TimeAndRandom();
$uid = substr($rand,strlen($rand)-8,8);
$getmoduleurl = $this->pol->GetModuleURL().$this->pol->Med().'div=usr&acc=priv&q=man';
$submit = '<br><b>Upload 2x2 Picture.<br>Preferably 80x100 pixels.<br>Must be in GIF/JPG/PNG Format</b><br><br><input type="file" name="fupload" /><br><br>';
$uid = '<INPUT TYPE="text" NAME="uid" VALUE="'.$uid.'">';
$fname = '<INPUT TYPE="text" NAME="fname" VALUE="'.$fname.'">';
$lname = '<INPUT TYPE="text" NAME="lname" VALUE="'.$lname.'">';
$uname = '<INPUT TYPE="text" NAME="uname" VALUE="'.$uname.'">';
$barcode = '<INPUT TYPE="text" NAME="barcode" VALUE="'.$barcode.'">';
$pass = '<INPUT TYPE="password" NAME="pass" VALUE="'.$pass.'">';
$email = '<INPUT TYPE="text" NAME="email" VALUE="'.$email.'">';
$femail = '<INPUT TYPE="text" NAME="femail" VALUE="'.$femail.'">';
$url = '<INPUT TYPE="text" NAME="url" VALUE="'.$url.'">';
$telno = '<INPUT TYPE="text" NAME="telno" VALUE="'.$telno.'">';
$address = '<INPUT TYPE="text" NAME="address" VALUE="'.$address.'">';
$n=$type;
$type = '<select name="type">';
$type .='';
for($i=0;$i<count($user_type);$i++)
{
if(($i+1)==$n) $selected="selected"; else $selected="";
$type .= '<option value="'.($i+1).'" '.$selected.' >'.$user_type[($i+1)][5].'</option>'."\n";
}
$type .='</select> ';
$n=$status;
$status = '<select name="status">';
$status .='';
for($i=0;$i<count($user_status);$i++)
{
if(($i+1)==$n) $selected="selected"; else $selected="";
$status .= '<option value="'.($i+1).'" '.$selected.' >'.$user_status[($i+1)].'</option>'."\n";
}
$status .= '</select> ';
$n=$dept;
$dept = '<select name="dept">';
$dept .='';
for($i=0;$i<count($dept_type);$i++)
{
if(($i+1)==$n) $selected="selected"; else $selected="";
$dept .= '<option value="'.($i+1).'" '.$selected.' >'.$dept_type[($i+1)][1].'</option>'."\n";
}
$dept .= '</select> ';
$n=$gid;
$gid = '<select name="gid">';
$gid .='';
for($i=0;$i<count($library_user_type);$i++)
{
if(($i+1)==$n) $selected="selected"; else $selected="";
$gid .= '<option value="'.($i+1).'" '.$selected.' >'.$library_user_type[($i+1)][1].'</option>'."\n";
}
$gid .= '</select> ';
if($this->pol->SelectGID()==3) $gid='<input type="hidden" name="gid" value="1"> <b>Normal User</b>';
if($ac=="e") $submit .= '<INPUT TYPE="submit" NAME="action" VALUE="Update">';
if($ac=="a") $submit .= ' <INPUT TYPE="submit" NAME="action" VALUE="Add">';
$submit .= ' <INPUT TYPE="reset" VALUE="Clear">';
$color = $this->pol->SelectColor();
$bgcolor1 = $color[1];
$bgcolor2 = $color[2];
$bgcolor3 = $color[3];
global $picture_dir;
$addnewormain = ' <a href="'.$this->pol->GetModuleURL().$this->pol->Med().'div=usr&acc=priv&q=view&uid=&ac=a">Add New User</a>';
$img_file = @filesize($picture_dir.'/'.$picname);
$picmoduleurl = $this->pol->GetBaseURL().'picture_dir';
if($img_file) { $picture = '<br><b>User Picture</b><br><br><img src="'.$picmoduleurl.'/'.$picname.'" height="100" width="80"><br>'; }
else $picture = '<br><b><u>No Picture</u></b><br>';
$authid = $this->pol->SecGenAuthKey();
$template = $this->tpl->LoadTemplate($this->pol->GetModuleURI().'templates/usersaddedit.html');
$vars = array( "pol::getmoduleurl","pol::authid","pol::bgcolor1","pol::bgcolor2","pol::bgcolor3",
"pol::uid","pol::gid","pol::fname","pol::lname","pol::uname","pol::barcode",
"pol::pass","pol::type","pol::status","pol::dept","pol::email","pol::femail","pol::url",
"pol::telno","pol::address","pol::submit","pol::remarks","pol::addnewormain","pol::picture","pol::picname","pol::bakto"
);
$vals = array( "$getmoduleurl","$authid","$bgcolor1","$bgcolor2","$bgcolor3",
"$uid","$gid","$fname","$lname","$uname","$barcode",
"$pass","$type","$status","$dept","$email","$femail","$url",
"$telno","$address","$submit","$remarks","$addnewormain","$picture","$picname","$bakto"
);
$template = $this->tpl->ReplaceStatic($template, $vars, $vals);
} else {
}
return $template; }
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -