php calendar??

freecrm

New Member
Messages
629
Reaction score
0
Points
0
exemption - he's already done pretty much all of the work!

LOL - I was going to point that out!

Maybe a quick look over the last few posts would help to understand where this is at!

I'm just going to make a few chages to the css this evening but I'm still stuck on this dynamic drop-down from recordset...

Maybe I should take off the user authentication for a bit so you can see what the end result is without logging in....
 

natsuki

New Member
Messages
112
Reaction score
0
Points
0
I only have one problem now.

At the top of the script is a recordset created of users (RS_Users). I have a form with 3 fields (drop-down) which calls this recordset and it isn't calling results from the recordset!

I have butchered this script so many times now, there's probably a simple error but I can't find it!

Ideally, I would have alist drop-down with multiple selections but I haven't got a clue how to do this.
Code:
<?php
// create recordset of users
mysql_select_db($database_freecrm, $freecrm);
$query_RS_Users = "SELECT [color=red]`USERNAME`[/color] FROM CONTACTS ORDER BY `USERNAME` ASC";
$RS_Users = mysql_query($query_RS_Users, $freecrm) or die(mysql_error());
$row_RS_Users = mysql_fetch_assoc($RS_Users);
$totalRows_RS_Users = mysql_num_rows($RS_Users);

?>
........blah blah
..............<html blah.....
User:
	<select name="selectuser" id="selectuser">
	<?php
	while ($row_RS_Users = mysql_fetch_assoc($RS_Users))//loop through results
	{
 		$curuser = $row_RS_Users[[color=red]'USER'[/color]];
		echo '<option value="'. $curuser . '" ';
		if ($curuser == $selecteduser)
		{
			echo " selected";
		}

	echo  ">" . $curuser . "</option>";
	}
	?>
You used `USERNAME` in your query and you were expecting to get 'USER'?

also about
Code:
 $linkDate = mktime (0,0,0, $month, $day, $year);//create minimum parameter
			$linkDateEnd = mktime(23,59,59, $month, $day, $year);// create maximum parameter
.......
[i]WHERE EVSTART > '$linkDate' AND EVSTART < '$linkDateEnd'[/i]
that's just until 23:59:58 dunno about 0:00:00 though
using weekday for colspan was really ingenious xD
 

mattura

Member
Messages
570
Reaction score
2
Points
18
Yep, as natsuki mentioned, better to have
$linkDateEnd = mktime(0,0,0,$month,$day+1,$year)
if you use the less than sign.
Was just a quick piece of code, I didn't really think it through, and to make it look easier to explain.
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
natsuki;467539You used `USERNAME` in your query and you were expecting to get 'USER'?[/quote said:
OMG - how embarrasing - thats what you get for getting tired! Thanks for pointing this stupid error out!

also about
Code:
 $linkDate = mktime (0,0,0, $month, $day, $year);//create minimum parameter
            $linkDateEnd = mktime(23,59,59, $month, $day, $year);// create maximum parameter
.......
[I]WHERE EVSTART > '$linkDate' AND EVSTART < '$linkDateEnd'[/I]
that's just until 23:59:58 dunno about 0:00:00 though

I'll look a this tonight.
Edit:
Yep, as natsuki mentioned, better to have
$linkDateEnd = mktime(0,0,0,$month,$day+1,$year)
if you use the less than sign.
Was just a quick piece of code, I didn't really think it through, and to make it look easier to explain.

Good plan.

Alternatively, can I just put <= in the query?
Edit:
Worked a treat guys - many thanks.

The less than or equal <= worked fine in the query.

I'm just going to play around with the styling now and some additional query parameters but I am well chuffed!!!!


Please close this topic.
 
Last edited:

mattura

Member
Messages
570
Reaction score
2
Points
18
Well done Rich, you should be proud! You started off thinking you couldn't do this, but you ended up making it all yourself (aside from a couple of simple errors anyone could have made). I'm sure you've also learnt a lot in the process and finished up with something you like better than a script from the internet.
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
Thanks Matt!!

I am so pleased with this - the remainder of the bugs have been ironed out (user menu and filter mainly) and the .css is starting to look cool.

I can finally start to work on other areas!!!

If anyone want to see the final working code, PM me.
 
Top