Joseph Nasello - 2007-05-19 00:08:01
Hello Alexandre,
Excellent contribution to the PHP movement, my sincere thanks.
I was able to get the example running after installing gd & changing the errors, including turning off strict (it was complaining about time zones)
I am trying to loop the phases and the only error I get is:
Here is the code I am using: ( I have set up the groups correctly and they work when I pass in single values)
Any ideas why this is not working?
/////////////////////////////////////////////////phase section////////////////////////////////////////
$query_rs = "SELECT * FROM v_pr_del v where pr_id='200' and del_type='project plan'";
$result_rs = mysqli_query($dbc, $query_rs);
$row_rs = mysqli_fetch_array($result_rs, MYSQL_ASSOC);
do {
for($i=0; $i < count($pr_id); $i++) {
//define the start and end of each phase. Set only what you want/need to show. Not defined values will not draws bars
$definitions['groups']['group'][0]['phase'][$i] = $i;
$definitions['planned']['phase'][$i]['name'] = $row_rs2['del_nm'];
$definitions['planned']['phase'][$i]['start'] = mktime(0,0,0,date("m") , date("d")-5, date("Y"));
$definitions['planned']['phase'][$i]['end'] = mktime(0,0,0,date("m") , date("d")+7, date("Y"));
}
} while ($row_rs = mysqli_fetch_array($result_rs));
///////////////////////////////////////////////////////////////////////////////////////////////////////
// you need to set groups to graphic be created
$definitions['groups']['group'][0]['name'] = "Group 1";
$definitions['groups']['group'][0]['start'] = mktime(0,0,0,date("m") , date("d")-5, date("Y"));
$definitions['groups']['group'][0]['end'] = mktime(0,0,0,date("m") , date("d")+3, date("Y"));
// increase the number to add another group
$definitions['groups']['group'][1]['name'] = "Group 2";
$definitions['groups']['group'][1]['start'] = mktime(0,0,0,date("m") , date("d")+3, date("Y"));
$definitions['groups']['group'][1]['end'] = mktime(0,0,0,date("m") , date("d")+20, date("Y"));