bug fix for #3879

1)There were a few global variables that were declared wrongly like ldi_enclosed,ldi_terminated which should have been csv_enclosed,csv_terminated etc. They came from $_POST. so just ran a loop and set them in $GLOBALS

2)proper import_type was passed

3)global $table and $db was declared in doImport()

and csv_local_option was set to true in case the file is from $_FILES(RFC plz, regarding this, I will try to make adequate changes)