saseow
Posts: 744
|
| Posted: 02/20/2009, 9:50 AM |
|
I have a page with a grid and one of the calling parameters is like:
¤t_date=2009-02-03
Now, I have two links on the page (Previous Day) and (Next Day). Is it possible to reload the page with either the previous days data or the next days data by clicking these links? I guess my question is how can I set the 'current_date' parameter from a link?
Any help/advice would be great!
|
 |
 |
saseow
Posts: 744
|
| Posted: 02/22/2009, 6:02 AM |
|
I have got a little further with this but I am stumped at the last hurdle. May well be a simple fix:
I have a button in a form to (supposedly) send the date back by 1 day. In the on click event I have:
//Code to move the day backwards
$cur_date = CCGetParam(current_date,0);
$proj_id = CCGetParam(project_id,0);
$work_id = CCGetParam(ID,0);
//Subtract 1 day (86400 secs)
$cur_date = strtotime($cur_date);//Create unix Timestamp
$cur_date= $cur_date - 86400;
$cur_date= date("Y-m-d",$cur_date);//Format the timestamp back
header("Location: work_details_day.php?ID=".$work_id."&project_id=".$proj_id."¤t_date=".$cur_date);
//global $Redirect;
//$Redirect="work_details_day.php?ID=".$work_id."&project_id=".$proj_id."¤t_date=".$cur_date;
Everything looks great with echo but the URL retains the same current_date value and the message:
"The URL was redirected to . Please click the link to go there" comes up. This happens both with $Redirect and header methods.
I am sure that the answer is simple and really need some help.
|
 |
 |
saseow
Posts: 744
|
| Posted: 02/22/2009, 6:07 AM |
|
Forgot to put the exit; afterwards.
|
 |
 |
|