<?php include_once 'config.php'; include_once 'functions.php'; include_once 'db_connect.php'; if (isset($_POST['rJob'])) { $restart = "UPDATE cc_jobs set state='0',progress='0' where id='" . $_POST['rJob'] . "'"; write_log($restart); $mysqli->query($restart); echo '{"status":"success"}'; $restart = NULL; } if (isset($_GET['getWF'])) { // read Workflows $sql2 = "SELECT wf_description,wf_short,wf_icon from cc_wf order by id DESC"; $workflows = $mysqli->query($sql2); if ($workflows->num_rows > 0) { while ($obj = mysqli_fetch_object($workflows)) { $var[] = $obj; } echo '{"workflow":' . json_encode($var) . '}'; } } if (isset($_POST['wf'])) { add_DBJob($mysqli, DB, $_POST['uuid'], $_POST['wf']); sleep(5); } include_once 'db_disconnect.php';
// delete file unlink($content_dir . $uuid . "/" . $filename); } } } //end ignore dots } // end while dirscan } // end unzip add_DBJob($mysqli, DB, $uuid, "IngestContent"); echo '{"success":"success"}'; exit; } // end if zip rename($upload_dir . $org_filename, $content_dir . $uuid . "/" . $uuid . "." . $extension); if ($extension == "blend") { # add blend-file to Database add_DBContent($mysqli, $org_filename, $uuid, "blender", $extension); } else { # add uploaded File to Database $content_type = getContentType($extension); add_DBContent($mysqli, $org_filename, $uuid, $content_type, $extension); } add_DBJob($mysqli, DB, $uuid, "IngestContent"); echo '{"success":"success"}'; exit; } } echo '{"error":"upload failed"}'; exit;