save.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <html>
  2. <head><title>Werte sichern</title></head>
  3. <body>
  4. <?php
  5. include("config/constants.inc");
  6. include("classes/class.sql.inc");
  7. include("classes/class.save.inc");
  8. include("config/sqlconnect.inc");
  9. $abfrage = new saveValues();
  10. $abfrage->table = "nbz";
  11. $abfrage->db = &$db;
  12. $abfrage->structure = array("Betrieb","Kst","Bez_Id");
  13. $abfrage->format = array(
  14. 'Jan' => "float",
  15. 'Feb' => "float",
  16. 'März' => "float",
  17. 'Apr' => "float",
  18. 'Mai' => "float",
  19. 'Juni' => "float",
  20. 'Juli' => "float",
  21. 'Aug' => "float",
  22. 'Sept' => "float",
  23. 'Okt' => "float",
  24. 'Nov' => "float",
  25. 'Dez' => "float",
  26. 'Betrag_Jahr' => "float"
  27. );
  28. $abfrage->link = $_POST['link'];
  29. $abfrage->defaults = array(
  30. 'IST_PLAN' => $_POST['IST_PLAN'],
  31. 'Jahr' => $_POST['Jahr']
  32. );
  33. $abfrage->primary = "Id";
  34. $abfrage->where = "IST_PLAN = '{$_POST['IST_PLAN']}' AND Jahr = {$_POST['Jahr']}";
  35. $abfrage->decategorize($_POST['value']);
  36. $abfrage->perform(0);
  37. $table = $_POST['table'];
  38. $sql = "TRUNCATE {$table}";
  39. $erg = $db->sql_exec($sql);
  40. $sql = "INSERT INTO {$table} SELECT *,'' FROM {$abfrage->table}";
  41. $erg = $db->sql_exec($sql);
  42. $db->sqlbox_anzeigen();
  43. $abfrage->linkup();
  44. ?>
  45. </body>
  46. </html>