Location: PHPKode > projects > paperasse > paperasse/consulter_traitements.php
<?php
# ---------------------------------------
# Paperasse (c) 2006 Guillaume BETTAYEB
# mail and documents management web page
# hide@address.com
# ---------------------------------------
@include_once('paperasse.conf.php');
function Traitement_Papiers($id){
	$sql		= "SELECT `id`, `datepapier`, `dossier`, `utilisateur`, `contact` FROM `papiers` WHERE id=$id";
	$query		= mysql_query($sql) OR die(mysql_error());
	$array		= mysql_fetch_array($query);
	extract($array);
	
	$sql		= "SELECT * FROM `dossiers` WHERE id=$dossier";
	$query		= mysql_query($sql) OR die(mysql_error());
	$dossier	= mysql_fetch_array($query);
	
	$sql		= "SELECT `id`,`nom` FROM `utilisateurs` WHERE id=$utilisateur";
	$query		= mysql_query($sql) OR die(mysql_error());
	$utilisateur= mysql_fetch_array($query);
	
	$sql		= "SELECT `id`,`nom` FROM `contacts` WHERE id=$contact";
	$query		= mysql_query($sql) OR die(mysql_error());
	$contact	= mysql_fetch_array($query);
	
	return $Traitement_Papiers = "<p align=\"left\">Date : ".InverserDate(str_replace('-','/',$datepapier))."<br>
	Dossier : <a href=\"ajouter_dossier.php?id=".$dossier['id']."\"><font color=\"".$dossier['couleur']."\">".$dossier['nom']."</font></a><br>
	Utilisateur : <a href=\"ajouter_utilisateur.php?id=".$utilisateur['id']."\">".$utilisateur['nom']."</a><br>
	Contact : <a href=\"ajouter_contact.php?id=".$contact['id']."\">".$contact['nom']."</a><p>
	<a href=\"ajouter_papier.php?id=$id\">Consulter le document</a>";
}

function Traitement_Groupe($id){
	$sql	= "SELECT `id`, `nom` FROM `grp_traitements` WHERE id=$id";
	$query	= mysql_query($sql) OR die(mysql_error());
	$array	= mysql_fetch_array($query);
	extract($array);
	return $Traitement_Groupe = "<a href=\"index.php?page=ajouter_grp_traitement&id=$id\">$nom</a>";
}

function Traitement_Utilisateurs($id){
	$sql	= "SELECT `id`, `nom` FROM `utilisateurs` WHERE id=$id";
	$query	= mysql_query($sql) OR die(mysql_error());
	$array	= mysql_fetch_array($query);
	extract($array);
	return $Traitement_Groupe = "<a href=\"index.php?page=ajouter_utilisateur&id=$id\">$nom</a>";
}

function ListeTraitements(){
	$sql 	= 'SELECT * FROM `traitements` ORDER BY `id`';
	$query	= mysql_query($sql) OR die(mysql_error());
	while($array = mysql_fetch_array($query,MYSQL_ASSOC)){
		extract($array);
		echo "<tr><td align=\"center\" class=\"texte\">$id</td><td align=\"center\" class=\"texte\">".Traitement_Papiers($id_doc)."</td><td align=\"center\" class=\"texte\">".Traitement_Groupe($id_grp)."</td><td align=\"center\" class=\"texte\">".InverserDate(str_replace('-','/',$datemax))."</td><td align=\"center\" class=\"texte\">".Traitement_Utilisateurs($utilisateur)."</td><td align=\"center\" class=\"texte\">$note</td><td align=\"center\" class=\"texte\"><input type=\"checkbox\" class=\"bouton\" name=\"id\" value=\"$id\"></td></tr>";
	}
}
?>

<!-- Feuille de style-->  
<form name="consulter_traitements" method="post" action="index.php?page=consulter_traitements_resultats">
  <table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="tableau">
    <tr> 
      <td colspan="7"><div align="center" class="texte">LISTE DES TRAITEMENTS 
          en cours</div></td>
    </tr>
    <tr> 
      <td class="bouton">
<div align="center" class="bouton">N&deg;</div></td>
      <td class="bouton">
<div align="center" class="bouton">Document de r&eacute;f&eacute;rence</div></td>
      <td class="bouton">
<div align="center" class="bouton">groupe</div></td>
      <td class="bouton">
<div align="center" class="bouton">date butoire</div></td>
      <td class="bouton">
<div align="center" class="bouton">utilisateurs</div></td>
      <td class="bouton">
<div align="center" class="bouton">notes</div></td>
      <td><div align="center" class="bouton">supprimer</div></td>
    </tr>
	<?php echo ListeTraitements(); ?> 
    <tr> 
      <td colspan="7"><input name="Submit" type="submit" class="bouton" value="Supprimer les traitements s&eacute;l&eacute;ctionn&eacute;s"></td>
    </tr>
  </table>
</form>
Return current item: paperasse