This topic is locked

subheader grouping by date

2/12/2008 1:58:55 PM
PHPRunner General questions
G
garivera author

I have the following code to creates subheaders based on a date, but I cant figure out a way to expand it by grouping it by month. I am using it in List page: after record is processed, before move next list.
Thanks in advance.
global $SubmissionDate;
list($Year,$Month,$Day) = split('-',$data['SubmissionDate']);

$SubmissionDate2 = mktime(12,0,0,$Month,$Day,$Year);

$SubmissionDate3 = date("F",$SubmissionDate2);
if($SubmissionDate != $data["SubmissionDate"])

{

$SubmissionDate=$data["SubmissionDate"];
$row["showheader"]=true;

//$row["header"]=$data["SubmissionDate"];

$row["header"] = $SubmissionDate3;

}
else {}

J
Jane 2/13/2008

Hi,
you can sort records on the page on the Edit SQL query tab.

Add ORDER BY or GROUP BY clause to your query on this tab.

G
garivera author 2/13/2008

Hi,

you can sort records on the page on the Edit SQL query tab.

Add ORDER BY or GROUP BY clause to your query on this tab.


Thanks but I have already used order by Submission Date by ascending but my problem is the SubmissionDate field is a specific, month, day, year. I want to put a header between all records based on this fields month & seperating them by month. Ex 10 records in SubmissionDate ( 01-08-2008, 01-09-2008, 01-09-2008, 01-20-2008, 01-22-2008, 02-08-2008, 02-09-2008, 02-09-2008, 02-20-2008, 02-22-2008). I have them ordering by ascending based on SubmissionDate, now I want to put subheaders between the two months, such as

Jan - and then list the 5 records in Jan

Feb - and then list the 5 records in Feb
The code is I provided is somewhat working, but I need to modify it to not group by exact date (ex: 02-08-2008) but to grop by month (01) or (02) ect. I have provided a screen shot of what it look like now.


G

J
Jane 2/14/2008

Hi,
you can publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages. I'll try to help you.