[Q] Howto: Lunchboard?

Hi there!

I’m new here, and I am totally new to PHP coding. I have absolutely no idea about it. I have used HTML in my earlier days (12 years ago), and I’m pretty outdated on this… But I can watch a page, a code and understand it if it is presented and explained to me.

This is what I want: I’m working in an IT company as a service desk consultant. I want to create a very simple lunch board so everyone can put themself on the list on a time they wish to have lunch. Maximum two people at 11:00am, max two people at 11:30am and so on… I was thinking of using Dreamweaver for this purpose

Is there any of you that know a simple page I can learn from? Or how to start this small project of mine?

Regards

Kim

I am not sure if this can help you, But I did some looking online and found a PHP Calendar.

It has easy setup, it is free and each “user” can be set up to add events at any given time on any day. …

If each person logs in and adds their lunch as an event everyone who views the calendar will see that lunch is taken or not…

Might give it a shot…

http://www.softcomplex.com/products/php_event_calendar/

Kim,

There are several ways to go about doing this and a lot should depend on the project’s purpose. I don’t mean the what (a lunch scheduling script), but why. If the reason is primarily function, that is to say, you really need something to do this, then I would look for an existing public script to use or at least work off of. On the other hand, if the purpose is as much a learning experience with a good end use, I would look at coding it from the ground up. If the former applies, try to find something as specifically tailored to your needs as possible. If you are new to coding, working with somebody else’s code can be more than a little challenging! If you are considering the latter, here are some basic questions and tips:

The most fundamental question is do you have access to a server with php installed? You don’t specifically need php for this purpose, but since this is a php forum, we will be able to help you much more if that is what you are using.

The next question is data storage. Do you have access to a database? If so, what is it (mysql, sqlite, oracle, etc) If you don’t, does your php user have file write access (assuming php)?

When it comes to the actual project, you will want to consider:

[ul][li]User Interface - You will need to design an interface for the user to schedule breaks. How do you want them to do this? Will you use pull down menus (selects), check-boxes, radio-buttons, etc. Will you want a popup calendar? If so, most of them use javascript and this will be an additional layer of learning and problems.[/li]
[li]Output - How do you want to display the non-interface components of the script? Do you want to have a list of times? A full calendar view? Etc.[/li][li]Functions - You know that you need to be able to let people schedule a lunch, but are there other functions you will need? Do you need a login feature so that users can only schedule themselves? What if someone schedules a time and then needs to change it? What other features or functions will you need?[/li][li]Rules - You have largely defined this already, but what are the rules for each function that the program will use to perform its purpose? One time period per person per day, no more than two people in any period. Only an administrator can make changes, etc.[/li][li]Roles - Do you need to assign roles to individuals such as user, administrator, etc.[/li][/ul]

Very few people will attempt to build something like this in its entirety. Generally, you would build it in pieces and add features once the basics are working. In this case, you will want to establish priorities to each component and build them in order of importance. You might start by using a very simple form input and then implement a fancier popup calendar after everything is working.

You mentioned using Dreamweaver. I have Dreamweaver (it came with my Adobe CS bundle), but I personally never use it. I tried when I was first learning html and php, but I truly feel it interfered in my growth and comprehension. I am a big fan of using a simple text-editor or at most, a specialized editor that uses color highlighting to make reading the code easier. I have seen developers that could not produce a simple, usable page without their special applications (read tools). That doesn’t mean it is wrong to use Dreamweaver, or some other equivalent, but be careful not to make it a crutch. Also be aware that these programs almost never produce source code that is as clean as what you can produce on your own with some knowledge and experience.

Hopefully this will help you determine the next step to take. If we can be of help in the process, please feel free to post any questions you have. One thing about this or any other forum: there are good developers with too little confidence and bad developers with too much! Take the time to understand any advice that you are offered and don’t assume that all of it is sound!

Best,

jay

I must say there were a lot of good advice here! Both of you, thanks! I will look at the online calendar later today. It seemed like a good idea…

Malasho: I think everyone here has a file write access to theese servers. Everyone on firstline service desk has admin accounts to our servers, and we have theese kind of servers at our workplace (mysql, sqlite, oracle, etc)… The main reason for me to create this: We are very few people at helpdesk. If everyone leaves for 11.00am lunch, there will be none on the helpdesk phone. We need to have a simple calendar/lunchboard which we can use to fill up the slots

