<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled</title>
<style type="text/css" media="screen">
label{display:block;}
</style>
</head>
<body>
<h2>Create</h2>
<?php echo form_open('site/create');?>
<p>
<label for="title">Title:</label>
<input type="text" name="title" id="title" />
</p>
<p>
<label for="content">Content:</label>
<input type="text" name="content" id="content" />
</p>
<p>
<input type="submit" value="submit" />
</p>
<?php echo form_close(); ?>
<hr />
<h2>Read</h2>
<table class="table">
<thead>
<tr>
<th>Title</th>
<th>Content</th>
</tr>
</thead>
<tbody>
<?php if(isset($records)) : foreach($records as $row) : ?>
<tr>
<td><?php echo anchor("site/delete/$row->Id", $row->title); ?> </td>
<td><?php echo $row->content; ?></td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<td><h2>No records returned.</h2></td>
</tr>
<?php endif; ?>
<tr>
<td><h2>Delete</h2></td>
</tr>
</table>
<hr />
<h2></h2>
<p>To sample the delete method, click on on of the headings above.
A delete query will automatically run.
</p>
</body>
</html>