]> _ Git - cubeextranet.git/commitdiff
wip #4620 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 26 Jul 2021 09:21:23 +0000 (09:21 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 26 Jul 2021 09:21:23 +0000 (09:21 +0000)
inc/ws/Controlleur/class.ws.url.php

index e3a564ce21f03c3539406655d3252611cb3ebdc2..09db6fb46f3b24e72f111a46e038ed52837e2d0e 100644 (file)
@@ -1316,7 +1316,7 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
     public static function yslReport($args)
     {
         global $core;
-
+        require_once 'PHPExcel/PHPExcel.php';
         $bid = $args[1];
         $xls = new PHPExcel();
         $writer = new PHPExcel_Writer_Excel2007();
@@ -1325,12 +1325,15 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
         $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');