Skip to content

Commit

Permalink
Various updates to stop "notices" and "warnings" from occurring..
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@766 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Nov 9, 2003
1 parent 4d8e130 commit 43d4b82
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 32 deletions.
30 changes: 15 additions & 15 deletions admin/admin.php
Expand Up @@ -151,21 +151,21 @@
exit;
}

echo "$surveysummary";
if ($cssummary) {echo $cssummary;}
if ($usersummary) {echo $usersummary;}
if ($addsummary) {echo $addsummary;}
if ($editsurvey) {echo "$editsurvey";}
if ($newgroup) {echo "$newgroup";}
if ($groupsummary) {echo "$groupsummary";}
if ($editgroup) {echo "$editgroup";}
if ($newquestion) {echo "$newquestion";}
if ($questionsummary) {echo "$questionsummary";}
if ($editquestion) {echo "$editquestion";}
if ($newanswer) {echo "$newanswer";}
if ($answersummary) {echo "$answersummary";}
if ($vasummary) {echo "$vasummary";}
if ($editanswer) {echo "$editanswer";}
if (isset($surveysummary)) {echo $surveysummary;}
if (isset($cssummary)) {echo $cssummary;}
if (isset($usersummary)) {echo $usersummary;}
if (isset($addsummary)) {echo $addsummary;}
if (isset($editsurvey)) {echo $editsurvey;}
if (isset($newgroup)) {echo $newgroup;}
if (isset($groupsummary)) {echo $groupsummary;}
if (isset($editgroup)) {echo $editgroup;}
if (isset($newquestion)) {echo $newquestion;}
if (isset($questionsummary)) {echo $questionsummary;}
if (isset($editquestion)) {echo $editquestion;}
if (isset($newanswer)) {echo $newanswer;}
if (isset($answersummary)) {echo $answersummary;}
if (isset($vasummary)) {echo $vasummary;}
if (isset($editanswer)) {echo $editanswer;}
echo "\t\t</td>\n";

helpscreen();
Expand Down
9 changes: 4 additions & 5 deletions admin/browse.php
Expand Up @@ -50,7 +50,6 @@

$surveyoptions = browsemenubar();
echo $htmlheader;

echo "<table height='1'><tr><td></td></tr></table>\n"
."<table width='99%' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n";

Expand Down Expand Up @@ -258,7 +257,7 @@
echo "\t<tr bgcolor='#555555'><td colspan='2' height='4'><font size='1' face='verdana' color='white'><b>"
. _BROWSERESPONSES.":</b> <font color='#EEEEEE'>$surveyname</td></tr>\n";

