" . 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") . " 

$description

"; } else { print -"

" . T_("Error importing file. Please try again") . "

"; } } else print "

" . T_("Error:") . " $error

" . T_("Please check imported file, go back in your browser and fix the problem") . "

"; //verifiy that exactly one primary phone number is selected //upload to database xhtml_foot($js_foot); } else if (isset($_POST['import_file'])) { //file has been submitted $subtitle = T_("Select columns to import"); xhtml_head(T_("Import sample") . ":",true,$css,$js_head,false,false,false,$subtitle); echo " " . T_("Go back") . ""; print "
"; $tmpfname = tempnam(TEMPORARY_DIRECTORY, "FOO"); move_uploaded_file($_FILES['file']['tmp_name'],$tmpfname); display_table(get_first_row($tmpfname)); ?>
 " . T_("Go back") . ""; $ua = $_SERVER['HTTP_USER_AGENT']; if (preg_match('/Firefox/i', $ua)) $csv= "text/csv"; else $csv= ".csv"; //print "ua=" . $_SERVER['HTTP_USER_AGENT']; ?>
" type="file" accept="" />
" class="form-control">