- Posts: 29
- Thank you received: 0
Howto check consumed serial - consume date
12 years 7 months ago #142567
by mkaker
Howto check consumed serial - consume date was created by mkaker
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
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.
12 years 7 months ago #142637
by Eliot
Replied by Eliot on topic Howto check consumed serial - consume date
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
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.
12 years 7 months ago - 12 years 7 months ago #142793
by mkaker
Replied by mkaker on topic Howto check consumed serial - consume date
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
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: 12 years 7 months ago by mkaker.
Please Log in or Create an account to join the conversation.
12 years 7 months ago #142821
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Howto check consumed serial - consume date
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:
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,
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:
Code:
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.
Please Log in or Create an account to join the conversation.
12 years 7 months ago #143090
by mkaker
Replied by mkaker on topic Howto check consumed serial - consume date
Hi,
how can i find the List of information variables about the possible informations like consumpion date?
Thanks
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.
12 years 7 months ago #143096
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Howto check consumed serial - consume date
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
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,
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
Code:
$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.
Please Log in or Create an account to join the conversation.
12 years 7 months ago #143548
by mkaker
Replied by mkaker on topic Howto check consumed serial - consume date
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
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.
12 years 7 months ago #143552
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Howto check consumed serial - consume date
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,
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.
Please Log in or Create an account to join the conversation.
12 years 7 months ago #143731
by mkaker
Replied by mkaker on topic Howto check consumed serial - consume date
Hi Jerome,
i don't use php. i need the exact date format to parse the value with DateTime.TryparseExact in net.
Thanks
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.
12 years 7 months ago #143834
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Howto check consumed serial - consume date
Hi,
Like I said, it is a timestamp format.
I don't know what I can say more...
Regards,
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.
Please Log in or Create an account to join the conversation.
12 years 7 months ago #143955
by mkaker
Replied by mkaker on topic Howto check consumed serial - consume date
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.
thanks
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.
Code:
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.242 seconds