Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Internationlisation of vvexport/vvimport
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1201 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Sep 20, 2004
1 parent 0a22375 commit afae046
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
12 changes: 12 additions & 0 deletions admin/lang/english/messages.php
Expand Up @@ -705,4 +705,16 @@
define("_SV_REMIND", "Remind");
define("_SV_EDIT", "Edit");

//VVEXPORT/IMPORT
define("_VV_IMPORTFILE", "Import a VV survey file");
define("_VV_EXPORTFILE", "Export a VV survey file");
define("_VV_FILE", "File:");
define("_VV_SURVEYID", "Survey ID:");
define("_VV_EXCLUDEID", "Exclude record IDs?");
define("_VV_DONOTREFRESH", "Important Note:<br />Do NOT refresh this page, as this will import the file again and produce duplicates");
define("_VV_IMPORTNUMBER", "Total records imported:");
define("_VV_ENTRYFAILED", "Import Failed on Record");
define("_VV_BECAUSE", "because");
define("_VV_EXPORTDEACTIVATE", "Export, then de-activate survey");
define("_VV_EXPORTONLY", "Export but leave survey active");
?>
6 changes: 3 additions & 3 deletions admin/vvexport.php
Expand Up @@ -43,7 +43,7 @@
{
echo $htmlheader;
echo "<br /><table align='center' class='outlinetable'>
<tr><th colspan='2'>VV Export</th></tr>
<tr><th colspan='2'>"._VV_EXPORTFILE."</th></tr>
<form method='post'>
<tr>
<td align='right'>"._EXPORTSURVEY.":</td>
Expand All @@ -55,8 +55,8 @@
</td>
<td>
<select name='method' $slstyle>
<option value='deactivate' selected>Export then de-activate Survey</option>
<option value='none'>Export but leave results and survey active</option>
<option value='deactivate' selected>"._VV_EXPORTDEACTIVATE."</option>
<option value='none'>"._VV_EXPORTONLY."</option>
</select>
</td>
</tr>
Expand Down
22 changes: 16 additions & 6 deletions admin/vvimport.php
Expand Up @@ -83,7 +83,7 @@
echo $htmlheader;
echo "<br /><table class='outlinetable' align='center'>
<tr><th>Upload</th></tr>
<tr><td>";
<tr><td align='center'>";
$the_full_file_path = $tempdir . "/" . $_FILES['the_file']['name'];

if (!@move_uploaded_file($_FILES['the_file']['tmp_name'], $the_full_file_path))
Expand Down Expand Up @@ -144,11 +144,13 @@
unset($fieldnames[$key]);
}
}

$importcount=0;
$recordcount=0;
foreach($bigarray as $row)
{
if (trim($row) != "")
{
$recordcount++;
$fieldvalues=explode("\t", mysql_escape_string(str_replace("\n", "", $row)), $fieldcount+1);
if (isset($donotimport)) //remove any fields which no longer exist
{
Expand All @@ -165,15 +167,23 @@

if (!$result = mysql_query($insert))
{
echo "Failed insert: <pre>$insert</pre>".mysql_error();
echo "<table align='center' class='outlintable'>
<tr><td>"._VV_ENTRYFAILED." $recordcount "._VV_BECAUSE." [".mysql_error()."]
</td></tr></table>\n";
}
else
{
$importcount++;
}

}
}

echo "<font color='green'>"._SUCCESS."</font>
File upload completed.<br /><br />
<i>Note: Do NOT refresh this page</i><br /><br />";
if ($noid == "noid")
{
echo "<br /><i><b><font color='red'>"._VV_DONOTREFRESH."</font></b></i><br /><br />";
}
echo _VV_IMPORTNUMBER." ".$importcount."<br /><br />";
echo "[<a href='browse.php?sid=$sid'>"._BROWSERESPONSES."</a>]";
echo "</td></tr></table>";
}
Expand Down

0 comments on commit afae046

Please sign in to comment.