Author Topic: Need a different type of report template to calculate fees for using music  (Read 254 times)

Olav

  • New User

  • Offline
  • *
  • 45
Hi!

We are a radiostation using RDJ and really loves it.
A new development this year is that we have to send a special formated report regarding the music we use.

The inbuild system is not giving me what I need, but using some php / mysql access, I have found what I need.

However, the is one unresolved issue.
In the history table, the duration field is of type "double(11,5)" and not in any format I can calculate back to mm:ss.

How can I do that?

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5464
    • Radio DJ Romania
Re: Need a different type of report template to calculate fees for using music
« Reply #1 on: February 02, 2019, 12:15:39 PM »
The duration stored in the database is in seconds, so you can calculate it easily.  :)
PS: you can take a look to the existing templates, they are SQL queries based, you can find them in: "C:\RadioDJv2\templates\reports"
To transform the seconds to hours, minutes and seconds, you can use the following MySQL SEC_TO_TIME() function as follows:
Code: [Select]
SELECT SEC_TO_TIME(ROUND(duration)) As 'Duration' from songs WHERE ID=x;
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

Olav

  • New User

  • Offline
  • *
  • 45
Re: Need a different type of report template to calculate fees for using music
« Reply #2 on: February 02, 2019, 01:23:15 PM »
It almost seems to easy when you put it that way :-)
Thank you for the help!

I figured that our report format would be to old-fashion to put i a software of this millenium.
They need a .txt file with one song pr line and specific amount of character positions pr field.
If this would have been done with a .csv, I would have asked to just add the "songID" field to the reports.

I am now just writing out every instance to a .txt file in a while loop alowing me to just add the need extra "spaces" to every field / line.

Again, thanks a lot for all the effort!