You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2010-02-11 14:26:11

buhralex
Member
Registered: 2009-11-17
Posts: 12

Error Messages in Reports

Hello,

i am trying to build my own report.
Once it was working good but now it produces massive problems.
I changed my reports because i had a problem with multiple softwareversions.

So i tried to find a workaround but it doesn't work.
Maybe someone here can help me smile

Here is what i've got so far:
<code>
$query = "SELECT glpi_software.name AS Software,
        glpi_softwareversions.name AS Version,
        glpi_softwarelicenses.name AS Lizenz,
        glpi_softwarelicenses.number AS Anzahl,
        glpi_dropdown_licensetypes.name AS Typ,
        glpi_infocoms.value AS Kosten,
    FORMAT((glpi_infocoms.value * glpi_softwarelicenses.number), 2) AS 'Einkaufskosten Gesamt',
        glpi_infocoms.buy_date AS Kaufdatum,
        glpi_softwarelicenses.expire AS Ablaufdatum,
        DATEDIFF(glpi_softwarelicenses.expire, CURDATE()) AS UebrigeTage,
        glpi_dropdown_budget.name
        from glpi_software
        INNER JOIN glpi_softwareversions ON glpi_software.ID = glpi_softwareversions.sID
        INNER JOIN glpi_softwarelicenses ON glpi_softwareversions.sID = glpi_softwarelicenses.sID
        INNER JOIN glpi_dropdown_licensetypes ON glpi_softwarelicenses.type = glpi_dropdown_licensetypes.ID
        INNER JOIN glpi_infocoms ON glpi_softwarelicenses.ID = glpi_infocoms.FK_device
        INNER JOIN glpi_dropdown_budget ON glpi_infocoms.budget = glpi_dropdown_budget.ID",
$query .= "WHERE glpi_softwareversions.name = glpi_softwarelicenses.name",
$query .= "WHERE glpi_softwareversions.name != Office",
</code>

But if i start the report it only displays these error messages:
<code>
PHP ERROR: Invalid argument supplied for foreach() in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 237
PHP ERROR: Undefined variable: colsname in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 268
PHP ERROR: Invalid argument supplied for foreach() in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 268
PHP ERROR: Undefined variable: colsname in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 268
PHP ERROR: Invalid argument supplied for foreach() in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 268
PHP ERROR: Undefined variable: colsname in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 268
PHP ERROR: Invalid argument supplied for foreach() in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 268
PHP ERROR: Undefined variable: colsname in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 268
PHP ERROR: Invalid argument supplied for foreach() in C:\xampp\xampp\htdocs\glpi\plugins\reports\inc\plugin_reports.autoreport.class.php at line 268
</code>

How can i make this work?

Im from Germany and my english isn't the best so if anyone who speaks german is here please help me! I can describe my problem better in german

Last edited by buhralex (2010-02-11 14:50:43)

Offline

#2 2010-02-12 13:52:02

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: Error Messages in Reports

Version of GLPI ?

In your query, you can't have 2 WHERE
WHERE glpi_softwareversions.name = glpi_softwarelicenses.name",
   AND glpi_softwareversions.name != Office";

and the end of a SQL query is a ;


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

Board footer

Powered by FluxBB