<?php } ?> <?php if (!empty($room->photo)) { ?> <tr> <td class="caption"> <label>Current photo</label> </td> <td class="field"> <?php if (!empty($room->photo)) { echo sprintf('<img src="upload/%s" />', image_small($room->photo)); } ?> <?php echo form_hidden('photo', $room->photo); ?> </td> </tr> <tr> <td class="caption"> <label for="delete" accesskey="D" title="Tick this box to delete the current photo (not necessary when uploading a new one)."><u>D</u>elete</label> </td> <td class="field"> <label for="delete" class="check"> <?php unset($check);
/** * Function to delete the files associated with a given photo * * @param string Filename with # - will be replaced */ function _delete_photo($file) { @unlink('web/upload/' . image_small($file)); @unlink('web/upload/' . image_large($file)); }