| @@ 353-369 (lines=17) @@ | ||
| 350 | $uploadInfo = pathinfo($_FILES['import_file']['name']); |
|
| 351 | $ext_import_file = $uploadInfo['extension']; |
|
| 352 | $users = array(); |
|
| 353 | if (in_array($ext_import_file, $allowed_file_mimetype)) { |
|
| 354 | if (strcmp($file_type, 'csv') === 0 && |
|
| 355 | $ext_import_file == $allowed_file_mimetype[0] |
|
| 356 | ) { |
|
| 357 | $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
| 358 | $errors = validate_data($users, $checkUniqueEmail); |
|
| 359 | $error_kind_file = false; |
|
| 360 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
|
| 361 | $users = parse_xml_data($_FILES['import_file']['tmp_name']); |
|
| 362 | $errors = validate_data($users, $checkUniqueEmail); |
|
| 363 | $error_kind_file = false; |
|
| 364 | } else { |
|
| 365 | $error_kind_file = true; |
|
| 366 | } |
|
| 367 | } else { |
|
| 368 | $error_kind_file = true; |
|
| 369 | } |
|
| 370 | ||
| 371 | // List user id with error. |
|
| 372 | $users_to_insert = array(); |
|
| @@ 351-366 (lines=16) @@ | ||
| 348 | $uploadInfo = pathinfo($_FILES['import_file']['name']); |
|
| 349 | $ext_import_file = $uploadInfo['extension']; |
|
| 350 | ||
| 351 | if (in_array($ext_import_file, $allowed_file_mimetype)) { |
|
| 352 | if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) { |
|
| 353 | $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
| 354 | $errors = validate_data($users); |
|
| 355 | $error_kind_file = false; |
|
| 356 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
|
| 357 | $users = parse_xml_data($_FILES['import_file']['tmp_name']); |
|
| 358 | $errors = validate_data($users); |
|
| 359 | $error_kind_file = false; |
|
| 360 | } else { |
|
| 361 | ||
| 362 | $error_kind_file = true; |
|
| 363 | } |
|
| 364 | } else { |
|
| 365 | $error_kind_file = true; |
|
| 366 | } |
|
| 367 | ||
| 368 | // List user id with error. |
|
| 369 | $users_to_insert = $user_id_error = array(); |
|
| @@ 181-195 (lines=15) @@ | ||
| 178 | ||
| 179 | $ext_import_file = substr($_FILES['import_file']['name'], (strrpos($_FILES['import_file']['name'],'.')+1)); |
|
| 180 | ||
| 181 | if (in_array($ext_import_file,$allowed_file_mimetype)) { |
|
| 182 | if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) { |
|
| 183 | $skills = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
| 184 | $errors = validate_data($skills); |
|
| 185 | $error_kind_file = false; |
|
| 186 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
|
| 187 | $skills = parse_xml_data($_FILES['import_file']['tmp_name']); |
|
| 188 | $errors = validate_data($skills); |
|
| 189 | $error_kind_file = false; |
|
| 190 | } else { |
|
| 191 | $error_kind_file = true; |
|
| 192 | } |
|
| 193 | } else { |
|
| 194 | $error_kind_file = true; |
|
| 195 | } |
|
| 196 | ||
| 197 | // List skill id with error. |
|
| 198 | $skills_to_insert = $skill_id_error = array(); |
|