Skip to content

Instantly share code, notes, and snippets.

@ChrisFrench
Created June 6, 2014 22:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisFrench/fb106f3c6e460ec34899 to your computer and use it in GitHub Desktop.
Save ChrisFrench/fb106f3c6e460ec34899 to your computer and use it in GitHub Desktop.
public function doCSV() {
$list = (new \Dash\Site\Models\Event\Tags)->populateState()->setCondition('attendee.id', array('$exists' => false))->setCondition('ticket.id', array('$exists' => false))->setCondition('sysgentag',1)->getItems();
$fp = fopen('php://output', 'w');
header('Content-Type: application/excel');
header('Content-Disposition: attachment; filename="emptytags.csv"');
$fp = fopen('php://output', 'w');
foreach ($list as $tag) {
$array[0] = 'http://ryst.cc/b/'.$tag->tagid;
fputcsv($fp, $array);
}
fclose($fp);
die();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment