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 2008-04-01 00:50:43

djjassen
Member
Registered: 2008-01-29
Posts: 37

Help Please ..

I know this is probably a very out there request and some may not understand what I am trying to do but here goes anyway.

We currently use Entities to represent our companies. We are a shared resource for 6 companies. We use the activity plugin in the root entity to log all of our activities and then transfer them to the correct company/entity to record the time against that company. We find this way quicker than changing entities to log the activities.

I then produce some reports for my boss to show a full timesheet for the week broken down by day and then by company too. Pretty simple realy in Crystal Reports with ODBC.

I want to produce this in php and am completely stuck on producing a php crosstab. 

Is there anyone here with that knowledge who is willing to help or at least point me to a web site that has this onfo on?

Thanks in advance.

Jassen

Offline

#2 2008-04-01 13:13:09

JMD
GLPI - Lead
Registered: 2004-09-13
Posts: 9,180
Website

Re: Help Please ..

Could you precise your needs ? (php, sql ?)

What is exactly your problem, what did you try ? where are you blocked ?


JMD / Jean-Mathieu Doléans - Glpi-project.org - Association Indepnet
Apportez votre pierre au  projet GLPI   : Soutenir

Offline

#3 2008-04-01 22:59:21

djjassen
Member
Registered: 2008-01-29
Posts: 37

Re: Help Please ..

I can get all the data I want out of the activity plugin using this ...

SELECT
  glpi_dropdown_plugin_activity_type.name,
  SUM(glpi_plugin_activity.realtime) AS Total,
  glpi_plugin_activity.begin_date,
  glpi_users.realname
FROM
  glpi_plugin_activity
  INNER JOIN glpi_users ON (glpi_plugin_activity.tech_num = glpi_users.ID)
  INNER JOIN glpi_dropdown_plugin_activity_type ON (glpi_plugin_activity.`type` = glpi_dropdown_plugin_activity_type.ID)
WHERE
  (glpi_plugin_activity.tech_num = ??)
GROUP BY
  glpi_dropdown_plugin_activity_type.name

I then want to produce a report that has the dates along the top row accroding to what is selected in date1 and date2 from the selction form in http://ibis/helpdesk/plugins/activity/front/plugin_activity.report_per_user.php
with the activity.type as the colum on the left with the realtime sum running across the rows per day.

Does this make sense?

I do not know how to code the crosstab and need help doing so.

Thanks

Jassen

Offline

#4 2008-04-08 16:00:38

chris g
Member
From: Kent, UK
Registered: 2008-02-21
Posts: 85

Re: Help Please ..

Try having a look at this tutorial - I found it very helpful...

MySQL Wizardry
http://dev.mysql.com/tech-resources/art … index.html

It is quite long, but I often refer back to it as it explains things, not just tell you how to do it.

Hope that it helps you.


GLPI 0.78.1 ... but planning to upgrade soon!

Offline

Board footer

Powered by FluxBB