public static function yslReport($args)
{
global $core;
-
+ require_once 'PHPExcel/PHPExcel.php';
$bid = $args[1];
$xls = new PHPExcel();
$writer = new PHPExcel_Writer_Excel2007();
$writer->save($tmp);
$head = ['Date', 'Page', 'Rating', 'Country', 'Function', 'Suggestions'];
- $r = $core->con->select("SELECT * FROM ysl_survey WHERE fluidbook_id='" . $core->con->escape($bid) . "' ORDER BY data ASC");
+ $sql = "SELECT * FROM ysl_survey WHERE fluidbook_id='" . $core->con->escape($bid) . "' ORDER BY date ASC";
+
+ $r = $core->con->select($sql);
$data = [];
while ($r->fetch()) {
$data[] = [date('Y-m-d H:i:s', $r->date), $r->page, $r->rating, $r->country, $r->function, $r->suggestions];
}
- CubeIT_Excel::simple('Survey date', $data, $head, $tmp, 100);
+
+ CubeIT_Excel::simple('Survey data #'.$bid, $data, $head, $tmp, 100);
files::$mimeType['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
cubeHTTP::downloadFile($tmp, 'ysl_survey_' . $bid . '.xlsx');