We don’t need anyone to have admin access or anything complicated. However they should only be able to choose once. Once they have chosen their lunch time they are not able to move it. Only I as an admin should be able to remove his or her name on the list. I also tried Dreamweaver once and I too found it to mess up with my clean HTML scripts at that time :slight_smile: So I guess you’re right about rather go for raw coding instead of a hosting program… I came up with this lunchboard idea to the staff here, and they assigned me this task

In that case, I would definitely checkout existing options such as the one that rltamm suggested. I am sure that you will find something that is able to do what you are looking for - no sense recreating the wheel! Please let us know if you have any implementation questions or are unable to find a suitable script.

Best of luck to you!

Thanks alot! If you have any other existing options other than calendar, I would be glad to hear about that too! :slight_smile: Also, what kind of text editor do you use? You mentioned an editor that colors certain words and scripts

I either use my cpanel’s code editor, xcode (for Mac), or a plain text editor (either windows notepad or mac textedit). I admit I do like a little coloring, but I like it to be applied very sparingly.

One habit I have developed as a result of this is that I style my code differently than most. I almost never collaborate with other developers, so I am pretty free to do whatever I want. I use a lot of indenting (with spaces, not tabs!), and I line break around logical groupings.

As an example, most php programmers will do something like:[php]if(x==y) {
do something;
do something else;}[/php]

I typically will write my code like:[php]if(x==y)
{
do something;
do something else;
}[/php]

With one function it isn’t really a big deal, but nest four or five ifs, whiles, etc. inside of each, some inside the other, some not, and it is a huge pain to visually identify a missing bracket or which one this stray bracket goes with. By keeping matching brackets in the same column (spaced over the same) it is much easier to follow complex code flow in just a basic editor.

One thing I am truly horrible about is commenting my code, and I think this is related to doing so much coding “in black and white.” With syntax highlighting, comments usually appear green (in xcode) and are really easy to ignore, but on a basic editor, it is easy to get caught up in looking for something and find the comments really get in the way. I keep telling myself that I need to learn to comment more, but I never do it :frowning:

One thing I touched on earlier, I don’t like to indent using tabs. Almost every editor treats tabs differently and if you code in multiple environments you will find that you get a much more uniform look (between editors) with spaces.

I used to code with a lot of space inserted in my code (if ( a == b ) x = y;) I used to think this made it easier to read, but I no longer think so and I favor this instead (if(a==b) x=y;) This seems trivial, but looking at 1,000 lines of the first one in a text editor nearly drives me insane. It may not be obvious in this example, but I try to use spaces to visually group related sections, not every single element.

I realize that there are many that will absolutely disagree with me on this. Especially those that work with multiple collaborators and need to maintain consistency. I personally feel that taking a relatively minimalist approach was, and continues to be, the right approach for me.

jay

for anything internet based (websites, tools, etc) i make or edit i use Microsoft Expressions Web 4…

I use DW only due to the colouring of the code. The colours make sense to me. Also the little pop up with code hints work well too. CSS especially.

notepad++ here

lemme just say this the majority of your code will be html {or whatever you use dhtml, xml with html, etc}php will do the good stuff like dynamically load what you need done with the same page like index.php you can make it do many things instead of using a hundred different pages

like what malasho said

[php]
if(x==y)
{
do something;
do something else;
}
[/php]

the do something you typically add maybe a php code but more of the less you add html code etc

have fun

Thats what I like about Expressions … makes it easier to read

Thanks all for your input. And thanks Jay for explaining to me how you do it. It will make it easier for me to “find my way” of doing it whenever I start…

This is the hard part where I have to find out where to start out… At my early days I would go into a webpage’s HTML, copy the code and make changes in notepad (to learn). I then renamed it to index.html and opened in iexplore to see if my changes were a success or not.

I see that much have changed since that time. I tried to go into the code of that calendar posted here earlier in this post, but it didn’t work out of the box. I think I have to find a way past theese first obstacles and then I’m good to go…

Sponsor our Newsletter | Privacy Policy | Terms of Service