Auto ID number

  • okkhalid
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 3 days ago #79042 by okkhalid
Auto ID number was created by okkhalid
Hello,

I'm using the event booking to manage school course registration, so basically, when student register for a course he will require to create a profile with username and email. then register for the course.

So I have the eventbooking registration is integrated with joomla.

Now I need to create an auto unique with 6 digits number when any student register into the system he will be assigned a number that will be act as student number "ID".

Please can you help me to do this or guide me.

Thank you.

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

  • okkhalid
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 2 days ago #79048 by okkhalid
Replied by okkhalid on topic Auto ID number
Hi, any idea ?

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

More
10 years 2 days ago #79053 by James Riley
Replied by James Riley on topic Auto ID number
I've done something similar, but it's kind of a "hack" solution (and potential site safety problems).

1) If you create the custom field, and then edit it's default value code via a mySQL editor, you can insert javascript code that to generate a random number. You could also change the ACL permissions to allow you to save javascript directly within the EB Custom Fields editor rather than messing around at a database level. You need to be careful when working at a database level -- mistakes can really mess up your site. Then again, modifying your ACL to permit saving of javascript can be a huge security issue.

2) I've also injected javascript into fields using a "custom html advanced" module ( link to JED ), set to load with EB, with code that fills a field. Like with modifying the ACL, the Custom HTML Advances module can also pose a security threat because it allows direct code injection (not only javascript but also php).

Both these are javascript solutions. If someone has js turned off (although most websites are pretty dependant on it these days), then your code will not run.

3) I'm not sure if nonumber's "Sourcer" plugin ( link to JED ) will work within EB, but if it does, you could use it to run php code within the default value box of your custom field. Again, Sourcer creates a potential security risk for code execution.

4) SAFEST IDEA (if it can be make to work???): You could create a custom EB "SQL field" to look up values on an SQL table that can then be assigned to the registrant (see eventbookingdoc.joomservices.com/basic-s...m-fields/field-types ). How you would select the number and/or prevent duplicate number assignment, I don't know (I'm pretty weak when it comes to SQL).

5) Of course, code modification is always a possibility too, but then you will need to maintain the modification when you upgrade EB.

@Tuan -- do you have any better ideas?

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

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

More
10 years 2 days ago #79057 by FrankM
Replied by FrankM on topic Auto ID number
Why not use joomla user id ?

Productiv: Joomla 3.5.1 / EB 2.4.3 / PHP 7.0.5
Testsys: Joomla 3.5.1 / EB 2.4.3 / PHP 7.0.5

Sorry, english isn't my native language.

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

  • okkhalid
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 1 day ago #79109 by okkhalid
Replied by okkhalid on topic Auto ID number
I'm think to create joomla user id, but its only #111
3 digits #.

Any idea how to change the joomla user id to start with 6 digits # 000001
and then it will increase as auto increase?

Thanks,

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

More
10 years 1 day ago #79110 by FrankM
Replied by FrankM on topic Auto ID number
SQL-Code:
Code:
ALTER TABLE `__users` AUTO_INCREMENT=100001

But, I don't know if that's a good idea :whistle:

Productiv: Joomla 3.5.1 / EB 2.4.3 / PHP 7.0.5
Testsys: Joomla 3.5.1 / EB 2.4.3 / PHP 7.0.5

Sorry, english isn't my native language.

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

More
9 years 3 months ago #91013 by Marko
Replied by Marko on topic Auto ID number
hi, I have need for automatic assignment of ID number od property or REF. (As you call them)

THANK YOU
;)

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

More
9 years 3 months ago #91137 by Marko
Replied by Marko on topic Auto ID number
Hello, i find this.

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

Moderators: Tuan Pham Ngoc