phpScheduleIt
May 18, 2013, 06:43:24 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: phpScheduleIt 2.4.2 has been released!
Home
Help
Login
Register
phpScheduleIt
>
Development
>
phpScheduleIt 2.0
>
How is reference_number generated
Pages: [
1
]
« previous
next »
Print
Author
Topic: How is reference_number generated (Read 1524 times)
Photovor
Newbie
Karma: 0
Posts: 1
How is reference_number generated
«
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: 5403
Re: How is reference_number generated
«
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
Re: How is reference_number generated
«
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
Re: How is reference_number generated
«
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: 5403
Re: How is reference_number generated
«
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
Re: How is reference_number generated
«
Reply #5 on:
September 11, 2012, 04:02:24 AM »
Quote from: Nick on August 06, 2012, 02:11:55 PM
When an admin exports reservations as CSV you get the reference number.
Nick, ... thanks for the reply.
Logged
hglezq
Newbie
Karma: 0
Posts: 4
Re: How is reference_number generated
«
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: 5403
Re: How is reference_number generated
«
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
Re: How is reference_number generated
«
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: 5403
Re: How is reference_number generated
«
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
Re: How is reference_number generated
«
Reply #10 on:
September 26, 2012, 03:43:58 PM »
Thank u so much
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> Announcements
=> Open Discussion
=> Donations
-----------------------------
Help and Support
-----------------------------
=> phpScheduleIt 2.x
=> Español
=> phpScheduleIt 1.2.x
=> phpScheduleIt 1.1.x
=> New Features and Suggestions
=> Developers
-----------------------------
Bugs
-----------------------------
=> phpScheduleIt 1.2.x
=> phpScheduleIt 1.1.x
-----------------------------
Modifications
-----------------------------
=> Post Modifications
=> Request Modification
-----------------------------
Development
-----------------------------
=> phpScheduleIt 2.0
-----------------------------
Off-Topic
-----------------------------
=> Non-phpScheduleIt Discussion
Loading...