if ($user->isCentralAdmin()) { echo "<h5>If you wish to remove a protocol deviation form then please select and click 'Delete' - the form will be stored for audit purposes.</h5>"; echo "<form action=\"process.php\" method=\"POST\">"; } echo '<table class="table table-striped table-bordered table-hover dataTable"><thead>'; echo '<tr><th scope="col">Centre</th><th scope="col">' . Config::get('idName') . '</th><th scope="col">Deviation</th>'; echo '<th scope="col">Description</th><th scope="col">Reported time</th><th scope="col">Reported by</th>'; if ($user->isCentralAdmin()) { echo '<th>Select</th>'; } echo '</tr></thead>'; echo "<tbody>\n"; foreach ($result->rows as $rowv) { $e = new eCRF('violation'); $e->addRecord($rowv->link_id); foreach ($e->getViolations() as $v) { if ($v->isActive()) { echo "<tr class=\"clickable\"><td>{$rowv->centre_name}</td><td>{$rowv->trialid}</td>"; $typearray = array('no' => 'Participant in the intervention group did NOT receive CPAP', 'low' => 'CPAP started at a dose other than 5cmH2O', 'stop' => 'CPAP administered for less than 4 hours or with significant interruption', 'wrong' => 'Participant in the usual care group DID receive CPAP'); $output = '<td><ul>'; foreach ($typearray as $type => $title) { if ($v->{$type . 'cpap'}) { $output .= "<li><b>{$title}</b></li>"; $output .= "<ul>"; foreach ($v->{$type . 'cpapreason'} as $reason) { $sql = "SELECT option_text FROM {$type}cpapreason WHERE option_value = ?"; $pA = array('i', $reason); $result = DB::query($sql, $pA); $output .= "<li>{$result->option_text}</li>"; } $output .= "</ul>";