Location: PHPKode > projects > Ordertool > orders/admin/genehmigung/bl_toc.php
<HTML>
<HEAD>
<TITLE>Bestellung </TITLE>
</HEAD>
<body bgcolor=#ffffff link=#008000 vlink=#008000>
<? 
/*========================================
ORDERTOOL written in PHP
code : uwe k <hide@address.com>
lic : Artistic License

For more information see LICENSE
==========================================*/
$migration="yes";			// MIGRATION
require ("../incl/conn.inc.php"); 	// Connection
$room="GRANT";				// Auth-Level
require ("../incl/auth.inc.php");	// Authorization
require ("../incl/header.inc.php");

switch ($action) {
  case "Bounce_BL";
    $link->query("UPDATE inquiry set bl = '$vadder' WHERE $id = '$ident'");   
    include ("../incl/mail2.phtml");    // MAIL
    echo "<CENTER><hr WIDTH=50%>
    <tt>IBN $ident wurde $vadder zugewiesen.</tt><br><hr WIDTH=50%></center>";
  break; 
  
  case "end";  // Richtige Stufe zugewiesen
    if (isset($granted)) {
      $stati='2';
      $log_action = "Genehmigt";
      $up_stat = "UPDATE inquiry SET kst = '$kst',
      o_bez = '$o_bez', o_misc = '$o_misc', o_amount = '$o_amount',
      o_preis = '$o_preis', status = '$stati'";
      $up_stat .= " WHERE $id = '$ident'";
      debugg (1,$up_stat);
      $link->query($up_stat);
      if (isset($vcomment))
      $link->query("UPDATE validation set comment = '$vcomment' WHERE i_nr = '$ident'");
      $gesamtpreis = ($o_preis * $o_amount);
      include ("../incl/mail2.phtml");  
      echo "<CENTER><hr WIDTH=50%>
      <tt>IBN $ident wurde an den Einkauf weitergeleitet.</tt><br><hr WIDTH=50%></center>";
   }
    else {
       $stati='9';
       $log_action = "Abgelehnt (AL)";
       include ("../incl/mail2.phtml");        // MAIL
       if (isset($vcomment))
       $link->query("UPDATE validation set comment = '$vcomment' WHERE i_nr = '$ident'");
       include ("../incl/archive.inc.php"); 	   //### Archiv ##
       echo "<CENTER><hr WIDTH=50%>
      <tt>IBN $ident wurde abgelehnt.</tt><br><hr WIDTH=50%></center>";
   }   
    
 logg ($ident,$log_action,$REMOTE_USER,$luser,$link); // ### LOG ###
   
} // switch ($action)

$amount_stat = "SELECT count(*) from inquiry ";
$amount_stat .= "WHERE status = '1' and bl like '%$REMOTE_USER%'";

$inq_stat = "SELECT * from inquiry i ";
$inq_stat .= " WHERE status = '1' 
     	     and bl like '%$REMOTE_USER%' order by $id";

// Anzahl der offenen Bestellungen
$amount_result = $link->query($amount_stat);
$amount_row = $link->fetch_array($amount_result);
 
echo "<CENTER><tt>Offene Bestellungen ($amount_row[0])</tt></center>";


$inq_result = $link->query($inq_stat);
$inq_num = $link->num_rows($inq_result);
 
if ($inq_num >0) { 
 echo "<TABLE WIDTH=90% align=center
 cellpadding=2 cellspacing=2 BGCOLOR=#E5EDE0 border=1>
 <TR>
 <TD align=center><tt>IBN</tt></TD>
 <TD align=center><tt>Datum</tt></TD>
 <TD align=left><tt>&nbsp;Login</tt></TD>
 <TD align=left><tt>&nbsp;Artikel</tt></TD>    
 <td BGCOLOR=#E5E0F0 align=center><tt>Aktion</tt></TD>
 </TR>";
 for ($i = 0; $i < $inq_num; $i++) {
   $inq_row = $link->fetch_array($inq_result);
   $gesamtpreis = $inq_row[o_amount] * $inq_row[o_preis];
//   if ($gesamtpreis <= $lead_row[limes]) {
     include ("../incl/prioritaet.inc.php3");	// Priorit├Ąt
     echo "<TR><TD COLSPAN=1 align=center BGCOLOR=$prio>
     <B><sub>$inq_row[$id]</sub></B></TD>";
     // DATUM TT.MM.YYYY
     ereg( "([0-9]{2})-([0-9]{1,2})-([0-9]{1,2})",$inq_row[inq_datum], $regs );
     echo "<TD align=center><sub>$regs[3].$regs[2].$regs[1]</sub></TD>
     <TD COLSPAN=1 align=left><B><sub>&nbsp;$inq_row[u_login]</sub></B></TD>
     <TD COLSPAN=1 align=left>
     <tt>$inq_row[o_amount] x  <b>$inq_row[o_bez]</b></tt><br>";
     if ($inq_row[o_misc]) echo"<sub>$inq_row[o_misc]</sub><br><br>";
     echo"<sub>Einzelpreis: $inq_row[o_preis] DM  &nbsp;&nbsp;&nbsp;
     (Gesamtpreis $gesamtpreis DM)</sub></TD>";
     echo "<FORM ACTION='grant.php' METHOD=POST>
     <td BGCOLOR=#E5E0F0 ALIGN=CENTER>
     <input TYPE=submit VALUE='Bearbeiten'></td></TR>
     <input TYPE=hidden name=ident VALUE='$inq_row[$id]'></FORM>";
//   }
 } // for   
 echo "</TABLE></CENTER>";   
} 
include ("../incl/footer.inc.php"); 
?>
</BODY></HTML>
Return current item: Ordertool