Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Everything posted by jimfog

  1. jimfog

    date range

    I use your code and something is wrong-the tr element is not highlighted as expected,i think your code is OK, probably my syntax is somewhere wrong,Look at the code-it is short: $now = new DateTime($newdate);$today=$now->format('j m Y');$startDate = $mondayweek->modify("tomorrow")->modify("last Monday")->format('j m Y');$endDate = $mondayweek->modify("yesterday")->modify("next Sunday")->format('j m Y');if(isset($_GET['month'])) {echo '<tr class="monthgreen" >';} elseif (isset($_GET['weekview'])) { if($today>= $startDate && $today <= $endDate) {echo '<tr id="current_week" >';} else {echo '<tr class="john">';} } else echo '<tr class="john">'; Instead of $current I used $now, it is better for me, for clarity reason. That is one thing.The other is the echo statements above where i got to implement the conditional you gave me. Do not be distracted from "monthgreen", this is for when the users are seeing the month-this is OK. What do you think? If there is a syntax error i cannot find it.
  2. jimfog

    date range

    Yes,that approach seems better,instead of looping through dates.There is one code segment i do not understand though. $startDate = $monday->modify("tomorrow")->modify("last Monday")->format('Ymd');$endDate = $sunday->modify("yesterday")->modify("next Sunday")->format('Ymd'); Why you want to use 2 modify methods,the one next to each other?Why not for example not use modify->(this monday), modify->(this sunday)? I miss something here.
  3. jimfog

    date range

    What do you mean? Can you be more specific please?
  4. jimfog

    date range

    Yes you right to say that but i have already taken that into consideration. Look below and tell me what you think:$now = new DateTime($newdate);$week = $now->format('l') === 'Sunday' ? 'previous' : 'this';$monday = clone $now;$monday->modify('Monday ' . $week . ' week');$now->format('j');$sunday1=clone $now;$sunday1->modify('+7 days');$sunday = clone $now;$sunday->modify('Sunday ' . $week . ' week'); SO, with the above code i make sure that "monday" DOES refer to monday and not "now", meaning today's date.
  5. jimfog

    date range

    At last, now it works,thanks. :happy0046:Now i want to see sth in Dsonesuk's code.
  6. jimfog

    date range

    It does not work, i get the same message:Catchable fatal error: Object of class DateTime could not be converted to string in C:\xampp\htdocs\korakeiko\timetest3.php on line 14 Here is the whole code: $now = new DateTime;$week = $now->format('d-m-y') === 'Sunday' ? 'previous' : 'this';$monday = clone $now;$monday->modify('Monday ' . $week . ' week'); $sunday = clone $now;$sunday->modify('Sunday ' . $week . ' week'); I cannot understand why $day->modify('+1 day')) cannot be converted to a string.
  7. jimfog

    date range

    Regarding your code Dsonesuk i will see it later-i want to see first boen_robot's code(for educational purposes.) I tried the above code and the browser outputs that there is syntax error: Parse error: syntax error, unexpected ')' in C:\xampp\htdocs\korakeiko\timetest3.php on line I then tried for ($day = clone $monday; $current < $sunday; $day->modify('+1 day')) and i got the message that Catchable fatal error: Object of class DateTime could not be converted to string in C:\xampp\htdocs\korakeiko\timetest3.php on line Finally i tried for ($day = clone $monday->format('d-m-y'); $current < $sunday->format('d-m-y') ; $day->modify('+1 day')) abd then i got Fatal error: __clone method called on non-object in C:\xampp\htdocs\korakeiko\timetest3.php on line 16 There must be a problem with the object definition,i tried some things but i would appreciate some help.
  8. jimfog

    date range

    I want to take the dated between 2 dates that lie far left and far right of a specific date interval. For example i want to dates between 4-30-2012 and 5-5-2012. I found in the web the following code which works: $startDate = '4-30-2012';$endDate ='5-5-2012';for($current = $startDate ; $current != $endDate ; $current = date('d-m-Y', strtotime("$current +1 day"))) {echo $current.'<br>'; The problem is that i cannot do the above code work if instead of using date strings i use methods of the datelclass such as $monday->format('Y m d') or $sunday->format('Y m d') which both output date strings, Basically here is what i was trying to achieve: $startDate = [b]$monday->format('Y m d') [/b];$endDate = $[b]sunday->format('Y m d') [/b]';for($current = $startDate ; $current != $endDate ; $current = date('d-m-Y', strtotime("$current +1 day"))) {echo $current.'<br>'; What do you think? How am i going to take the date range between $monday->format('Y m d') and $sunday->format('Y m d') ? I think, that he above code does not work because strtotime cannot be used with methods such as these of the dateclass shown here.
  9. jimfog

    what debugger

    oh...but since we are 1 day away from the production version then i will wait till tomorrow and hopefully the problem will be solved
  10. jimfog

    what debugger

    Since the dll(i can neither find php5apache2_3.dll) was not found i will have to wait for the final version in 2 days. And to be precise that we are talking about the same thing, here is the name of the file i downloaded: php-5.4.1RC2.tar.
  11. jimfog

    what debugger

    Are you sure it will come out in 2 days? I followed option 1 but there was not any php5apache2_4.dll in the php folder?
  12. jimfog

    what debugger

    The problem continues.Apache does not restart. A window appears telling "Requested operation has failed"I tried to start Apache from the command prompt and here is the message that i got C:\Apache24\bin>httpd.exehttpd.exe: Syntax error on line 1 of C:/Apache24/conf/httpd.conf: Cannot load C:/php/php5apache2_2.dll into server: \xc4\xe5\xed \xde\xf4\xe1\xed \xe4\xf5\xed\xe1\xf4\xfc \xed\xe1 \xe5\xed\xf4\xef\xf0\xe9\xf3\xf4\xe5\xdf \xe7 \xea\xe1\xe8\xef\xf1\xe9\xf3\xec\xdd\xed\xe7 \xe4\xe9\xe1\xe4\xe9\xea\xe1\xf3\xdf\xe1. C:\Apache24\bin> Here is line 1LoadModule php5_module "C:\php\php5apache2_2.dll" Do you see any syntax error in the above line? The whole code of course that goes to apache config is the: LoadModule php5_module "C:\php\php5apache2_2.dll"AddType application\x-httpd-php.phpPHPIniDir "C:\php" I even tried changing the slashes from back ones to forward ones but without any result.
  13. jimfog

    what debugger

    I am in the proccess of installing separately pache,php and mysql. I downloaded apache from here http://www.apachelounge.com/download/win64/and php from here http://windows.php.net/download/ as boen robot suggested I am reading this tutorial here:http://www.ricocheting.com/how-to-install-on-windows/php I installed apache successfully but i cannot install php. The problem arises when following step 5(in "installing PHP")-after i do thatApache will not restart-i have downloaded php thread safe, so this is the correct version.
  14. jimfog

    what debugger

    Ok, all in all, you are saying that installing components separately is better(since some are not needed)-and not difficult.And another thing, since I already have 3 local sites,do you thing it will be difficult to transfer them in this new setting you are mentioning. This last is what bothers me most.
  15. jimfog

    what debugger

    Good explanation Are you sure this is the way to go, in other words you are saying to get rid of XAMPP, yes, but what if XAMP offers some features that are really needed and this ad hoc solution you propose does not. I have set 3 local sites with XAMPP and I am intimidated having to set up these again "manually". I am just asking.
  16. jimfog

    what debugger

    I just run this tool here http://xdebug.org/wizard.php and here is the message i get: The compiler (MS VC6) that this PHP was build with, is no longer supported. Please upgrade to a version that was built with MS VC9. It seems there is a problem with the compiler and i cannot install xdebug unless upgrading. The question is how i upgrade the compiler, do i just upgrade PHP(i have PHP 5.3 running on XAMPP)? I have never upgraded PHP on XAMP, how am i going to do it? Do i just unzip in the specified folder? P.S One last question, since PHP is interpreted why a compiler is needed?
  17. jimfog

    what debugger

    Since i do not use zend ide i will use xdebug
  18. jimfog

    what debugger

    I am using netbeans to develop PHP applications and now i am in search of a good debugger. In the Netbeans site Xdebug is proposed as a debugger but i am interested also on what you have to say. Thanks.
  19. Javascript is harder than i thought

×
×
  • Create New...