TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 03-16-2009, 02:05 PM   #1 (permalink)
The Visitor
 
Join Date: Mar 2009
Posts: 4
Thanks: 0
deanr201 is on a distinguished road
Default Looking for a solution, Have some code, but need a little more help!

*edit re added my problem, sorry for the confusion*

As mentioned in my introduction thread, I'm a designer and not a coder, but have started to expand into the coding thing.

I have a use for calendar script and I wasnt sure where to start so after a bit of googling found a script released under GNU but it did not fit my purpose 100%.

as it stood the script would display a calender and allow me to have a "free" day in one colour and a "busy" day in another, only I needed 3 colours for the free day.

The code does write the calender out into a table, and the following is where the status is set.
PHP Code:
if ($date_status!="1") {
                                
$status_color "669900";
                                
$js_status "0";
                            }

                            
$output .= "<td id=\"$year"."-"."$fmonth"."-"."$fstartdate\" width=$width valign=top align=center onclick=\"calendar_date('$year"."-"."$fmonth"."-"."$fstartdate','$js_status','$username','669900');\" bgcolor=\"#$status_color\"> 
Ideally I need to be able to specify what the colour is via variable, as the code for viewing the calender is.

PHP Code:
require "calendar.php";
echo (
'<div style="float:left; margin:3px">');
print 
calendar("2009""1","user1",1,0);
echo (
'</div>'); 
this would display on the page a single calender for January 2009.


***Partial Solution***
Since this I have managed to get a partial solution which is to was to add in the following.

PHP Code:
                            if ($date_status!="1") {
 switch (
$season):
    case 
"l":
        
$status_color="99CC66";
        break;
    case 
"m":
        
$status_color="FFCC33";
        break;
    case 
"h":
        
$status_color="FF6600";
        break;
    default:
        
$status_color="669900";
endswitch;
$js_status "0";                            }

                            
$output .= "<td id=\"$year"."-"."$fmonth"."-"."$fstartdate\" width=$width valign=top align=center onclick=\"calendar_date('$year"."-"."$fmonth"."-"."$fstartdate','$js_status','$username','669900');\" bgcolor=\"#$status_color\"> 
and on the page to view the calender.

PHP Code:
require "calendar.php";
echo (
'<div style="float:left; margin:3px">');
print 
calendar("2009""1","user1",1,0,"l");
echo (
'</div>'); 
where "l" is the relates to Low, Medium, High, which are defined in the calenders code, this allows me to display more than one calender month on the view page, and display the month with the colour for either "low" "Medium" or "high" colour scheme.

I'm not sure this is the most effective way of achieving this but it works.

Last edited by deanr201 : 03-17-2009 at 08:56 AM.
deanr201 is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB 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
Tips to Improve Your Coding and Projects Village Idiot Tips & Tricks 45 12-03-2012 07:46 AM
Writing Clean Code Village Idiot Tips & Tricks 10 06-25-2012 12:35 PM
help with object code planepixel Absolute Beginners 12 02-03-2009 01:38 PM
Views on transferring code ownership jcorradino General 4 12-05-2008 11:04 AM
Snipply.com - Code snippet website codyodell Show Off 27 04-13-2008 02:09 PM


All times are GMT. The time now is 11:07 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design