Skip to content

Instantly share code, notes, and snippets.

@edoves
Created September 4, 2024 02:55
Show Gist options
  • Save edoves/984aad4eebb0740cd22a93452dc84d75 to your computer and use it in GitHub Desktop.
Save edoves/984aad4eebb0740cd22a93452dc84d75 to your computer and use it in GitHub Desktop.
<?php
function u($string="") {
return urlencode($string);
}
function raw_u($string="") {
return rawurlencode($string);
}
function h($string="") {
return htmlspecialchars($string);
}
?>
<?php foreach($bicycles as $bicycle) { ?>
<tr>
<td><?php echo h($bicycle->id); ?></td>
<td><?php echo h($bicycle->brand); ?></td>
<td><?php echo h($bicycle->model); ?></td>
<td><?php echo h($bicycle->year); ?></td>
<td><?php echo h($bicycle->category); ?></td>
<td><?php echo h($bicycle->gender); ?></td>
<td><?php echo h($bicycle->color); ?></td>
<td><?php echo h($bicycle->price); ?></td>
<td><a class="action" href="<?php echo url_for('/staff/bicycles/show.php?id=' . h(u($bicycle->id))); ?>">View</a></td>
<td><a class="action" href="<?php echo url_for('/staff/bicycles/edit.php?id=' . h(u($bicycle->id))); ?>">Edit</a></td>
<td><a class="action" href="<?php echo url_for('/staff/bicycles/delete.php?id=' . h(u($bicycle->id))); ?>">Delete</a></td>
</tr>
<?php } ?>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment