save_report.php 931 B

123456789101112131415161718192021
  1. <?php
  2. include 'con.php';
  3. //error handling
  4. ini_set('display_errors', 1);
  5. error_reporting(E_ALL);
  6. $action = $_POST['action'];
  7. $sql1 = "SELECT ACTION_ID FROM DTC_ACTION WHERE NAME_DE = '{$action}'";
  8. $actionID = sqlStm($sql1)['ACTION_ID'][0];
  9. $toolPart = $_POST['toolPart'];
  10. $sql2 = "SELECT TOOLPART_ID FROM DTC_TOOLPART WHERE NAME_DE = '{$toolPart}'";
  11. $toolPartID = sqlStm($sql2)['TOOLPART_ID'][0];
  12. $request = 1;
  13. $curr_time = date("d.m.Y h:i:s");
  14. $sql = "INSERT INTO DTC_TOOL_LC_EVENT (TLC_EVENT_ID,DATE_TIME,TOOL_ID,ACTION_ID,ARTICLE_ID,WORKER_ID,PRODUCTION_ORDER_ID,MACHINE_ID,COMMENTS,PRODUCED_QUANTITY,TOOLPART_ID,REQUEST) VALUES (LCSEQ.NEXTVAL,TO_TIMESTAMP('{$curr_time}','DD.MM.YYYY HH:MI:SS'),'{$_POST['toolID']}','{$actionID}','{$_POST['articleID']}','{$_POST['workerID']}','{$_POST['orderID']}','{$_POST['machineID']}','{$_POST['comment']}','{$_POST['quantity']}','{$toolPartID}','{$request}')";
  15. $res = sqlStm($sql);
  16. ?>