phpScheduleIt
May 24, 2013, 07:36:23 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: How is reference_number generated  (Read 1544 times)
Photovor
Newbie
*

Karma: 0
Posts: 1


« on: May 22, 2012, 04:25:31 PM »

Hi, I have a case where I want to manually create a reservation through another script. I was curious as to how the reference_number in the reservation_instances table is generated. Could you please shed light on that process?

Thanks!
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: May 29, 2012, 02:05:21 PM »

It's simply using uniqid(). You can change it on line 140 of /Domain/Reservation.php
Logged
bobbyliew
Newbie
*

Karma: 0
Posts: 4


« Reply #2 on: July 31, 2012, 12:05:10 AM »

Nick,

TQ for the guide, and product. May I know, except uniqid(), any other tools can generate number only? because I want to integrate with the machine to unlock the door. Please guide.

Thanks again.
Logged
bobbyliew
Newbie
*

Karma: 0
Posts: 4


« Reply #3 on: July 31, 2012, 12:09:19 AM »

and, may I know, how can I export the reference number to external programme? thanks.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #4 on: August 06, 2012, 02:11:55 PM »

When an admin exports reservations as CSV you get the reference number.
Logged
bobbyliew
Newbie
*

Karma: 0
Posts: 4


« Reply #5 on: September 11, 2012, 04:02:24 AM »

When an admin exports reservations as CSV you get the reference number.


Nick, ... thanks for the reply.
Logged
hglezq
Newbie
*

Karma: 0
Posts: 4


« Reply #6 on: September 18, 2012, 05:56:55 PM »

Hey Nick.

I need the reference to be consecutive numbers instead of uniqid. Is there any chance to make this happen?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #7 on: September 18, 2012, 10:16:20 PM »

If you're comfortable with PHP, you can do this pretty easily. Just let me know if you need more info.
Logged
hglezq
Newbie
*

Karma: 0
Posts: 4


« Reply #8 on: September 21, 2012, 03:03:06 PM »

I haven´t enough experiencie in php code.

Could you please tell me what it´s the method?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #9 on: September 25, 2012, 01:46:15 PM »

I unfortunately don't have the time to post the full code. You'll need to change line 140 of Domain/Reservation.php to be something like:

$this->SetReferenceNumber(ReferenceNumberGenerator::Next());

Your implementation of ReferenceNumberGenerator will need to pull the next sequential number from a database or something.

Alternatively, if the numbers don't need to be sequential, but simply incremental and numeric, you can just use the date formatted as year month date hour minute second millisecond or a timestamp.
Logged
hglezq
Newbie
*

Karma: 0
Posts: 4


« Reply #10 on: September 26, 2012, 03:43:58 PM »

Thank u so much Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!