Archives:
if(!$year){
$year = date('Y');
}
//echo $sql;
//do the open here
$sql="select year(Date1) as yearn from AFN group by year(Date1) order by year(Date1)";
$recordSet=mysql_query($sql);
$NumRows = mysql_num_rows($recordSet);
if(!$NumRows||$NumRows==0){
echo "Sorry, there are no archives available at this time. Please try again later!
";
}
$num = 0;
while($rs = mysql_fetch_array($recordSet)){
extract($rs);
if ($num==0){
if ($year!=$rs["yearn"]){
?>
"> echo $rs["yearn"];?>
}else{
?>
echo $rs["yearn"];?>
}
}else{
if ($year==$rs["yearn"]){
?>
,"> echo $rs["yearn"];?>
}else{
?>
, echo $rs["yearn"];?>
}
}
}
$sql="select Date1,ItemHeader from AFN where year(Date1)='".$year."' order by Date1, Paragraph";
//echo $sql;
//do the open here
$recordSet=mysql_query($sql);
$NumRows = mysql_num_rows($recordSet);
if(!$NumRows||$NumRows==0){
echo "
Sorry, there are no archives available at this time. Please try again later!
";
}
$testDate="";
while($rs = mysql_fetch_array($recordSet)){
extract($rs);
if($testDate==""){
$testDate=$rs["Date1"];
?>
">
echo date('M d, Y',strtotime($rs["Date1"])); ?>
echo "".$rs["ItemHeader"]."
";
}else{
if($testDate!=$rs["Date1"]){
$testDate=$rs["Date1"];
?>
">
echo "".$rs["ItemHeader"]."";
?>
}else{
echo "".$rs["ItemHeader"]."";
?>
}
}
}//end year test
if($view){
?>
Archive:
$sql="SELECT * FROM AFN WHERE Date1 = '".$Date1."' and promo!='1'";
$recordSet = mysql_query($sql);
while($rs = mysql_fetch_array($recordSet)){
extract($rs);
?>
echo $rs["ItemHeader"]."\n\n";?>
}
}//end of view
?>