PHP/Mysql Hajj Lotter system (Picking Random Names)
I have a Hajj Registration system php/mysql. en. wikipedia. org/ wiki/Hajj
I have the following two tables:
1 – Applications Table
- App_id , Main_Name, mark, season
2 – Names Table
- NameID , Full_Name, ID_Number, Age, Area, App_id
Here is A sample data
Applications:
App_id=1 , Main_NameID=10, mark=3, season=5
App_id=2 , Main_ NameID =13, mark=4, season=5
App_id=3 , Main_ NameID =15, mark=3, season=5
App_id=4 , Main_ NameID =14, mark=3, season=5
App_id=5 , Main_ NameID =10, mark=1, season=5
Names:
NameID = 10, Full_Name = Ahmed, ID_Number = 15151511, Age = 65, Area = 3, App_id = 1
NameID = 11, Full_Name = Hassan, ID_Number = 22223252, Age = 70, Area = 3, App_id = 1
NameID = 12, Full_Name = Ali, ID_Number = 22223252, Age = 70, Area = 3, App_id = 1
NameID = 13, Full_Name = Salem, ID_Number = 35353232, Age = 45, Area = 3, App_id = 2
NameID = 15, Full_Name = Aysha, ID_Number = 622562262, Age = 35, Area = 3, App_id = 2
NameID = 16, Full_Name = Diana, ID_Number = 141654541, Age = 41, Area = 5, App_id = 2
NameID = 17, Full_Name = Mosa, ID_Number = 546412541, Age = 55, Area = 6, App_id = 3
And so on.
Example: I want 200 names (not 200 applications) form the aria: 3
I want to choose Random Applications along with Names, I want the priority to be for Application Mark.
When I choose the Aria (the query = select * from names n, applications app where n.area=3 and [login to view URL] = [login to view URL] and app.season=5)
The application with high Mark has high opportunity to win than the lowest Mark.
The lottery system should go through all applications based on the Mark.
For example:
application with 1 Mark , the lottery system will pass one time over it.
Application with: 3 marks , the lottery system will pass 3 times.
And so on.
Any application wins will be excluded from the lottery in the next round.
--------
the interface should be Complete Ajax/Jquery
I have the Aria in Dropdown list:
I will choose the desired Area and hit the Go button. The Lottery should Start and view Main application name in Big letter, and under it the reset of attached Names (with no page forward - Ajax).
And on the next random application the same: I choose the area then hit go: the main application name must be displayed in big letter, and under it the rest to the same applications names.
--------
Note: there is a big difference between picking 200 names and picking 200 applications.
200 names are truly 200 names, but 200 applications are 200 names and their followers to attached names. So be careful.
Please have a look at the attached image.
If you need extra information please let me know,
regards