connect(); $project = new Project($db); $project->pid = $data->id; $project->cid = $data->vendorId; $result = $project->vendorDetails(); $num = $result->rowCount(); $tempObject = new stdClass(); $tempObject->data = NULL; if ($num > 0) { $row = $result->fetch(PDO::FETCH_ASSOC); extract($row); $surveyEntry = NULL; if ($isopen == 1) { $attributeName = !empty($attributes) ? $attributes : "uid"; $surveyEntry = SURVEY_ENTRY . "?p=" . $data->id . "&v=" . $data->vendorId . "&" . $attributeName . "=xxxxxx"; } $item = array( "projectName" => $projectName, "baseUrl" => $baseUrl, "liveAttributes" => $liveAttributes ? explode(",", $liveAttributes) : array(), "vendorName" => $vendorName, "attributes" => $attributes, "complete" => $complete, "screenout" => $screenout, "quotafull" => $quotafull, "isopen" => $isopen, "surveyEntry" => $surveyEntry ); $tempObject->data = $item; } echo json_encode($tempObject);