content; $printer = $row->printer; $origJob = json_decode($origJobJson, true); $refworkid = $origJob["workid"]; $table = $origJob["table"]; $time = $origJob["time"]; $products = $origJob["products"]; foreach ($products as $prod) { $id = $prod["id"]; if ($id == $queueid) { $kind = $prod["kind"]; $longname = $prod["longname"]; $price = $prod["price"]; $extrasArr = $prod["extras"]; $extrasStr = implode(",", $extrasArr); $cancelJob = array( "workid" => $workid, "refworkid" => $refworkid, "table" => $table, "time" => $time, "longname" => $longname, "kind" => $kind, "price" => $price, "extras" => $extrasStr); $cancelJobJson = json_encode($cancelJob); $printInsertSql = "INSERT INTO `%printjobs%` (`id` , `content`,`type`,`printer`) VALUES ( NULL,?,?,?)"; $stmt = $pdo->prepare(DbUtils::substTableAlias($printInsertSql)); $type = PrintQueue::$CANCELFOOD; if ($kind == 1) { $type = PrintQueue::$CANCELDRINK; } $stmt->execute(array($cancelJobJson,$type,$printer)); $idOfWorkJob = $pdo->lastInsertId(); CommonUtils::log($pdo,"QUEUE","Create cancel work job with id=$idOfWorkJob for tableid $table of kind $kind for printer=$printer"); } } } } catch (Exception $ex) { $msg = $ex->getMessage(); return; } } } }