$titre = "Clippings / Cuttings...";
$img_titre = "titles/CURE.jpg";
include("includes/archi/header.php");
//==============================POST =====================================================//
$OrderBY_sel = $_POST['grp_OrderBY'];
$date = $_POST['date'];
$titre_mag = $_POST['titre_mag'];
$pays = $_POST['pays'];
$onlyNew = $_POST['onlyNew'];
?>
$reqNbclippings = " SELECT * FROM clippings";
$rsNbclippings = mysql_query ( $reqNbclippings );
$Nbclippings = mysql_num_rows ( $rsNbclippings );
echo $Nbclippings." Clippings listed"; ?>
$no = 1;
//=========================RE-INITIALISATION DES VARIABLES=======================================//
$Where = '';
if ( $grp_OrderBY == "OrderBYdate" )
{ $orderBy = 'ORDER BY year, month'; }
else if ( $grp_OrderBY == "OrderBYpays" )
{ $orderBy = 'ORDER BY pays'; }
else if ( $grp_OrderBY == "OrderBYtitreMag" )
{ $orderBy = 'ORDER BY titre_mag'; }
else { $orderBy = 'ORDER BY year, month, pays, titre_mag, support'; }
if ( $date == 'see all...' && $date !='') { $date = ''; }
else { $date = $date; }
if ( $titre_mag == 'see all...' ) { $titre_mag = ''; }
else { $titre_mag = $titre_mag; }
if ( $pays == 'see all...' ) { $pays = ''; }
else { $pays = $pays; }
//===========================================================================================//
//==============================CRITERE_RECHERCHE===========================================//
if ( $date != '' )
{ $Where = $Where." year = '".$date."'"; }
if ( $pays != NULL )
{ if ( $Where != '')
{ $Where = $Where." AND "; }
$Where = $Where."pays = \"".$pays."\"";
}
if ( $titre_mag != NULL )
{ if ( $Where != '')
{ $Where = $Where." AND "; }
$Where = $Where."titre_mag = \"".$titre_mag."\"";
}
if ( $onlyNew != NULL )
{ if ( $Where != '')
{ $Where = $Where." AND "; }
$Where = $Where."new = 1";
}
//===========================================================================================//
if ( $date != '' || $pays != '' || $titre_mag != '' || $_POST['onlyNew'] )
{ $Where = "WHERE ".$Where; }
//===========================================================================================//
$reqSELECT = " SELECT * FROM clippings
$Where
$orderBy ";
$rsSELECT = mysql_query ( $reqSELECT );
$nbClippingsTrouves = mysql_num_rows ( $rsSELECT );
if ( $nbClippingsTrouves == 0)
{ echo "No result found !!!"; }
else
{ if ( $nbClippingsTrouves == 1 )
{ echo "Only ".$nbClippingsTrouves." Clipping found..."; }
else
{ echo $nbClippingsTrouves." Clippings found..."; }
?>
# |
Date |
Mag |
Pays |
Article |
#p |
Description |
//===========================AFFICHAGE==============================================//
while ( ($c = mysql_fetch_array( $rsSELECT ) ) != NULL )
{ if ( $c['new'] == 1 )
{ $couleur = '#FF0000'; }
echo "";
$num = $no++;
if ( strlen($num) == 1 ) { $num = "00".$num; }
else if ( strlen($num) == 2 ) { $num = "0".$num; }
echo "".$num.". | ";
echo "";
if ( strlen ( $c[month]) == 1 )
{ $month = "0".$c[month] ; }
else
{ $month = $c[month] ; }
if ( $c[month] != 0 && $c[year] != 0)
{ echo $month."/".$c[year]; }
elseif ( $c[month] == 0 && $c[year] != 0)
{ echo $c[year]; }
elseif ( $month == 0 && $c[year] == 0)
{ echo " "; }
if ( $c[support] == "X" )
{ $full_mag = " --> full mag"; }
?>
|
|
|
|
|
|
$br = "";
$full_mag = "";
}
}
?>
if ( $nbClippingsTrouves > 10 )
{ echo " "; }
?>