= 16) { $existing = get_data("SELECT * from {$CONFIG->dbprefix}koolielu_schools where school_id = $row_data[0]"); if ($existing) { $updated++; update_data("UPDATE {$CONFIG->dbprefix}koolielu_schools SET note = '$row_data[1]' AND branch = '$row_data[2]' AND reg_nr = '$row_data[3]' AND school_name = '$row_data[4]' AND school_type = '$row_data[5]' AND school_subtype = '$row_data[6]' AND ownership = '$row_data[7]' AND county = '$row_data[8]' AND city = '$row_data[9]' AND location = '$row_data[10]' AND address = '$row_data[11]' AND postalindex = '$row_data[12]' AND tel = '$row_data[13]' AND fax = '$row_data[14]' AND email = '$row_data[15]' AND webpage = '$row_data[16]' where school_id = $row_data[0]"); } else { $added++; insert_data("INSERT INTO {$CONFIG->dbprefix}koolielu_schools (school_id, note, branch, reg_nr, school_name, school_type, school_subtype, ownership, county, city, location, address, postalindex, tel, fax, email, webpage) VALUES ($row_data[0], '$row_data[1]', '$row_data[2]', '$row_data[3]', '$row_data[4]', '$row_data[5]', '$row_data[6]', '$row_data[7]', '$row_data[8]', '$row_data[9]', '$row_data[10]', '$row_data[11]', '$row_data[12]', '$row_data[13]', '$row_data[14]', '$row_data[15]', '$row_data[16]')"); } } } /*translation:Added: %s | Updated: %s*/ system_message(sprintf(elgg_echo("koolielu:schools_added_updated"),$added,$updated)); } else { /*translation:You have not provided a .csv file.*/ register_error(elgg_echo("koolielu:no_csv_file_provided")); } forward("pg/koolielu/mainmanage"); ?>