connect(); $project = new Project($db); $project->pid = $pid; $project->cid = $cid; $result = $project->projectVendorCombinedData(); $num = $result->rowCount(); $tempObject = new stdClass(); $tempObject->data = NULL; if ($num > 0) { $row = $result->fetch(PDO::FETCH_ASSOC); extract($row); $project->attributes = isset($attributes) ? $attributes : NULL; $project->openAttributes = isset($isopen) ? $isopen : 0; $project->liveAttributes = isset($liveAttributes) ? $liveAttributes : NULL; if (!empty($_FILES['file'] ?? null)) { $project->file = $_FILES['file']['tmp_name'];; } else if (!empty($_POST['textInput'])) { $project->textInput = $_POST['textInput']; } else if (!empty($_POST['urlCount']) && !empty($_POST['baseUrl']) && !empty($project->liveAttributes)) { $project->urlCount = (int)$_POST['urlCount']; $project->baseUrl = $_POST['baseUrl']; } if ($_POST['tags']) { $project->tags = $_POST['tags']; } $status = $project->upload(); $tempObject = new stdClass(); $tempObject->status = $status; echo json_encode($tempObject); } }