예제 #1
0
 // Get parts of the birth date (so we can hide the year, if necessary)
 $bdate = strtotime($m->Birthday);
 $month = date("F", $bdate);
 $day = date("j", $bdate);
 $mm = date("m", $bdate);
 $dd = date("d", $bdate);
 $yyyy = date("Y", $bdate);
 // Prepare the member's last activity info in case we need to provide it
 $regDate = strtotime($m->RegistrationDate());
 $lastUpdated = strtotime($m->LastUpdated());
 $lastActivity = strtotime($m->LastActivity());
 // Add fields in the same order as the first line. Very important!
 $csv->AddValue($m->FirstName);
 $csv->AddValue($m->MiddleName);
 $csv->AddValue($m->LastName);
 $csv->AddValue(Gender::Render($m->Gender));
 $csv->AddValue($m->ResidenceString());
 $csv->AddValue(!$m->HidePhone || $allPhones ? formatPhoneForDisplay($m->PhoneNumber) : "");
 if ($allEmails) {
     $csv->AddValue($m->Email);
 }
 if ($allBdays) {
     $csv->AddValue("{$mm}-{$dd}-{$yyyy}");
 } else {
     $csv->AddValue(!$m->HideBirthday ? "{$month} {$day}" : '');
 }
 // doesn't work as well in contact importers. oh well.
 if ($showActivityInfo) {
     $csv->AddValue($regDate > 0 ? date("Y-m-d", $regDate) : "");
     $csv->AddValue($lastUpdated > 0 ? date("Y-m-d", $lastUpdated) : "");
     $csv->AddValue($lastActivity > 0 ? date("Y-m-d", $lastActivity) : "");