- $i = 0;
- foreach ($value as &$job) {
- if ($job['email'] == "new@new.new") {
- $job['email'] = $job['email_new'];
- }
-
- XDB::execute("INSERT INTO entreprises (uid, entrid, entreprise, secteur, ss_secteur,
- fonction, poste, adr1, adr2, adr3, postcode,
- city, cityid, country, region, regiontxt,
- email, web,
- pub, adr_pub, email_pub, flags,
- glat, glng)
- VALUES ({?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?}, {?},
- {?}, {?},
- {?}, {?}, {?}, {?},
- {?}, {?})",
- S::i('uid'), $i, $job['name'], $job['secteur'], $job['ss_secteur'],
- $job['fonction'], $job['poste'], $job['adr']['adr1'], $job['adr']['adr2'], $job['adr']['adr3'],
- $job['adr']['postcode'],
- $job['adr']['city'], $job['adr']['cityid'], $job['adr']['country'], $job['adr']['region'],
- $job['adr']['regiontxt'],
- $job['email'], $job['web'],
- $job['pub'], $job['adr']['pub'], $job['email_pub'],
- $job['adr']['checked'] ? 'geoloc' : '', $job['adr']['precise_lat'],
- $job['adr']['precise_lon']);
- if ($job['tel'] != '') {
- XDB::execute("INSERT INTO telephone (uid, link_type, link_id, tel_id,
- tel_type, search_tel, display_tel, pub)
- VALUES ({?}, 'pro', {?}, 0,
- 'fixed', {?}, {?}, {?})",
- S::i('uid'), $i, format_phone_number($job['tel']), $job['tel'], $job['tel_pub']);
- }
- if ($job['fax'] != '') {
- XDB::execute("INSERT INTO telephone (uid, link_type, link_id, tel_id,
- tel_type, search_tel, display_tel, pub)
- VALUES ({?}, 'pro', {?}, 1,
- 'fax', {?}, {?}, {?})",
- S::i('uid'), $i, format_phone_number($job['fax']), $job['fax'], $job['tel_pub']);