jimfog
Members-
Posts
1,803 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by jimfog
-
I just made a simple question and it sparked many responses-that is what I call "community".
-
I wonder, if we want to use the methods/properties of a class. Is it necessary that we must first instantiate this class-meaning making an object out of it?
-
NEVERMIND, IT WORKS, MANY THANKS TO YOU TWO, This logic is new to me and I might come back for questions-as part of the learning process though.
-
I tried dsonesuk's code and the problem is that ALL the rows are highlighted and not just the one corresponding to the current week: $cmonth = date("m") ;$cYear = date("Y");$convert_datecount = new DateTime($datecount.'-'. $cmonth .'-'.$cYear );$convert_datecount = $convert_datecount->modify("tomorrow")->format('Ymd');$today=$now;$startDate = $today->modify("tomorrow")->modify("last Monday")->format('Ymd');$endDate = $today->modify("yesterday")->modify("next Sunday")->format('Ymd');for ($date = 1; $date < ($totaldays_in_mon + $startdate); $date++) { $colcout++; if ($colcout == 1) { if((isset($_GET['weekview']))&&($convert_datecount>= $startDate && $convert_datecount<= $endDate)) echo '<tr class="other" >'; else echo '<tr class="john" >'; } if ($date >= $startdate) { $datecount++; } if ($colcout == 6 || $colcout == 7) { $cellclass = "weekend"; } else { $cellclass = "weekdays"; } {echo "<td class=".$cellclass.'id=dateid_' . $year . str_pad(date('m', $month), 2, '0', STR_PAD_LEFT) . str_pad($datecount, 2, '0', STR_PAD_LEFT).'>'.$datecount."</td>";} if ($colcout % 7 == 0) { $colcout = 0; $rowcount++; } Here is the link so you can see https://skydrive.live.com/redir.aspx?cid=be27434b2aac8130&resid=BE27434B2AAC8130!234&parid=BE27434B2AAC8130!140 I will have to use a different strategy but dsonesuk can tell better if I did sth wrong in the code above and it does not work as expected
-
so stating the question somehow different-usually, in a modern site, functions performed by php are now performed by Ajax.is the above statement correct? is there any function left performed solely by php?
-
What functions of a site usually use AJAX and which not?
-
Are the most modern sites of today fully AJAX? I mean, is there anything left(a link maybe) to be done with a conventional(non-AJAX) way?
-
I think I got your point about "meaningless strings". My assumption was that $today=$now->format('j m Y'); will suffice cause $now( which is a date object) is assigned to $today and that is that. I did not know that the above was wrong.Furthermore I assume, now, that the below code is correct: $startDate = $today->modify("tomorrow")->modify("last Monday")->format('Ymd');$endDate = $today->modify("yesterday")->modify("next Sunday")->format('Ymd'); ...because $today contains a date object. Am I saying it correctly?
-
Do you believe the above code is better than that you have given me the other days? I am assuming the reason you changed it is for including the week highlighting feature I need. Correct?
-
give me a little help please,what are you trying to do here? Are you demonstrating a new code for looping the days of a month, different from the one you have given me the other days? Or is it sth else-just an answer to what the previous post was claiming? And if you are looping where is the for loop?
-
Where exactly is the mistake in the code above? Just give me an example-in theory I understand what are you talking about. Are you referring to the $datecount variable?
-
Can you elaborate a little please? Give an example-it would be best.
-
In the web app I am building the design pattern I am using is the following. For example, the app/website has 3 pages, and in these 3 pages functions are called, the functions are located in a separate output.php file. Is the above an example of a "template system"?If not give me an example of a template system please.
-
Are you aware of any good math forum in the web-computing has a lot of math in it so I want to sharpen my skills a little.
-
My question has to with the window print method. Usually what kind of other usage might have besides printing the webpage, I mean, by using the print method is there a way I can initiate the print procedure with specific parameters and if yes what these could be. I mean what are the potential hidden-if any-in the print method besides a simple print.
-
Never mind, I found the solution to my problem.
-
Suppose that we have an if statement that does not work-,it is a logic error-, does such a statement outputs false? Not in the browser I mean as en echo statement.
-
Unbelievable, so many months i develop in PHP and i did not know the notion of "query string"-I have used it but now i am understanding the full extent of itsapplication.
-
Why that, i am confused,can you elaborate please a little I am confused here too, maybe if you write some code i will be able to understand it better. Either way there still is a problem when highlighting the days which refer to the days that belong to previous/next month. Formatting does not take place there, see image:https://skydrive.live.com/redir.aspx?cid=be27434b2aac8130&resid=BE27434B2AAC8130!233&parid=BE27434B2AAC8130!140
-
When refer to the term "query string" we mean ONLY what is passed to PHP through the GET method or is there anything more to it?
-
Ι've managed to pull it off-partially. Instead of targeting the tr element I targeted the td element(which contains the number corresponding to the day of the month) and instead of using $today i used $datecount which is the variable the prints the days of the month. Look at the image and the code: https://skydrive.live.com/redir.aspx?cid=be27434b2aac8130&resid=BE27434B2AAC8130!232&parid=BE27434B2AAC8130!140 if($datecount>= $startDate && $datecount <= $endDate) if((date("d") == $datecount)&& (date("n") == (date("n", strtotime($newdate))))) { echo "<td class='current-day-highlited' align='center' valign='middle' height='20px'>" .$datecount. "</td>\n";} else {echo "<td class='other' align='center' valign='middle' height='20px'>".$datecount."</td>\n";} The inner if statement just highlights the current day within the current week.
-
Then I should say better "HTML", i am putting it in quotes-since as you said PHP generates the HTML here.
-
Ok now it works,thanks for that but the problem is that all the rows of the calendar gets id="current_week", now we are talking abouthtml problem and not PHP, php works. The code is the one you gave me here http://w3schools.invisionzone.com/index.php?showtopic=42239&hl=&fromsearch=1The only change i made is to make tr class change when the user on the day or month, about week, we are still trying-but i think we are closeIn short here it is: if ($colcout == 1) { 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="jn">';} } else echo '<tr class="john">'; } The problem is depicted in this picture here, which is taken from firebug:https://skydrive.live.com/redir.aspx?cid=be27434b2aac8130&resid=BE27434B2AAC8130!231&parid=BE27434B2AAC8130!140 Thanks again
-
You are correct. So, I am having a logic error. I have a lead and i will follow it-see where i will get.