results in CSV

2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 24, 2013   (RSS)

By Toledoh - July 23, 2013

Hi Guys,

I was looking at http://www.interactivetools.com/forum/forum-posts.php?postNum=2208599#post2208599 and wondering if it would be possible to set up a "report" which is basically a table - then send it as a csv attachment? Or a "click here to download as CSV"

$recordNum = mysql_insert_id();

// display thanks message and clear form
$alertsAndErrors = "Thanks, we've added that record!";
$csv = '';
$csv .= implode(', ', array_map('##list of field names##)) . "\n";
$csv .= implode(', ', array_map('_csvExport_escapeAsCSV', ##list of records##)) . "\n";

sendMessage(array(
'from' => "email@domain.id.au",
'to' => "email@domain.id.au",
'subject' => "Application Form",
'text' => "Text message content",
'attachments' => array(
'form.csv' => $csv
)
));
}

Cheers,

Tim (toledoh.com.au)