24 Mayıs 2010 Pazartesi

CodeIgniter Temel Veritabanı İşlemleri (CRUD) - III

View Dosyası (views/announcements/records.php):

[sourcecode language="php"]

<?php echo anchor($this->table.'/insert', '[Insert Record]').'<p/>'; ?>

<table id="box-table-a">
<tr>
<th>Title</th>
<th>Date</th>
<th>Status</th>
<th>Position</th>
<th>Color</th>
<th>Password</th>
<th colspan="2">Action</th>
</tr>

<?php
foreach ($records as $rec)
{
echo '<tr>';
echo '<td>'.$rec['title'].'</td>';
echo '<td>'.unix_to_human($rec['date']).'</td>';
echo '<td>'.$rec['status'].'</td>';
echo '<td>'.$rec['position'].'</td>';
echo '<td>'.$rec['color'].'</td>';
echo '<td>'.$rec['password'].'</td>';
echo '<td>'.anchor($this->table.'/update/'.$rec['id'], '[edit]').'</td>';
echo '<td>'.anchor($this->table.'/delete/'.$rec['id'], '[delete]', array('onclick'=>"return confirm('Are you sure?')")).'</td>';
echo '</tr>';
}
?>

</table><p/>

<?php echo $this->pagination->create_links(); ?>

[/sourcecode]

Hiç yorum yok:

Yorum Gönder