📄 vfunctions.php
字号:
<?
################################################################################
# phpQuestionnaire Version 2.2 #
# Copyright 2003-2005 chumpsoft, inc. March 28, 2005 #
################################################################################
# SCRiPTMAFiA 2005 - THE DiRTY HANDS ON YOUR SCRiPTS #
################################################################################
function RecreateSurvey ($sid, $uid, $tablewidth, $masurvey, $print) {
global $phpQlang;
$cq = ($GLOBALS["cq"]) ? $GLOBALS["cq"] : 1;
$mqinfo = mysql_query("select * from phpQUser where SID = \"".ProtectMySQL($sid)."\" and UID = \"".ProtectMySQL($uid)."\"");
if ($mainfo = mysql_fetch_array($mqinfo)) {
$ipaddr = ($mainfo["IPAddr"]) ? $mainfo["IPAddr"] : $phpQlang['unavailable'];
$contents = "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=$tablewidth>\n";
$contents .= "<TR><TD ALIGN=right><B>".$phpQlang['Date'].":</B> </TD><TD>".$mainfo["CompleteDate"]."</TD></TR>\n";
$contents .= "<TR><TD ALIGN=right><B>".$phpQlang['IPAddress'].":</B> </TD><TD>$ipaddr</TD></TR>\n";
if (!$print) {
$contents .= "<TR><TD ALIGN=right><B>".$phpQlang['ResultsView'].":</B> </TD><TD>";
$contents .= "<B>".$phpQlang['HTMLResults']."</B> | <A HREF=\"view.php?sid=$sid&uid=$uid&print=1\">".$phpQlang['PrinterResults']."</A>";
$contents .= "</TD></TR>\n";
}
$restrictions = array();
if (substr($mainfo["CheckType"],0,1)) {
$restrictions[] = $phpQlang['UniqueIPAddress'];
}
if (substr($mainfo["CheckType"],1,1)) {
$restrictions[] = $phpQlang["Cookies"];
}
if (substr($mainfo["CheckType"],2,1)) {
$email = ($mainfo["Email"]) ? $mainfo["Email"] : $phpQlang['notentered'];
if ($mainfo["Email"]) {
$email .= ($mainfo["EmailConfirm"] == 'y') ? ' '.$phpQlang['confirmed'] : ' '.$phpQlang['unconfirmed'];
}
$email = ProtectHTML($email);
if (!$print || $mainfo["Email"]) {
$contents .= "<TR><TD ALIGN=right><B>".$phpQlang['Email'].":</B> </TD><TD>$email</TD></TR>\n";
}
$restrictions[] = $phpQlang['VerifiedEmailAddress'];
}
if (count($restrictions) && !$print) {
$contents .= "<TR><TD ALIGN=right><B>".$phpQlang['UserRestrictions'].":</B> </TD><TD>" . join(', ', $restrictions) . "</TD></TR>\n";
}
$contents .= "</TABLE>\n";
}
$contents .= "<BR>\n";
$contents .= "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=$tablewidth>\n";
if (!$print) {
$contents .= "<FORM>\n";
}
$mqquestion = mysql_query("select * from phpQQuestion where SID = \"".ProtectMySQL($sid)."\" and SortOrder >= \"".ProtectMySQL($cq)."\" order by SortOrder");
while ($maquestion = mysql_fetch_array($mqquestion)) {
if ($maquestion["Type"] != "pagebreak" && (!$print || $maquestion["Type"] != 'htmlcontent')) {
$qstring = "select * from phpQAnswer where SID = \"".ProtectMySQL($sid)."\" ";
$qstring .= "and QID = \"".ProtectMySQL($maquestion["QID"])."\" and UID = \"".ProtectMySQL($uid)."\"";
$mquidanswer = mysql_query($qstring);
$uidanswer = ($mauidanswer = mysql_fetch_array($mquidanswer)) ? $mauidanswer["Answer"] : "";
$contents .= PrintQuestion($maquestion, $masurvey);
$contents .= PrintAnswers($maquestion, $masurvey, $uidanswer, $print);
} else {
if (!$print) {
$next = true;
break;
}
}
$cq++;
}
if (!$print) {
$buttontext = ($next) ? $phpQlang['Next'] : $phpQlang['Close'];
$contents .= PrintNextButton($sid, $buttontext);
$contents .= "<INPUT TYPE=hidden NAME=sid VALUE=\"$sid\">\n";
$contents .= "<INPUT TYPE=hidden NAME=uid VALUE=\"$uid\">\n";
$contents .= "<INPUT TYPE=hidden NAME=cq VALUE=\"".($cq+1)."\">\n";
$contents .= "</FORM>\n";
}
$contents .= "</TABLE>\n";
return $contents;
}
function PrintNextButton ($sid, $buttontext) {
global $phpQlang;
$condition = ($buttontext == $phpQlang['Close']) ? true : false;
$submittype = ($condition) ? "button" : "submit";
$clickjs = ($condition) ? "ONCLICK=\"window.close()\"" : "";
$contents = "<TR><TD ALIGN=center>\n";
$contents .= "<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0><TR>\n";
$contents .= "<TD><INPUT TYPE=$submittype $clickjs VALUE=\"$buttontext\"></TD>\n";
$contents .= "</TR></TABLE>\n";
$contents .= "</TD></TR>\n";
return $contents;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -