<div class="clear">
    <?php foreach ($partial as $p) : ?>
        <div class="icon" id="partial_<?php echo htmlspecialchars($p['id']); ?>">
            <div class="content">
                <a href="partial/edit/<?php echo htmlspecialchars($p['id']); ?>">
                    <img src="admin/skin/icon/file3.png" /><br /><?php echo htmlspecialchars($p['name']); ?>
                </a>
            </div>
            <div class="action">
                <a href="partial/edit/<?php echo htmlspecialchars($p['id']); ?>">Edit</a>
                <a href="javascript:delete_partial(<?php echo htmlspecialchars($p['id']); ?>);">Delete</a>
            </div>
        </div>
    <?php endforeach; ?>
</div>

<script type="text/javascript">
    function delete_partial(id)
    {
        if (confirm('Are you sure?'))
        {
            $.post('partial/delete', { id:id },
                function(data, status) {
                    if (data.error != '')
                    {
                        alert(data.error);
                    }
                    else
                    {
                        $('#partial_' + id).remove();
                    }
                }, 'json');
        }
    }
</script>