diff --git a/admin/import.php b/admin/import.php index edd02eec..e2989d00 100644 --- a/admin/import.php +++ b/admin/import.php @@ -1,129 +1,158 @@ - - * @copyright Deakin University 2007,2008 - * @package queXS - * @subpackage admin - * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility - * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 - * - */ - -/** - * Configuration file - */ -include ("../config.inc.php"); - -/** - * XHTML functions - */ -include ("../functions/functions.xhtml.php"); - -/** - * Sample import functions - */ -include("../functions/functions.import.php"); - - -if (isset($_POST['import_form'])) -{ - //form has been submitted - xhtml_head(T_("Import: Validating and uploading")); - - //verify each GET field is unique (except import_form) - $sfields = array(); - foreach($_POST as $getv => $val) - //clean up? - $sfields[$getv] = $val; - - $error = verify_fields($sfields); - - $description = $_POST['description']; - - if ($error == "") - { //verified so upload - if (import_file($_POST['filename'],$description,$sfields)) - { - print "
" . T_("Successfully imported file") . "
"; - } - else - { - print "" . T_("Error importing file. Please try again") . "
"; - } - } - else - print "" . T_("Error:") . " $error
" . T_("Please go back in your browser and fix the problem") . "
"; - - //verifiy that exactly one primary phone number is selected - //upload to database - - xhtml_foot(); - -} -else if (isset($_POST['import_file'])) -{ - //file has been submitted - - xhtml_head(T_("Import: Select columns to import")); - ?> - - - - - - - + " . T_("Go back") . ""; + + + //verify each GET field is unique (except import_form) + $sfields = array(); + foreach($_POST as $getv => $val) + //clean up? + $sfields[$getv] = $val; + + $error = verify_fields($sfields); + + $description = $_POST['description']; + + if ($error == "") + { //verified so upload + if (import_file($_POST['filename'],$description,$sfields)) + { + print "" . T_("Successfully imported sample") . "
" . T_("Error importing file. Please try again") . "
" . T_("Error:") . " $error
" . T_("Please go back in your browser and fix the problem") . "