Howto check consumed serial - consume date

  • Posts: 29
  • Thank you received: 0
10 years 9 months ago #142567

Hi,

i am looking for an way / howto to check and get back an date of an past consume action of an specific serial number via web request.

How is that possible?


Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
10 years 9 months ago #142637

Hi there,

I am sorry but I don't understand what you are looking for.
What do you mean by serial? What is a web request to you? A SQL query?
Please be a bit more specific and we'll try to help you :)

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 0
10 years 9 months ago #142793

Hi Eliot,

serial means an serial number, witch is used before.

I am looking for an feature like "consume serial" witch gives me more informations about an used serial, for example to check through our code that an serial is in use, the date of the first use and the name of the user... these informations are useful when the customer changes the computer on witch our software is running or the installation is damaged and the user reinstall our software packet during an started recurring period...


Thanks

Last edit: 10 years 9 months ago by mkaker.

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
10 years 9 months ago #142821

Hi,

The way to access by WebService to the serials is the "check" url, like explain in the consume tutorial page.
www.hikashop.com/support/documentation/1...onsume-features.html
The url is in this form:

index.php?option=com_hikaserial&ctrl=serial&task=check&hikaserial[serial]=YOUR_SERIAL_DATA&hikaserial[format]=xml

When you call the "check", HikaSerial will use the view "serial | check_XXX" (where XXX is html, json or xml).
You can override the views (in HikaShop > Display > Views) like any other HikaSerial views.
By overriding a "check" view, you can display the information you want about the serial. So you can display the consumption date or any other information you want.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 0
10 years 9 months ago #143090

Hi,

how can i find the List of information variables about the possible informations like consumpion date?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
10 years 9 months ago #143096

Hi,

You can display all information (columns) in the table "hikaserial_serial" and all information you will see in the HikaSerial backend (when editing/showing a serial).
It requires some PHP knowledge and development skills but you can use the existing code as base for your modification.

In your case, I think that the best will be to display the date of the last even in the serial history.
You can access it though " $this->serial->history " (it is an array with all serial history).
The last element can be access using

$last_history = end($this->serial->history);
echo hikaserial::getDate($last_history->history_created);

Don't hesitate to use a " var_dump($this->serial); " in order to see the all content of the serial and see what you can display in your overridden view.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 0
10 years 9 months ago #143548

Hi Jerome,

i try to play with "check" and i get back from "serial_assign_date" Values like this "1385204963". What date format is that? how can i parse it?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
10 years 9 months ago #143552

Hi,

The value is stored in the timestamp format.
Like I wrote in my previous post, you can use hikaserial::getDate() to format it.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 0
10 years 9 months ago #143731

Hi Jerome,

i don't use php. i need the exact date format to parse the value with DateTime.TryparseExact in net.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
10 years 9 months ago #143834

Hi,

Like I said, it is a timestamp format.
I don't know what I can say more...

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 0
10 years 9 months ago #143955

after some reading... it is an UNIX timestamp format

All a UNIX timestamp represents is the number of seconds since January 1st, 1970 12:00:00 AM. So we have to create a new System.DateTime structure, set it to 1/1/1970 12:00:00 AM, and use the AddSeconds() methods to tack on the timestamp.

  Function ConvertTimestamp(ByVal timestamp as Double) As DateTime

       Return New DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(timestamp)

    End Function

thanks

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.099 seconds
Powered by Kunena Forum