function delete($id) { $contact = new contact($id); //delete city $contact->delete(); //redirect to city redirect($this->admin . 'contacts/list_all/'); }
require 'path.php'; init_cobalt('Delete contact'); if (isset($_GET['Id'])) { $Id = urldecode($_GET['Id']); require_once 'form_data_contact.php'; } if (xsrf_guard()) { init_var($_POST['btn_cancel']); init_var($_POST['btn_delete']); require 'components/query_string_standard.php'; if ($_POST['btn_cancel']) { log_action('Pressed cancel button'); redirect("listview_contact.php?{$query_string}"); } elseif ($_POST['btn_delete']) { log_action('Pressed delete button'); require_once 'subclasses/contact.php'; $dbh_contact = new contact(); $object_name = 'dbh_contact'; require 'components/create_form_data.php'; $dbh_contact->delete($arr_form_data); redirect("listview_contact.php?{$query_string}"); } } require 'subclasses/contact_html.php'; $html = new contact_html(); $html->draw_header('Delete Contact', $message, $message_type); $html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc); $html->draw_hidden('Id'); $html->detail_view = TRUE; $html->draw_controls('delete'); $html->draw_footer();
<?php $nav = []; require 'inc.manage.php'; ?> <div id="container" class="main"> <div class="top dark"> <center><h1>[title]</h1></center> </div> <div id="add" style="height: 160px; padding: 0; background: url('http://thumbs.dreamstime.com/t/seamless-background-forest-green-summer-birch-trees-bushes-38722994.jpg') repeat-x"> </div> <?php if (isset($uri[0]) && is_numeric($uri[0])) { $contact = new contact(intval($uri[0])); if ($contact->found()) { $contact->delete(); echo '<div class="green">Contact form from ', $contact->ip, ' has been removed</div>'; } } ?> <?php $contact = new contact(false); while ($contact->found()) { ?> <div> <?php echo '<a href="/manage/contact/', $contact->id, '">[Dismiss]</a> ', $contact->name, ' - from ', $contact->ip, '<br/><b>', $contact->subject, '</b><br/>', nl2br($contact->content); ?> </div> <?php }