diff --git a/admin/dataentry.php b/admin/dataentry.php index 203d08fdb4b..e7a7e8808d5 100644 --- a/admin/dataentry.php +++ b/admin/dataentry.php @@ -90,8 +90,9 @@ { $query = "SELECT language FROM {$dbprefix}surveys WHERE sid=$sid"; $result = mysql_query($query); + if (!isset($tpldir)) {$tpldir=$publicdir."/templates";} while ($row=mysql_fetch_array($result)) {$surveylanguage = $row['language'];} - if (!$templatedir) {$thistpl=$tpldir."/default";} else {$thistpl=$tpldir."/$templatedir";} + if (!isset($templatedir) || !$templatedir) {$thistpl=$tpldir."/default";} else {$thistpl=$tpldir."/$templatedir";} if (!is_dir($thistpl)) {$thistpl=$tpldir."/default";} $langdir="$publicdir/lang"; $langfilename="$langdir/$surveylanguage.lang.php"; @@ -277,12 +278,11 @@ elseif ($action == "edit") { - echo "\n" ."\t\n" - .$surveyheader - .$surveyoptions + ._BROWSERESPONSES."\n"; + if (isset($surveyheader)) {echo $surveyheader;} + echo $surveyoptions ."
" - ._BROWSERESPONSES."
\n" ."
\n"; @@ -356,7 +356,9 @@ } else { + if (!isset($fnrrow)) {$fnrrow=array("code"=>"", "answer"=>"");} $fnames[] = array("$field", "$ftitle", "{$fnrow['question']}", "{$fnrow['type']}", "$field", "{$fnrrow['code']}", "{$fnrrow['answer']}", "{$fnrow['qid']}", "{$fnrow['lid']}"); + //$fnames[] = array("$field", "$ftitle", "{$fnrow['question']}", "{$fnrow['type']}", "$field", "", "", "", ""); } //$fnames[] = array("$field", "$ftitle", "{$fnrow['question']}", "{$fnrow['type']}"); //echo "$field | $ftitle | $fquestion
\n"; @@ -366,7 +368,11 @@ foreach ($fnames as $fnm) { - echo "\n"; + echo "\n"; } //SHOW INDIVIDUAL RECORD @@ -624,7 +630,7 @@ case "M": //MULTIPLE OPTIONS checkbox while ($fnames[$i][3] == "M") { - $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i])); + $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i][0])); //echo substr($fnames[$i][0], strlen($fnames[$i][0])-5, 5)."
\n"; if (substr($fnames[$i][0], -5) == "other") { @@ -710,7 +716,7 @@ $thisqid=$fnames[$i][7]; while ($fnames[$i][7] == $thisqid) { - $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i])); + $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i][0])); echo "\t\n" ."\t\t$setfont{$fnames[$i][6]}\n" ."\t\t$setfont\n"; @@ -732,7 +738,7 @@ $thisqid=$fnames[$i][7]; while ($fnames[$i][7] == $thisqid) { - $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i])); + $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i][0])); echo "\t\n" ."\t\t$setfont{$fnames[$i][6]}\n" ."\t\t$setfont\n"; @@ -754,7 +760,7 @@ $thisqid=$fnames[$i][7]; while ($fnames[$i][7] == $thisqid) { - $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i])); + $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i][0])); echo "\t\n" ."\t\t$setfont{$fnames[$i][6]}\n" ."\t\t$setfont\n" @@ -779,7 +785,7 @@ $thisqid=$fnames[$i][7]; while ($fnames[$i][7] == $thisqid) { - $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i])); + $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i][0])); echo "\t\n" ."\t\t$setfont{$fnames[$i][6]}\n" ."\t\t$setfont\n" @@ -804,7 +810,7 @@ $thisqid=$fnames[$i][7]; while ($fnames[$i][7] == $thisqid) { - $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i])); + $fieldn = substr($fnames[$i][0], 0, strlen($fnames[$i][0])); echo "\t\n" ."\t\t$setfont{$fnames[$i][6]}\n"; $fquery = "SELECT * FROM {$dbprefix}labels WHERE lid='{$fnames[$i][8]}'";