Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 07-22-2005, 11:08 AM   #1 (permalink)
mchit
Registered User
 
Join Date: Jul 2005
Posts: 5
mchit is on a distinguished road
daily menu script

Hello. I just recently discovered this site and when I saw the name I immediately knew I was at the right website for my problems.

First, some background. I am working on an intranet for the hospital I work at and have Mambo server currently up and running with an event calendar and a few other features. Our Dietary department wants to publish a daily menu so all of our users can see what is going to be served for Breakfast, Lunch, and Dinner on any given day.

I have searched and searched some more but haven't been able to find any specific script for this. It doesn't have to be complex, but what I'd like to have is a monthly calendar displayed and then users can click on a specific day to bring up a table with 3 columns, ie breakfast, lunch, dinner. Or even better yet, just have it so it displays the month with the menu displayed on each day, but that may be too crowded.

Also, it would be nice to have a feature where the dietary manager could log in and add/edit the menu.

Like I said, I already have an event calendar on the site, but not sure how to modify it to do this.

Any help is greatly appreciated!
mchit is offline   Reply With Quote
Old 07-22-2005, 11:32 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,692
redhead is on a distinguished road
Do you have mySQL running aswell ?
I made a small and simple calender thingy under my homepage to keep track of what task I would have to do..
It isn't in use anymore and I think it would be quite simple to shape it into what you want yours to display.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 07-22-2005, 12:05 PM   #3 (permalink)
mchit
Registered User
 
Join Date: Jul 2005
Posts: 5
mchit is on a distinguished road
Thanks redhead! Yes I have mySQL installed as well. Would greatly appreciate having a look at your script and giving it a try.
mchit is offline   Reply With Quote
Old 07-22-2005, 12:48 PM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,692
redhead is on a distinguished road
I'll do the rewrite of it tomorrow, I'm a bit tired now (10:46pm here), I guess I'll have a version done, where it's some sort of meals displayed/edited in about 24 hours.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 07-22-2005, 10:07 PM   #5 (permalink)
mchit
Registered User
 
Join Date: Jul 2005
Posts: 5
mchit is on a distinguished road
Much obliged, redhead. I look forward to testing it out and will owe you one after this
mchit is offline   Reply With Quote
Old 07-22-2005, 10:26 PM   #6 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,692
redhead is on a distinguished road
Quote:
I look forward to testing it out and will owe you one after this
Well, I guess I have to release it under the beerware licence
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 07-24-2005, 02:14 AM   #7 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,692
redhead is on a distinguished road
There you have it, I've altered my orriginal calender script, to handle breakfast/Lunch/Dinner instead of time specified actions.
You can get it from here The main thing in it, theres a mysql.inc.php file, this contains every mysql connection and settings needed for it to run, in here theres a authorise() function, this is to allow people to add/edit/delete what ever is supposed to be placed in the meal plan.

Normaly on my domain, this function will check the current user, for what usergroup they are in and what level of admin group their part of, so at some point one may add something, but can't delete/edit, and some might be able to edit their own but can't edit others etc.
In the version for you, I've simplyfied that function, so it only says yes or no you will have to alter that to fit your current login handling for the person who is supposed to maintain it.
Else it's just to include the calender.inc.php file, and call the print_calender() function, like shown in the index.php file.
And use the calender.sql file to create the needed calender mysql table.

Once you start using it, you'll notice theres also a progress bar, showing now many meals every day has been assigned, this can be used to make a fast estimate on what day theres much todo, or that was what I used it for. It can be removed if it is disturbing, it's placed in the scale_day() function called in line 112 and 114 in the print_month() function, but during adding of meals it is nice to have someway of knowing which days has been filled, and which still needs the meals assigned.

I know I havn't commentet too much on the orriginal code, but basicaly the functions you want to take a closer look at, is the print_day() function, which actualy makes all the work, I've simplyfied it abit from my orriginal, since your's only has to display three items per day, not like mine where you would show for every hour, or specific the current hour.

I hope it can be of use, if not theres not much lost in it, as I said it was some simplified way of making a calender thingy, which for a long time hasn't been in use.

I had it done at 5pm yesterday, but due to the fact that the machine I was working on wasn't connected to the net, and no working interfaces between it an one which was connected (floppy/network/usb-stick) I had to wait till today befor posting it.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 07-25-2005, 05:16 AM   #8 (permalink)
mchit
Registered User
 
Join Date: Jul 2005
Posts: 5
mchit is on a distinguished road
The tar file is possibly corrupted. I downloaded it multiple times and tried opening it, but gives me an error reading header message.

Thanks a ton, redhead! I will check this out asap and see if I can figure it out. Sounds like it'll work just fine. Will let you know!

Thanks!
mchit is offline   Reply With Quote
Old 07-25-2005, 11:44 AM   #9 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,692
redhead is on a distinguished road
Try getting the tar.bz2 version of it, if theres a corruption during transfer, the bzip2recover should be able to recreate the lost bits.
Remember this is not a zip file, it is a tar-red achive that is compressed with gzip/bzip2 so on a *nix ssystem you'd use: tar xcf cal.tgz or tar jxf cal.tar.bz2 to uncompress it.
It will create a directory called "calender" where every file it requires resides.
If you need it in another format, let me know, and I'kll try and see if I can convert it to a zip archive tomorrow.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 07-25-2005, 12:35 PM   #10 (permalink)
mchit
Registered User
 
Join Date: Jul 2005
Posts: 5
mchit is on a distinguished road
Thanks redhead! I got it to extract finally. Going to play with it and see if I can get it to work.
mchit is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Image Scrolling Script...Please Help mark4man HTML, XML, Javascript, AJAX 3 06-14-2005 07:51 AM
My script isn't reading and inserting the value of a cookie correctly... Logical Demise PHP 1 06-04-2005 11:42 PM
how do I add a stylesheet to this script? mio HTML, XML, Javascript, AJAX 3 03-24-2005 10:29 AM
Executing a server script from PHP sde PHP 4 02-05-2005 11:12 AM


All times are GMT -8. The time now is 07:41 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting