while ($i < $num) {
     $taille = mysql_result($result, $i, taille);
     $num_article = mysql_result($result, $i, num_article);
     $publica = mysql_result($result, $i, publica);
     $titre_art = mysql_result($result, $i, titre_art);
     $date_crea = mysql_result($result, $i, date_crea);
     $archive = mysql_result($result, $i, archive);
     $sujet = mysql_result($result, $i, sujet);
     $titre_art = stripslashes($titre_art);
     $sujet = stripslashes($sujet);
     // Gestion de l'affichage des dates
     echo "  <tr>\n";
     $toto = affiche_date($date_crea);
     echo "<td class=\"loginFFFFFF\" align=\"center\" width=\"10%\">{$toto}</td>\n";
     echo "    <td class=\"loginFFFFFF\" align=\"center\" width=\"25%\">\n";
     taille($taille, $num_article, "articles", "gere");
     echo "    {$titre_art}&nbsp;</a></td>\n";
     echo "    <td class=\"loginFFFFFF\" align=\"center\" width=\"25%\">{$sujet}&nbsp;</td>\n";
     if ($publica != '') {
         echo "    <td class=\"loginFFFFFF\" align=\"center\" width=\"10%\">Oui</td>\n";
     } else {
         echo "    <td class=\"loginFFFFFF\" align=\"center\" width=\"10%\">&nbsp;</td>\n";
     }
     echo "    <td class=\"loginFFFFFF\" align=\"center\" width=\"10%\" bgcolor=FFCC66>\n";
     if ($publica == '') {
         taillemod($taille, $num_article, "articles");
         echo "    <img src=\"../images_pop/modification.gif\" border=\"0\"></a></td>\n";
     } else {
         echo "&nbsp;";
     }
     $tata = $num_article . "supp";
Exemple #2
0
$titre1 = homepage1($id_user, $service, $homepage);
echo "{$titre1['0']}";
?>
</td>
                    </tr>
                    <tr>
                      <td colspan="2" class="txt"><?php 
$formate = stripslashes($titre1[1]);
$formate = substr($formate, 0, 200);
echo "{$formate} ...";
?>
</td>
                    </tr>
                    <tr>
                      <td width="90%" height="26"><?php 
taille($titre1[4], $titre1[3]);
?>
détail de l'article</td>
                      <td valign="top" width="20" align="right"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <table width="100%" border="0" cellspacing="4" name="tab04">
                    <tr>
                      <td class="titrtabl" width="24%">date de cr&eacute;ation</td>
                      <td class="titrtabl" width="24%">titre</td>
                      <td class="titrtabl" width="24%">auteur</td>
                      <td class="titrtabl" width="24%">sujet</td>
        echo "  <tr>\n";
        echo "    <td class=\"loginFFFFFF\">\n";
        echo "      <div align=\"left\">{$date_crea}</div>\n";
        echo "    </td>\n";
        echo "    <td class=\"loginFFFFFF\">\n";
        echo "      <div align=\"left\">{$sal_prenom} {$sal_nom} </div>\n";
        echo "    </td>\n";
        echo "    <td class=\"loginFFFFFF\">\n";
        echo "      <div align=\"left\">&nbsp;{$titre_art}</div>\n";
        echo "    </td>\n";
        echo "    <td class=\"loginFFFFFF\">\n";
        echo "      <div align=\"left\">&nbsp;{$sujet}</div>\n";
        echo "    </td>\n";
        echo "    <td class=\"loginFFFFFF\" bgcolor=\"#FFCC66\">\n";
        echo "      <center>\n";
        taille($taille, $num_article, "archives", '');
        echo "      <img src=\"../images_pop/voir.gif\" width=\"61\" height=\"20\" border=\"0\"></a>\n";
        echo "      </center>\n";
        echo "    </td>\n";
        echo "    <td class=\"loginFFFFFF\">\n";
        echo "      <center>\n";
        echo "        <INPUT TYPE=\"CHECKBOX\" name=\"{$num_article}\" value=\"oui\">\n";
        echo "      </center>\n";
        echo "    </td>\n";
        echo "  </tr>\n";
        $i++;
    }
}
?>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
Exemple #4
0
function listing($service, $page)
{
    $nb = 3;
    $result2 = "SELECT * FROM articles WHERE ";
    $result2 .= "(nivo_conf = 1)";
    $result2 .= "and (id_art_serv = '{$service}')";
    //$result2 .= "and (homepage = '4') ";
    $result2 .= "and (publica != '')";
    $result2 .= "and (diffusion = '')";
    $result2 .= "order by date_modif desc";
    if (empty($page)) {
        $page = 1;
    }
    $requete = DatabaseOperation::query("{$result2}");
    $total = mysql_num_rows($requete);
    $debut = ($page - 1) * $nb;
    $result2 .= " LIMIT {$debut},{$nb}";
    if ($requete = @DatabaseOperation::query("{$result2}")) {
        while ($rows = mysql_fetch_array($requete)) {
            echo "<tr bgcolor=\"#FFFFCC\">";
            $titreart = stripslashes($rows[titre_art]);
            $sujetart = stripslashes($rows[sujet]);
            $date = $rows[date_crea];
            $jour = substr($date, 8, 2);
            $mois = substr($date, 5, 2);
            $annee = substr($date, 0, 4);
            $date = $jour . "/" . $mois . "/" . $annee;
            echo "<td class=\"txttabl\" width=\"22%\">{$date}</td>";
            echo "<td class=\"txttabl\" width=\"24%\">{$titreart}</td>";
            echo "<td class=\"txttabl\" width=\"24%\">";
            $ab = DatabaseOperation::query("select * from salaries where id_user='******'auteur']}'");
            $ligne = mysql_fetch_array($ab);
            echo "{$ligne['nom']} {$ligne['prenom']}</td>";
            echo "<td class=\"txttabl\" width=\"24%\">{$sujetart}<br>";
            taille($rows[taille], $rows[num_article]);
            echo "détail de l'article</a></td>";
        }
    }
    echo "</tr>";
    echo "</table>";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"4\">";
    echo "<tr>";
    echo "<td width=80% align=center>";
    $nbpages = ceil($total / $nb);
    for ($i = 1; $i <= $nbpages; $i++) {
        echo "<a href=\"{$PHP_SELF}?page={$i}&service={$service}\"><font size=1 color=#000000><b>";
        if ($page == $i) {
            echo "<font color=#FF6600><b>  page{$i} </b></font></a>\n";
        } else {
            echo "<font color=#000000><b>  page{$i} </b></font></a>\n";
        }
        if ($i < $nbpages) {
            echo " - ";
        }
    }
    echo "</td>";
}
function contenu_dir($nom_rep)
	{
	global $font,$id,$sens,$ordre,$rep,$poidstotal;
	
	// LECTURE DU REPERTOIRE ET CLASSEMENT DES FICHIERS
	list($liste,$poidstotal)=listing($nom_rep);
		
	// AFFICHAGE
	if(is_array($liste))
		{
		while (list($fichier,$mime) = each($liste))
			{
			// DEFINITION DU LIEN SUR LE FICHIER
			if(is_dir("$nom_rep/$fichier"))
				{
				$lien="index.php3?id=$id&sens=$sens&ordre=$ordre&rep=";
				if($rep!=""){$lien.="$rep/";}
				$lien.=$fichier;
				$affiche_copier="non";
				}
			else 
				{
				$lien="";
				if($rep!=""){$lien.="$rep/";}
				$lien.=$fichier;
				$lien="javascript:popup('$lien')";
				$affiche_copier="oui";
				}
			
			// AFFICHAGE DE LA LIGNE
			echo "<tr>\n";
			echo "<td><font face=\"$font\" size=\"2\">\n";
			if(is_editable($fichier) || is_image($fichier) || is_dir("$nom_rep/$fichier")) {echo "<a href=\"$lien\">";}
			echo "<img src=\"images/".mimetype("$nom_rep/$fichier","image")."\" width=\"20\" height=\"20\" align=\"ABSMIDDLE\" border=\"0\">";
			echo "$fichier";
			if(is_editable($fichier) || is_image($fichier) || is_dir("$nom_rep/$fichier")) {echo "</a>\n";}
			echo "</font></td>\n";
			echo "<td width=\"11%\"><font face=\"$font\" size=\"1\">";
			echo taille("$nom_rep/$fichier");
			echo "</font></td>\n";
			echo "<td width=\"15%\"><font face=\"$font\" size=\"1\">";
			echo mimetype("$nom_rep/$fichier","type");
			echo "</font></td>\n";			
			echo "<td width=\"17%\"><font face=\"$font\" size=\"1\">";
			echo date_modif("$nom_rep/$fichier");
			echo "</font></td>\n";
			echo "<td width=\"21%\">";
			
			// IMAGE COPIER
			if($affiche_copier=="oui")
				{
				echo "<a href=\"index.php3?id=$id&action=copier&sens=$sens&ordre=$ordre&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
				echo "$fichier\"><img src=\"images/copier.gif\" alt=\"$mess[66]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
				}
			else
				{
				echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";
				}

			// IMAGE DEPLACER
			if($affiche_copier=="oui")
				{
				echo "<a href=\"index.php3?id=$id&action=deplacer&ordre=$ordre&sens=$sens&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
				echo "$fichier\"><img src=\"images/deplacer.gif\" alt=\"$mess[70]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
				 }
			else {echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";}

			// IMAGE RENOMMER
			echo "<a href=\"index.php3?id=$id&ordre=$ordre&sens=$sens&action=rename&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
			echo "$fichier\"><img src=\"images/renommer.gif\" alt=\"$mess[6]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
			
			// IMAGE SUPPRIMER
			echo "<a href=\"index.php3?id=$id&action=supprimer&ordre=$ordre&sens=$sens&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
			echo "$fichier\"><img src=\"images/supprimer.gif\" alt=\"$mess[7]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";

			// IMAGE EDITER
			if(is_editable($fichier) && !is_dir("$racine/$fichier"))
				{
				echo "<a href=\"index.php3?id=$id&ordre=$ordre&sens=$sens&action=editer&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
				echo "$fichier\"><img src=\"images/editer.gif\" alt=\"$mess[51]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
				}
			else {echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";}
			
			// IMAGE TELECHARGER
			if($affiche_copier=="oui")
				{
				echo "<a href=\"index.php3?id=$id&action=telecharger&fichier=";
				if($rep!=""){echo "$rep/";}
				echo "$fichier\">";
				echo "<img src=\"images/download.gif\" alt=\"$mess[88]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
				}
							
			echo "</td>\n";				
			echo "</tr>\n";
			}
		}	
	}
            $sujet = stripslashes($sujet);
            echo "  <tr>\n";
            echo "    <td class=\"loginFFFFFF\">\n";
            echo "      <div align=\"left\">&nbsp;{$date_crea}</div>\n";
            echo "    </td>\n";
            echo "    <td class=\"loginFFFFFF\">\n";
            echo "      <div align=\"left\">&nbsp;{$sal_prenom} {$sal_nom} </div>\n";
            echo "    </td>\n";
            echo "    <td class=\"loginFFFFFF\">\n";
            echo "      <div align=\"left\">&nbsp;{$titre_art} </div>\n";
            echo "    </td>\n";
            echo "    <td class=\"loginFFFFFF\">\n";
            echo "      <div align=\"left\"> &nbsp;{$sujet}</div>\n";
            echo "    </td>\n";
            echo "    <td class=\"loginFFFFFF\"  bgcolor=FFCC66>\n";
            taille($taille, $num_article, "articles", "pub");
            echo "      <img src=\"../images_pop/publier.gif\" width=\"130\" height=\"20\" border=\"0\" alt=\"Vérifier l'article avant publication\"></a>\n";
            echo "    </td>\n";
            echo "    <td class=\"loginFFFFFF\" bgcolor=FFCC66><a href=\"article_publier.php?supp=ok&num_article={$num_article}\"><img src=\"../images_pop/supprimer.gif\" border=\"0\" width=\"130\" height=\"20\" alt=\"Supprimer l'article. Pas de publication\"></a>\n";
            echo "    </td>\n";
            echo "  </tr>\n";
        }
        $i++;
    }
}
?>
      </table>
    </td>
  </tr>
</table>
<?php 
function listing($id_user, $service, $page)
{
    /* -- $n varible qui defini le nombre de ligne qui s'affichent dans le listing -- */
    if ($id_user) {
        //Si l'utilisateur est connécté
        $affichage = DatabaseOperation::query("select * from perso where id_user={$id_user}");
        $na = mysql_fetch_array($affichage);
    }
    if (!$na[nbligne]) {
        $nb = 20;
    } else {
        $nb = $na[nbligne];
    }
    /* --- choix de l'order en fonction du choix utilisateur et definition si po encore inscrit --- */
    if (!$na[date]) {
        $order = "desc";
    } else {
        if ($na[date] == 1) {
            $order = "";
        } else {
            if ($na[date] == 2) {
                $order = "desc";
            }
        }
    }
    if ($id_user) {
        //Si l'utilisateur est connecté
        /* systeme d'exclusion ou non des infos deja lu */
        if (!$na[lu]) {
            $result2 = "SELECT * FROM modes, articles left join lu on (articles.num_article = lu.id_art) and (lu.id_user = {$id_user})  WHERE lu.id_art is null and (modes.id_user = {$id_user})";
        } else {
            if ($na[lu] == 1) {
                $result2 = "SELECT * FROM articles, modes WHERE (modes.id_user = {$id_user}) ";
            } else {
                if ($na[lu] == 2) {
                    $result2 = "SELECT * FROM modes, articles left join lu on (articles.num_article = lu.id_art) and (lu.id_user = {$id_user})  WHERE lu.id_art is null and (modes.id_user = {$id_user})";
                }
            }
        }
        /* retrouver le niveau du user dans la table mode et sortir les articles en fonction de ce nivo modes */
        $result2 .= "and (articles.id_art_serv = modes.id_service)";
        $result2 .= "and (articles.nivo_conf <= modes.serv_conf)";
        /* ---- defini la page service sur laquelle on se trouve ---- */
        $result2 .= "and (articles.id_art_serv = '{$service}')";
        //$result2 .= "and (articles.homepage = '4') ";
        $result2 .= "and (articles.publica != '')";
        $result2 .= "and (articles.diffusion = '')";
        /* rajouter dans l'order l'ordre souhaité par l'utilisateur */
        $result2 .= "order by date_modif {$order} ";
    } else {
        /* systeme d'exclusion ou non des infos deja lu */
        /*
         if(!$na[lu]){$result2 ="SELECT * FROM modes, articles left join lu on (articles.num_article = lu.id_art) and (lu.id_user = $id_user)  WHERE lu.id_art is null and (modes.id_user = $id_user)";}
         else if($na[lu]==1){$result2 ="SELECT * FROM articles, modes WHERE (modes.id_user = $id_user) ";}
         else if($na[lu]==2){$result2 ="SELECT * FROM modes, articles left join lu on (articles.num_article = lu.id_art) and (lu.id_user = $id_user)  WHERE lu.id_art is null and (modes.id_user = $id_user)";}
         $result2 .= "and (articles.id_art_serv = modes.id_service)";
         $result2 .= "and (articles.nivo_conf <= modes.serv_conf)";
         $result2 .= "and (articles.id_art_serv = '$service')";
         //$result2 .= "and (articles.homepage = '4') ";
         $result2 .= "and (articles.publica != '')";
         $result2 .= "and (articles.diffusion = '')";
         $result2 .= "order by date_modif $order ";
        */
        $date_limite = date("Y-m-d", mktime(0, 0, 0, date("m") - 4, date("d"), date("Y")));
        $result2 = "SELECT * FROM  articles  WHERE ";
        /* retrouver le niveau du user dans la table mode et sortir les articles en fonction de ce nivo modes */
        //$test .= " and (articles.id_art_serv = modes.id_service)";
        $result2 .= " (articles.nivo_conf = '1')";
        //    $test .= " and (articles.homepage = '$homepage') ";
        /* ---- defini la page service sur laquelle on se trouve ---- */
        $result2 .= " and (articles.id_art_serv = '{$service}') ";
        $result2 .= " and (articles.publica != '') ";
        $result2 .= " and (articles.diffusion = '') ";
        $result2 .= "and (articles.date_modif > '{$date_limite} 00:00:00' ) ";
        /* --- on rajoute la fonction du non lu pour ordonner si on le souhaite --- */
        $result2 .= "order by articles.nivo_conf desc, date_modif DESC limit 0,1";
    }
    if (empty($page)) {
        $page = 1;
    }
    $requete = DatabaseOperation::query("{$result2}");
    $total = mysql_num_rows($requete);
    $debut = ($page - 1) * $nb;
    $result2 .= "LIMIT {$debut},{$nb}";
    if ($requete = @DatabaseOperation::query("{$result2}")) {
        while ($rows = mysql_fetch_array($requete)) {
            echo "<tr bgcolor=\"#FFFFCC\">";
            /* ------------
               formatage date
               ------------- */
            $date = $rows[date_crea];
            $jour = substr($date, 8, 2);
            $mois = substr($date, 5, 2);
            $annee = substr($date, 0, 4);
            $date = $jour . "/" . $mois . "/" . $annee;
            $titreart = stripslashes($rows[titre_art]);
            $auteurart = stripslashes($rows[auteur]);
            $sujetart = stripslashes($rows[sujet]);
            echo "<td class=\"txttabl\" width=\"22%\">{$date}</td>";
            echo "<td class=\"txttabl\" width=\"24%\">{$titreart}</td>";
            echo "<td class=\"txttabl\" width=\"24%\">";
            $ab = DatabaseOperation::query("select * from salaries where id_user='******'");
            $ligne = mysql_fetch_array($ab);
            echo "{$ligne['nom']} {$ligne['prenom']}</td>";
            echo "<td class=\"txttabl\" width=\"24%\">{$sujetart}<br>";
            taille($rows[taille], $rows[num_article]);
            echo "détail de l'article</a></td>";
            echo "<td align=\"center\" bgcolor=\"#FFFFFF\"><img src=\"../zimages/";
            $nomimg = imagelu($rows[num_article], $id_user);
            echo "{$nomimg}";
            echo "\" width=\"20\" height=\"24\"></td>";
        }
    }
    echo "</tr>";
    echo "</table>";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"4\">";
    echo "<tr>";
    echo "<td width=80% align=center>";
    $nbpages = ceil($total / $nb);
    for ($i = 1; $i <= $nbpages; $i++) {
        echo "<a href=\"{$PHP_SELF}?page={$i}&service={$service}\"><font size=1 color=#000000><b>";
        if ($page == $i) {
            echo "<font color=#FF6600><b>  page{$i} </b></font></a>\n";
        } else {
            echo "<font color=#000000><b>  page{$i} </b></font></a>\n";
        }
        if ($i < $nbpages) {
            echo " - ";
        }
    }
    echo "</td>";
}