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

index a0fb9fd1147692b05aabe55dea7e616157fdc377..e3a564ce21f03c3539406655d3252611cb3ebdc2 100644 (file)
@@ -1111,7 +1111,7 @@ html.tall{height:150%}' . "\n";
             $forceTheme = $ee[1];
             $book_id = $ee[0];
         }
-        if (isset($_GET['theme']) && $_GET['theme']!=='') {
+        if (isset($_GET['theme']) && $_GET['theme'] !== '') {
             $forceTheme = CubeIT_Util_Json::decode($_GET['theme'], true);
         }
 
@@ -1261,7 +1261,7 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
             $id .= '-' . $forceThemeId;
         }
 
-        if(!$forceTheme) {
+        if (!$forceTheme) {
             self::logReferer($book_id);
         }
         $htmlFile = WS_BOOKS . '/html5' . $dir . '/' . $id . '/index' . $version . '.html';
@@ -1313,6 +1313,29 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
         wsStats::exportXLS($bid, $annee, $mois);
     }
 
+    public static function yslReport($args)
+    {
+        global $core;
+
+        $bid = $args[1];
+        $xls = new PHPExcel();
+        $writer = new PHPExcel_Writer_Excel2007();
+        $writer->setPHPExcel($xls);
+        $tmp = sys_get_temp_dir() . '/ysl_survey_' . time() . '.xlsx';
+        $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");
+        $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);
+
+        files::$mimeType['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
+        cubeHTTP::downloadFile($tmp, 'ysl_survey_' . $bid . '.xlsx');
+    }
+
     public static function chooseExistingBook()
     {
         wsDroits::creation(true);