FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Need for a script!





giovle
Hi there,

If been a councilmember of our local youth club for about three weeks and I'd like to develop something in order for things to run more smoothly.
They idea is that every week our clubbuilding is open (on Friday's and on Saturday's). But in order to be open, there have to be 2 bartenders. In the past there was the site's forum, where the person in charge of the building posted a message when there were no bartenders listed for the upcoming evening. Now I wanted to make a site-functionality so people can see when there are no bartenders yet, and that they can subscribe themselves to it without much fuss. Does anyone have an idea of how to get started on this. Bear in mind that I don't know (yet) how to program in php. I recently wrote a script in perl, but that can hardly be called real programming : wink : If there's someone with a good idea, post it Smile

Greetz
manav
try out begining php5 by wrox... it's cool man..
vinx_18
There are alot of books but I suggest you'll read PHP for dummies or WROX's PHP for beginners. These books teaches to build not only functional but effective and efficient web applications. Good luck!
giovle
Thanks, I'll try to get a hold of the books in our university library ... If I get stuck building the application, I'll post again here Smile
SlowWalkere
I've found the best way to learn php is to think of some kind of project you want to have completed and then go out and do it. Books are helpful, but you learn a lot more creating a useful product - like the one you're aiming at here.

There are a few ways I could think of to accomplish this goal. Here's are some ideas. Remember that it always helps to outline projects like these and sort out what you need to do... before you start coding. =)

The script is going to end up having two sides to it - a backend side where the bartenders can log in and say "I'm here!" and a frontend side where users can log on and see the status.

You'll want to store the information in a simple database. A basic table layout would include three rows - a bartender's name, a password, and his status (at the bar, or not at the bar). You could create a script to take this information from a form and put it into the database, but it would be simpler to just enter it yourself.

The rest of the back-end stuff can be handled with a single php file. At the bottom of the page, there is a form. On that form, a person can enter his bartender login, his password, and check off whether he's punching in or punching out. This form is sent back (through the action="" parameter) to the same page.

At the top of the file, there's a script to check for form input. If form input was sent, it needs to be processed. Check that the bartender's username and password match. Then, set the bartenders status to the appropriate setting - in or out.

The front end can be a short snippet of code that you can put into a bigger webpage - like the front page of your forum. This snippet should access the database, find out how many bartenders are punched in (and maybe who they are), and then create some output.

For example, you could check that two bartenders are there and then just output the statement, "The club is open!."

Good luck, and if you're looking for a book to help you get started, try Practical PHP Programming. It's free, online, and pretty thorough.

- Walkere
giovle
Hi,

thx for the elaborate post SlowWalkere! I appreciate it! But I think you may have misunderstood me (probably cause my english isn't super Laughing )

Let's try again shall we?
The main idea is to have a calendar online. A calendar where all days are visible that the club is open (that's every friday and saturday unless it's rented by an external organisation or if there's a party). So because it's open on those two days, we need to have two bartenders every night. The old system relied more on personal work (the person responsible for 'recruiting' bartenders had to phone or email people in order to know if he could find two people). As you can imagine, this is not very efficient, let alone very tiresome.

That's why I thought we should make a calendar on the site. You can subscribe as a bartender (with approval of the person responsible for the bartenders ofcourse). If you have subscribed, you should be able to see whether you have any upcoming evenings and you should be able to enlist for evenings to come. If possible all evenings that have two bartenders should be coloured green or something to show that it's ok. And if possible if someone has an upcoming evening, he/she should get a notification by email.

So the main item is a calendar. Any ideas?
phpjsfan
giovle wrote:

So the main item is a calendar. Any ideas?

Making a calender in php is not that big a deal, you probably can get the code for a basic calender by googling for it... the trick is going to be customizing the calender for your needs.
I guess you have to begin by getting the basic code and working through it thoroughly. you've to be pretty intimate with all the date functions in php... I'm just saying this 'coz you said you were new to php.

Or you could just build the calender with JS/css and use php for processing...
the work you have in mind seems a good candidate for using AJAX. well, i don't really know, but seems good to check that out too.
giovle
phpjsfan wrote:
giovle wrote:

So the main item is a calendar. Any ideas?

Making a calender in php is not that big a deal, you probably can get the code for a basic calender by googling for it... the trick is going to be customizing the calender for your needs.
I guess you have to begin by getting the basic code and working through it thoroughly. you've to be pretty intimate with all the date functions in php... I'm just saying this 'coz you said you were new to php.

Or you could just build the calender with JS/css and use php for processing...
the work you have in mind seems a good candidate for using AJAX. well, i don't really know, but seems good to check that out too.


Hi, thx ... I actually did search for a calendar script on google, but still I'm not sure whether to take such a calendar ... For the moment I'm reading my way through a book about php5 and MySQL (but it's about 1000 pages, so it's only advancing slowly Smile
gidevelop
the application is not hard to build at all. If you are a n00b at php/Mysql i suggest to try killerphp.com. That guy explains php so good that you really got to be a retard not to understand it. So i'll say try the site.. it have video tutorials. very well explained
giovle
gidevelop wrote:
the application is not hard to build at all. If you are a n00b at php/Mysql i suggest to try killerphp.com. That guy explains php so good that you really got to be a retard not to understand it. So i'll say try the site.. it have video tutorials. very well explained


This guy is really amazing Very Happy thanks for the website, it works a lot faster than my book that lies here next to me. Thanks!
giovle
Thx you guys, I managed to write a working script, that not only stores whatever is sold on a regular evening, it also stores the hour and date of the transaction and the total of goods sold. So nog I have a little more control over the bartenders.
Now I just want to do one more thing. I want to buy a fingerprint scanner to be able to make an accespoint to the program. The point is to be able to see if the bartender that opened up the club, also shuts it down, in stead of passing his job to someone else ... That's kinda prohibited Wink but anyhow, any ideas how to write such a script? preferrably in php/html too...


Thx
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.