+ Reply to Thread
Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: php calendar??

  1. #21
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: php calendar??

    Quote Originally Posted by mattura View Post

    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....

  2. #22
    natsuki's Avatar
    natsuki is offline x10 Sophmore natsuki is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    112

    Re: php calendar??

    Quote Originally Posted by freecrm View Post
    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 `USERNAME` 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['USER'];
    		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
    .......
    WHERE EVSTART > '$linkDate' AND EVSTART < '$linkDateEnd'
    that's just until 23:59:58 dunno about 0:00:00 though
    using weekday for colspan was really ingenious xD

  3. #23
    mattura's Avatar
    mattura is offline x10 Elder mattura is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    563

    Re: php calendar??

    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.
    ----
    Life is a game. The conception is terrible but the graphics are amazing!
    matt.elementfx.com

  4. #24
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: php calendar??

    [quote=natsuki;467539You used `USERNAME` in your query and you were expecting to get 'USER'?[/quote]

    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
    .......
    WHERE EVSTART > '$linkDate' AND EVSTART < '$linkDateEnd'
    that's just until 23:59:58 dunno about 0:00:00 though
    I'll look a this tonight.
    Edit:
    Quote Originally Posted by mattura View Post
    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 by freecrm; 10-15-2008 at 03:40 PM. Reason: Automerged Doublepost

  5. #25
    mattura's Avatar
    mattura is offline x10 Elder mattura is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    563

    Re: php calendar??

    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.
    ----
    Life is a game. The conception is terrible but the graphics are amazing!
    matt.elementfx.com

  6. #26
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: php calendar??

    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.

  7. #27
    mattura's Avatar
    mattura is offline x10 Elder mattura is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    563

    Re: php calendar??

    :P Nice one. That's what it's all about!
    ----
    Life is a game. The conception is terrible but the graphics are amazing!
    matt.elementfx.com

+ Reply to Thread
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 08:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 10:46 AM
  3. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 02:58 PM
  4. Important PHP Information
    By Bryon in forum News and Announcements
    Replies: 0
    Last Post: 11-21-2007, 03:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers