Location: PHPKode > projects > paperasse > paperasse/creer_traitement.php
<?php
# ---------------------------------------
# Paperasse (c) 2006 Guillaume BETTAYEB
# mail and documents management web page
# hide@address.com
# ---------------------------------------
@include_once('paperasse.conf.php');

extract($HTTP_GET_VARS);
$sql 	= "SELECT * FROM `$type` WHERE id=$id";
$query	= mysql_query($sql) OR die(mysql_error($query));
switch($type){
	case 'papiers':
		list($id, $modalite, $date,$datepapier,$dossier,$utilisateur,$contact,$objet) = mysql_fetch_row($query);
		$document	= "<p class=\"texte\">modalit&eacute; : $modalite<br>enregistr&eacute; le : ".InverserDate(str_replace('-','/',$date))."<br>dat&eacute; du : ".InverserDate(str_replace('-','/',$datepapier))."<br>dossier : $dossier<br>utilisateur : $utilisateur<br>contact : $contact<br>objet : $objet<br></p>";
	break;
	case 'factures':
		list($id,$contact,$utilisateur,$montant,$date,$datefacture) = mysql_fetch_row($query);
		$document	= "<p class=\"texte\">contact : $contact<br>utilisateur : $utilisateur<br>montant : $montant<br>enregistr&eacute; le : $date<br>date de la facture : $datefacture</p>";
	break;
}

$sql 				= 'SELECT * FROM `grp_traitements`';
$query				= mysql_query($sql) OR die(mysql_error());
$grp_traitements	= false;
while($array = mysql_fetch_row($query)){
	$grp_traitements.="<option value=".$array[0].">".$array[1]."</option>";
}

$sql 			= 'SELECT * FROM `utilisateurs`';
$query			= mysql_query($sql) OR die(mysql_error());
$utilisateurs	= false;
while($array = mysql_fetch_row($query)){
	$utilisateurs.="<option value=".$array[0].">".$array[1]."</option>";
}
?>
<form name="creer_traitement" method="post" action="index.php?page=creer_traitement_resultat">
  <table width="52%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableau">
    <tr> 
      <td colspan="3" class="texte"><div align="center">CREER UN TRAITEMENT</div></td>
    </tr>
    <tr> 
      <td width="26%" valign="top" class="texte"> <div align="center">document</div></td>
      <td width="11%" valign="top">
<input name="id_doc" type="hidden" id="id_doc" value="<?php echo $id; ?>">
        <span class="texte">n&deg;<?php echo $id; ?></span></td>
      <td width="63%"><?php echo $document; ?></td>
    </tr>
    <tr> 
      <td valign="top" class="texte"> <div align="center">groupe de traitement</div></td>
      <td colspan="2"><select name="id_grp" class="bouton" id="id_grp">
        <?php echo $grp_traitements; ?>
		</select></td>
    </tr>
    <tr> 
      <td valign="top" class="texte"> <div align="center">date butoire</div></td>
      <td colspan="2">
	  	  <input name="jour" type="text" class="bouton" id="jour" value="<?php echo date('m'); ?>" size="2" maxlength="2">
        - <input name="mois" type="text" class="bouton" id="mois" value="<?php echo date('m'); ?>" size="2" maxlength="2">
        - 
        <input name="annee" type="text" class="bouton" id="annee" value="<?php echo date('Y'); ?>" size="4" maxlength="4"></td>
    </tr>
    <tr> 
      <td valign="top" class="texte"> <div align="center">utilisateur traitant</div></td>
      <td colspan="2"><select name="utilisateur" class="bouton" id="utilisateur">
        <?php echo $utilisateurs; ?>
		</select></td>
    </tr>
    <tr> 
      <td valign="top" class="texte"> <div align="center">notes</div></td>
      <td colspan="2"><textarea name="note" cols="50" rows="10" class="bouton" id="note"></textarea></td>
    </tr>
    <tr> 
      <td colspan="3"><div align="center">
          <input name="Submit" type="submit" class="bouton" value="Enregistrer ce traitement">
        </div></td>
    </tr>
  </table>
</form>
Return current item: paperasse