bizbla
12-25-2006, 03:45 AM
Hello,
I am working on a calendar and it is currently setup to show this year (2006) and the future 4 years (2007-2010). What I would like it to do is show those, plus the past 4 years (2005-2002).
Here is the current coding...
//============================
// FUNCTION: show_nav()
// Param: 1
// Desc: Displays Navigation
//============================
function show_nav($date)
{
$data = '<select class="nav_select" onChange="if(this.value!= 0){location=this.options[this.selectedIndex].value}">'."\n";
// Show Years Jan -> Dec..
for ($i=1; $i<13; $i++)
{
$data .= '<option'.(($i<10 ? '0'.$i : $i)==substr($date,0,2) ? ' selected ' : ' ').'value="index.php?date='.($i<10 ? '0'.$i : $i).'-'.substr($date,-4).'">'.$this->get_month(($i<10 ? '0'.$i : $i)).'</option>'."\n";
}
$data .= '</select>'."\n";
$data .= '<select class="nav_select" onChange="if(this.value!= 0){location=this.options[this.selectedIndex].value}">'."\n";
// Show Years. Current Year + 5 Years..
for ($i=date("Y"); $i<date("Y")+5; $i++)
{
$data .= '<option'.(substr($date,0,2).'-'.$i==substr($date,0,2).'-'.substr($date,-4) ? ' selected ' : ' ').'value="index.php?date='.substr($date,0,2).'-'.$i.'">'.$i.'</option>'."\n";
}
$data .= '</select>'."\n";
return $data;
}
Can someone show me the correct coding to make this happen? I would be very gratefull and can offer a free link placement for you in BizBla.com's link directory (normal cost is $5.00).
I am working on a calendar and it is currently setup to show this year (2006) and the future 4 years (2007-2010). What I would like it to do is show those, plus the past 4 years (2005-2002).
Here is the current coding...
//============================
// FUNCTION: show_nav()
// Param: 1
// Desc: Displays Navigation
//============================
function show_nav($date)
{
$data = '<select class="nav_select" onChange="if(this.value!= 0){location=this.options[this.selectedIndex].value}">'."\n";
// Show Years Jan -> Dec..
for ($i=1; $i<13; $i++)
{
$data .= '<option'.(($i<10 ? '0'.$i : $i)==substr($date,0,2) ? ' selected ' : ' ').'value="index.php?date='.($i<10 ? '0'.$i : $i).'-'.substr($date,-4).'">'.$this->get_month(($i<10 ? '0'.$i : $i)).'</option>'."\n";
}
$data .= '</select>'."\n";
$data .= '<select class="nav_select" onChange="if(this.value!= 0){location=this.options[this.selectedIndex].value}">'."\n";
// Show Years. Current Year + 5 Years..
for ($i=date("Y"); $i<date("Y")+5; $i++)
{
$data .= '<option'.(substr($date,0,2).'-'.$i==substr($date,0,2).'-'.substr($date,-4) ? ' selected ' : ' ').'value="index.php?date='.substr($date,0,2).'-'.$i.'">'.$i.'</option>'."\n";
}
$data .= '</select>'."\n";
return $data;
}
Can someone show me the correct coding to make this happen? I would be very gratefull and can offer a free link placement for you in BizBla.com's link directory (normal cost is $5.00).