if (!$_POST['sql'])
if (!isset($_POST['sql']))
{echo "$surveyoptions";} //don't show options when called from another script with a filter on
else
{
Expand Down Expand Up @@ -360,7 +359,7 @@
. "\t\t<td bgcolor='#333333'><font size='1' color='white' width='$cellwidth'><b>id</b></td>\n";
foreach ($fnames as $fn)
{
if (!$currentgroup) {$currentgroup = $fn[3]; $gbc = "#555555";}
if (!isset($currentgroup)) {$currentgroup = $fn[3]; $gbc = "#555555";}
if ($currentgroup != $fn[3])
{
$currentgroup = $fn[3];
Expand All @@ -386,7 +385,7 @@
if ($limit > $dtcount) {$limit=$dtcount;}

//NOW LETS SHOW THE DATA
if ($_POST['sql'])
if (isset($_POST['sql']))
{
if ($_POST['sql'] == "NULL") {$dtquery = "SELECT * FROM $surveytable ORDER BY id";}
else {$dtquery = "SELECT * FROM $surveytable WHERE ".stripcslashes($_POST['sql'])." ORDER BY id";}
Expand Down Expand Up @@ -449,7 +448,7 @@

while ($dtrow = mysql_fetch_assoc($dtresult))
{
if (!$bgcc) {$bgcc="#EEEEEE";}
if (!isset($bgcc)) {$bgcc="#EEEEEE";}
else
{
if ($bgcc == "#EEEEEE") {$bgcc = "#CCCCCC";}
Expand Down
6 changes: 3 additions & 3 deletions admin/database.php
Expand Up @@ -365,15 +365,15 @@
$ccresult = mysql_query($ccquery) or die ("Couldn't get list of cqids for this answer<br />$ccquery<br />".mysql_error());
$cccount=mysql_num_rows($ccresult);
while ($ccr=mysql_fetch_array($ccresult)) {$qidarray[]=$ccr['qid'];}
if ($qidarray) {$qidlist=implode(", ", $qidarray);}
if (isset($qidarray)) {$qidlist=implode(", ", $qidarray);}
}
if ($matchcount) //another answer exists with the same code
if (isset($matchcount) && $matchcount) //another answer exists with the same code
{
echo "<script type=\"text/javascript\">\n<!--\n alert(\""._DB_FAIL_ANSWERUPDATEDUPLICATE."\")\n //-->\n</script>\n";
}
else
{
if ($cccount) // there are conditions dependent upon this answer to this question
if (isset($cccount) && $cccount) // there are conditions dependent upon this answer to this question
{
echo "<script type=\"text/javascript\">\n<!--\n alert(\""._DB_FAIL_ANSWERUPDATECONDITIONS." ($qidlist)\")\n //-->\n</script>\n";
}
Expand Down
13 changes: 6 additions & 7 deletions admin/html.php
Expand Up @@ -321,7 +321,7 @@

//SURVEY SUMMARY
if ($gid || $qid || $action=="editsurvey" || $action=="addgroup") {$showstyle="style='display: none'";}

if (!isset($showstyle)) {$showstyle="";}
$surveysummary .= "\t<tr $showstyle id='surveydetails0'><td align='right' valign='top' width='15%'>"
. "$setfont<b>"._SL_TITLE."</b></font></td>\n"
. "\t<td>$setfont<font color='#000080'><b>{$s1row['short_title']} "
Expand Down Expand Up @@ -481,6 +481,7 @@
. "\t\t</td>\n"
. "\t</tr>\n";
if ($qid) {$gshowstyle="style='display: none'";}
else {$gshowstyle="";}

$groupsummary .= "\t<tr $gshowstyle id='surveydetails20'><td width='20%' align='right'>$setfont<b>"
. _GL_TITLE."</b></font></td>\n"
Expand Down Expand Up @@ -543,10 +544,8 @@
. "\t\t\t</table>\n"
. "\t\t</td>\n"
. "\t</tr>\n";
if ($_GET['viewanswer'] || $_POST['viewanswer'])
{
$qshowstyle = "style='display: none'";
}
if (returnglobal('viewanswer')) {$qshowstyle = "style='display: none'";}
else {$qshowstyle = "";}
$questionsummary .= "\t<tr $qshowstyle id='surveydetails30'><td width='20%' align='right'>$setfont<b>"
. _QL_CODE."</b></font></td>\n"
. "\t<td>$setfont{$qrrow['title']}";
Expand Down Expand Up @@ -584,7 +583,7 @@
$qquery = "SELECT type FROM {$dbprefix}questions WHERE qid=$qid";
$qresult = mysql_query($qquery);
while ($qrow=mysql_fetch_array($qresult)) {$qtype=$qrow['type'];}
if (!$_POST['ansaction'])
if (!isset($_POST['ansaction']))
{
//check if any nulls exist. If they do, redo the sortorders
$caquery="SELECT * FROM {$dbprefix}answers WHERE qid=$qid AND sortorder is null";
Expand All @@ -595,7 +594,7 @@
fixsortorder($qid);
}
}
$vasummary .= "<table width='100%' align='center' border='0' bgcolor='#EEEEEE'>\n"
$vasummary = "<table width='100%' align='center' border='0' bgcolor='#EEEEEE'>\n"
. "<tr bgcolor='#555555'><td colspan='5'><font size='1' color='white'><b>"
. _ANSWERS."</b></td></tr>\n";
$cdquery = "SELECT * FROM {$dbprefix}answers WHERE qid=$qid ORDER BY sortorder, answer";
Expand Down
2 changes: 1 addition & 1 deletion admin/sessioncontrol.php
Expand Up @@ -43,5 +43,5 @@
$_SESSION['lang']=returnglobal('lang');
}
//CHANGE LANGUAGE IF SESSION LANG DOESN'T MATCH DEFAULT LANG
if ($_SESSION['lang']) {$defaultlang=$_SESSION['lang'];}
if (isset($_SESSION['lang'])) {$defaultlang=$_SESSION['lang'];}
?>
2 changes: 1 addition & 1 deletion admin/statistics.php
Expand Up @@ -64,7 +64,7 @@

//Select public language file
$query = "SELECT language FROM {$dbprefix}surveys WHERE sid=$sid";
$result = mysql_query($query);
$result = mysql_query($query) or die("Error selecting language: <br />".$query."<br />".mysql_error());
while ($row=mysql_fetch_array($result)) {$surveylanguage = $row['language'];}
$langdir="$publicdir/lang";
$langfilename="$langdir/$surveylanguage.lang.php";
Expand Down

0 comments on commit 43d4b82

Please sign in to comment.