getRow(' SELECT `id_customer`, `email`, `firstname`, `lastname` FROM `'._DB_PREFIX_.'customer` WHERE `email` = \''.pSQL($row[0]).'\''); if (!$id_referralprogram = ReferralProgramModule::isEmailExists($customer['email'], true, false)){ $referralprogram = new ReferralProgramModule(); $referralprogram->id_sponsor = (int)$id_sponsor; $referralprogram->firstname = $customer['firstname']; $referralprogram->lastname = $customer['lastname']; $referralprogram->email = $customer['email']; if (!$referralprogram->validateFields(false)) $errors[] = $customer['email']; else $referralprogram->save(); } else { $referralprogram = new ReferralProgramModule((int)$id_referralprogram); } if ($referralprogram->id_sponsor == $id_sponsor) { $referralprogram->id_customer = (int)$customer['id_customer']; $referralprogram->save(); } //$tracking->addSubscribe((int)$customer['id_customer']); } fclose($handle); } echo $errors; exit();