Accueil"; // verify if doc direct requested echo "
" ; if ($rmydocid=="") { // verify if no srub ? if ($rmysrub=="") { // yes, no srub $sqldoc="SELECT documents.docid, documents.catId, documents.rubid, documents.doctitle, documents.docbody, m_categorie.catTitle, m_rubrique.rublibelle,m_rubrique.rubdesc "; $sqldoc=$sqldoc."FROM m_rubrique INNER JOIN (m_categorie INNER JOIN documents ON m_categorie.catId = documents.catId) ON (m_categorie.catId= m_rubrique.catId) AND (m_rubrique.rubid = documents.rubid) "; $sqldoc=$sqldoc."WHERE (((documents.catId)=".$rmycat.") AND ((documents.rubid)=".$rmyrub.")) ORDER BY docorder ;"; $rsdoc=mysql_query($sqldoc) or die ("Erreur : ". mysql_error()) ; if (mysql_num_rows($rsdoc) != 0) // if no records found {// show location //print "  ".mysql_result($rsdoc,0,"catTitle")."  ".mysql_result($rsdoc,0,"rublibelle");; //print "

"; // print "
"; // if count RS = 1 if (mysql_num_rows($rsdoc)==1) { // yes count RS = 1 show doc print ""; print ""; } else { // no count RS > 1 show list print ""; print " "; } print ""; } // print "
".mysql_result($rsdoc,0,"m_categorie.catTitle")." / ".mysql_result($rsdoc,0,"doctitle")."
".mysql_result($rsdoc,0,"docbody")."
"; ?>
".mysql_result($rsdoc,0,"rubdesc")."
" ; mysql_data_seek($rsdoc,0); // déplace le pointeur interne de résultat a 0 while($rowdoc = mysql_fetch_assoc($rsdoc)) { print " / ".$rowdoc["doctitle"]."
"; //print "

"; } // close & kill doc rs mysql_free_result($rsdoc); } else { // no, yes srub $sqldoc="SELECT documents.docid, documents.catId, documents.rubid, documents.srubid, documents.doctitle, documents.docbody, m_categorie.catTitle, m_rubrique.rublibelle, m_sousrubrique.srubLibelle,m_sousrubrique.srubdesc "; $sqldoc=$sqldoc."FROM (m_rubrique INNER JOIN (m_categorie INNER JOIN documents ON m_categorie.catId = documents.catId) ON (m_categorie.catId = m_rubrique.catId) AND (m_rubrique.rubid = documents.rubid)) INNER JOIN m_sousrubrique ON (m_rubrique.rubid = m_sousrubrique.rubid) AND (documents.srubid = m_sousrubrique.srubid) "; $sqldoc=$sqldoc."WHERE (((documents.catId)=".$rmycat.") AND ((documents.rubID)=".$rmyrub.") AND ((documents.srubID)=".$rmysrub.")) ORDER BY docorder ;"; $rsdoc=mysql_query($sqldoc) or die ("Erreur : ". mysql_error()) ; if (mysql_num_rows($rsdoc) != 0) // if no records found { // show location //print "  ".mysql_result($rsdoc,0,"catTitle")."  ".mysql_result($rsdoc,0,"rublibelle")."  ".mysql_result($rsdoc,0,"srublibelle"); //print "

"; print ""; if (mysql_num_rows($rsdoc)==1) // if count RS = 1 show doc { // yes count RS = 1 show doc print ""; print ""; } else { // RS > 1 show list print ""; print " "; } } print ""; // print "
".mysql_result($rsdoc,0,"m_categorie.catTitle")." / ".mysql_result($rsdoc,0,"m_rubrique.rublibelle")." / ".mysql_result($rsdoc,0,"doctitle")."
".mysql_result($rsdoc,0,"docbody")."
"; ?>
".mysql_result($rsdoc,0,"srubdesc")."
" ; mysql_data_seek($rsdoc,0); // déplace le pointeur interne de résultat a 0 while($rowdoc = mysql_fetch_assoc($rsdoc)) { print " / ".$rowdoc["doctitle"].""; print "
"; //print "

"; } mysql_free_result($rsdoc); // close & kill doc rs } } else { // yes Doc direct requested if ($rmysrub=="") { $sqldoc="SELECT documents.docid, documents.doctitle, documents.docbody, m_categorie.catTitle, m_rubrique.rublibelle "; $sqldoc=$sqldoc."FROM m_rubrique INNER JOIN (m_categorie INNER JOIN documents ON m_categorie.catId = documents.catId) ON (m_categorie.catId = m_rubrique.catId) AND (m_rubrique.rubid = documents.rubid) "; $sqldoc=$sqldoc."WHERE ((documents.docid)=".$rmydocid.") ORDER BY docorder;"; } else {if(!is_numeric($rmysrub)){exit;} $sqldoc="SELECT documents.docid, documents.doctitle, documents.docbody, m_categorie.catTitle, m_rubrique.rublibelle, m_sousrubrique.srubLibelle "; $sqldoc=$sqldoc."FROM (m_rubrique INNER JOIN (m_categorie INNER JOIN documents ON m_categorie.catId = documents.catId) ON (m_categorie.catId = m_rubrique.catId) AND (m_rubrique.rubid = documents.rubid)) INNER JOIN m_sousrubrique ON (m_rubrique.rubid = m_sousrubrique.rubid) AND (documents.srubid = m_sousrubrique.srubid) "; $sqldoc=$sqldoc."WHERE (((documents.docid)=".$rmydocid.")) ORDER BY docorder;"; } if (isset($_GET['action'])) $action=$_GET['action']; else $action="" ; // get action request $rsdoc=mysql_query($sqldoc) or die ("Erreur : ". mysql_error()) ; if (mysql_num_rows($rsdoc) != 0) // if no records found { // show location if ($rmysrub=="") { // if a requested doc from search engine // show location if ($action=="showdoc") { //print "  ".mysql_result($rsdoc,0,"catTitle")."  ".mysql_result($rsdoc,0,"rublibelle"); } else { // print "  ".mysql_result($rsdoc,0,"catTitle")."  "."".mysql_result($rsdoc,0,"rublibelle")." "; } } else {if(!is_numeric($rmysrub)){exit;} // if a requested doc from search engine if ($action=="showdoc") { //print "  ".mysql_result($rsdoc,0,"catTitle")."  ".mysql_result($rsdoc,0,"rublibelle")."  ".mysql_result($rsdoc,0,"srublibelle").""; } else { //print "  ".mysql_result($rsdoc,0,"catTitle")."  ".mysql_result($rsdoc,0,"rublibelle")."  "."".mysql_result($rsdoc,0,"srublibelle")." "; } } //print "

"; // yes count RS = 1 show doc print "".mysql_result($rsdoc,0,"rublibelle")." / ".mysql_result($rsdoc,0,"doctitle").""; print "
".mysql_result($rsdoc,0,"docbody")."
"; ?>
"; mysql_free_result($rsdoc); // close & kill doc rs } } echo ""; require_once "common/footer.php"; ?>