Location: PHPKode > projects > Ordertool > orders/admin/buchhaltung/anla.php
<HTML>
<HEAD>
<TITLE>Bestellung </TITLE>
</HEAD>
<body bgcolor=#ffffff>
<?
/*========================================
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="ACCOUNT";			// Auth-Level
require ("../incl/auth.inc.php");	// Authorization

include ("../incl/header.inc.php");

// Datum
$evidencedate = date("Y-m-d");
  
 switch ($action) {  
  
  case "update";
    $table = inquiry;
    $query = "UPDATE $table SET status = '$stati'";
    $query .= " WHERE $id = '$ident'";
    $link->query($query);
		
   switch ($stati) {
   
    case "4";	// ANLA ? (JA)   
    $anla = 'ja'; $log_action = 'Inv. ? -> JA';
    
    break;
  
    case "5";	// ANLA ? (NEIN)   
    $anla = 'nein'; $log_action = 'Inv. ? -> NEIN';
   
    break;
    
    case "9";   // *** ARCHIVE ***
    $log_action = 'Anlagevermoegen';
    include ("../incl/archive.inc.php");
    echo "<br><center><tt>IBN: $ident wurde ins Anlageverm&ouml;gen
    aufgenommen und ins Archiv verschoben.</tt></center><br>";
    break; // stati==9
    
   } // switch stati 

   // ### LOG ###
   logg ($ident,$log_action,$REMOTE_USER,$stati,$link);
    
  break; // update

  } // switch action 
 
 // Anlagenbuchhaltung ?
 $result = $link->query("SELECT count(*) from inquiry WHERE status = '3'");
 $row1 = $link->fetch_array($result);
 // Anlagenbuchhaltung !
 $result = $link->query("SELECT count(*) from inquiry WHERE status = '6'");
 $row2 = $link->fetch_array($result);
 
 echo"<!-- Header -->
 <table BORDER=0 WIDTH=60% cellpadding=2 align=center>
 <tr><td BGCOLOR=#CDCDCD ALIGN=CENTER><tt>
 Anlagenbuchhaltung ?  ($row1[0])</tt></td>
 <td BGCOLOR=#E5EDE0 ALIGN=CENTER><tt>
 Anlagenbuchhaltung !  ($row2[0])</tt></td>
 </tr></table><BR>";
    
  ///////////////////////// ANLA ? (3) 
  $result = $link->query("SELECT * from inquiry WHERE status = '3'");
  $inq_num = $link -> num_rows ($result);
  
  // ++++++++++++  1. Bedingung  ++++++++++++++++++++
  
  if ($inq_num >0) { 
  $fraglich = '1';
   for ($i = 0; $i < $inq_num; $i++) {
     $inq_row = $link->fetch_array($result);
    
     // ######## IDENT
     $ident_3 = $inq_row[$id];
     
     echo "<TABLE WIDTH=90% cellpadding=2 cellpadding=4 BGCOLOR=#CDCDCD align=center>
     <TR><TD align=center><tt>Bestell-Nr. <B>$ident_3</B></tt></TD></TR>
     <TR><TD><tt>Ware: $inq_row[o_amount] x $inq_row[o_bez]  a´ $inq_row[o_preis] DM</tt></TD></TR>";
     if ($inq_row[o_misc]) echo"<TR><TD><tt>Sonstiges : $inq_row[o_misc]</tt></TD></TR>
     <FORM ACTION='$PHP_SELF' METHOD=POST>
     <TR> 
     <TD BGCOLOR=#E5E0F0><tt>Inventarisierung notwendig ?</tt>
     <select NAME=stati>
	  <OPTION value='4'>Ja
	  <OPTION value='5'>Nein
     </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     <input TYPE=submit VALUE='Fertig'></td></TR>
     <input TYPE=hidden name=ident VALUE='$ident_3'>
     <input TYPE=hidden name=action VALUE=update>
     </FORM></TABLE><BR clear=all><BR>";
   } // for   
   echo"<hr width=50%>";
  } // if ($inq_num >0)
	 
  ///////////////////////// ANLA ! (6) ///////////////////////////////////
  
  // INQUIRY
  $result = $link->query("SELECT * from inquiry WHERE status = '6'");
  $ina_num = $link -> num_rows ($result);
 
  // ++++++++++++  1. Bedingung  ++++++++++++++++++++
  
  if ($ina_num >0) { 
   $ina = '1';
   for ($i = 0; $i < $ina_num; $i++) {
   
  $ina_row =  $link->fetch_array($result); 
  
  // ######## IDENT
  $ident_6 = $ina_row[$id];
  
  // ACCOUNT
  $res1 = $link->query("SELECT * from account WHERE i_nr = '$ident_6'"); 
  $acu_row = $link->fetch_array($res1); 
  
    // Kostenstellen-Bezeichnung
  $res2 = $link->query("SELECT name from kst WHERE $id = '$ina_row[kst]'");
  $k_row = $link->fetch_array($res2);
  
  $k_name = $k_row[0]; 
  
  echo "<TABLE WIDTH=90% cellpadding=2 cellspacing=3 BGCOLOR=#E5EDE0 align=center>
  <TR>
  <TD COLSPAN=1 align=center><tt>
  Bestell-Nr. <B>$ident_6</tt></B></TD> 
  <TD COLSPAN=1 align=center><tt>
  Inventar-Nr. <B>$acu_row[inv_nr]</tt></B></TD> 
  </TR><TR>  
  <TD colspan=2><tt>Ware: $ina_row[o_amount] x $ina_row[o_bez]  a´  $ina_row[o_preis] DM</tt></TD>
  </TR>";
  if ($ina_row[o_misc]) echo"<TR><TD COLSPAN=2><tt>Sonstiges : $ina_row[o_misc]</tt></TD></TR>";
  if ($acu_row[o_misc]) 
  echo"<TR><TD COLSPAN=2><tt>Kommentar (Ausgabestelle): $acu_row[bv_comment]</tt></TD></TR>";
  echo"<TD COLSPAN=2><tt>Kostenstelle : ($ina_row[kst]) $k_name</tt></TD></TR>
  
  <FORM ACTION='$PHP_SELF' METHOD=POST>";
  
  if ($acu_row[beleg_art_bv]=='Lieferschein') {
  
  echo "<TR>
  <TD colspan=2><tt>Beleg-Nr: $acu_row[beleg_nr_bv] ($acu_row[beleg_art_bv])</tt></TD>
  </TR>     
  <TR><TD BGCOLOR=#E5E0F0>Belegart : 
  <select NAME=beleg_art_acc>
       <OPTION value='Rechnung'>Rechnung
       <OPTION value='Lieferschein'>Lieferschein
  </select></TD>
  <TD COLSPAN=1 BGCOLOR=#E5E0F0>Beleg-Nr. :
  <INPUT NAME='beleg_nr_acc' SIZE=20 MAXLENGTH=20></TD>
  </TR>";
  }
  else {
  echo "<TR>
  <TD colspan=1>Belegart : $acu_row[beleg_art_bv]</TD> 
  <TD colspan=1>Beleg-Nr : $acu_row[beleg_nr_bv]</TD>
  </TR>";
  
  }
  echo "<TR> 
  <TD VALIGN=TOP COLSPAN=1 BGCOLOR=#E5E0F0> Kommentar: 
  <textarea name='acc_comment' rows=3 cols=40></textarea></TD>
  <td BGCOLOR=#66CC00 ALIGN=CENTER VALIGN=MIDDLE COLSPAN=2>
  <input TYPE=submit VALUE='Ins Anlagevermögen aufnehmen'></td> 
  </TR>
  <input TYPE=hidden name=ident VALUE='$ident_6'>
  <input TYPE=hidden name=action VALUE=update>
  <input TYPE=hidden name=stati VALUE='9'>
  </FORM></TABLE><BR>
  <hr width=50%><BR><BR>";
   } // for   
 } // if ($ina_num >0)

// NIX da !

if ($kopf==1 && $fraglich!=1 && $ina!=1) include ("../incl/exit.inc.php3");  

?>
</BODY></HTML>
Return current item: Ordertool