Hi again, still struggling with todays posts and responses. Trying to have a break and think of new areas to break…
I have an array of dates/sales, something like this:
$columns = array(
"year1" =>array(
"header"=> $year - 10,
"type"=>"barchart",
"align"=>"center",
"width"=>"100px",
"wrap"=>"nowrap",
"visible"=>"true",
"on_js_event"=>"",
"field"=>"",
"maximum_value"=>$max_value,
"display_type"=>"vertical"),
"year2" =>array(
"header"=> $year - 9,
"type"=>"barchart",
"align"=>"center",
"width"=>"100px",
"wrap"=>"nowrap",
"visible"=>"true",
"on_js_event"=>"",
"field"=>"",
"maximum_value"=>$max_value,
"display_type"=>"vertical"),
"year3" =>array(
"header"=> $year - 8,
"type"=>"barchart",
"align"=>"center",
"width"=>"100px",
"wrap"=>"nowrap",
"visible"=>"true",
"on_js_event"=>"",
"field"=>"",
"maximum_value"=>$max_value,
"display_type"=>"vertical"),
.....
I have to repeat these 12-15 times for each report, and the columns are pretty static. A programmer will be needed if a user wants a different date range…
Is it possible to do some thing like this (php and mySQL)…
$vm_columns = array(
for ($y= (date(Y)-10); $y <= (date(Y)+1); ++$y)
{
"year" =>array(
"header"=> $i,
"type"=>"barchart",
"align"=>"center",
"width"=>"100px",
"wrap"=>"nowrap",
"visible"=>"true",
"on_js_event"=>"",
"field"=>"",
"maximum_value"=>$max_value,
"display_type"=>"vertical");
}