Exemplo n.º 1
0
 public function delete($id = NULL)
 {
     // Get the invoice id before deleting payment
     $this->db->select('invoice_id');
     $this->db->where('payment_id', $id);
     $invoice_id = $this->db->get('fi_payments')->row()->invoice_id;
     // Delete the payment
     parent::delete($id);
     // Recalculate invoice amounts
     $this->load->model('invoices/mdl_invoice_amounts');
     $this->mdl_invoice_amounts->calculate($invoice_id);
     $this->load->helper('orphan');
     delete_orphans();
 }
Exemplo n.º 2
0
<table class="aligntop" cellspacing="0">
<tr>
<td>';
        echo implode('<br/>', $log);
        echo '</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<br />';
    }
    if (isset($_POST['delete_orphans'])) {
        //confirm_referrer('admin_files.php');
        $log = delete_orphans();
        echo '<div id="imageupload" class="blockform">
<h2><span>Отчет о "сиротах"</span></h2>
<div class="box">
<div class="inform">
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<td>';
        echo implode('<br/>', $log);
        echo '</td>
</tr>
</table>
</div>
</div>
</div>
Exemplo n.º 3
0
 public function delete($id)
 {
     parent::delete($id);
     $this->load->helper('orphan');
     delete_orphans();
 }
Exemplo n.º 4
0
 public function delete($import_id)
 {
     // Gather the import details
     $import_details = $this->db->where('import_id', $import_id)->get('ip_import_details')->result();
     // Loop through details and delete each of the imported records
     foreach ($import_details as $import_detail) {
         $this->db->query("DELETE FROM " . $import_detail->import_table_name . " WHERE " . $this->primary_keys[$import_detail->import_table_name] . ' = ' . $import_detail->import_record_id);
     }
     // Delete the master import record
     parent::delete($import_id);
     // Delete the detail records
     $this->db->where('import_id', $import_id);
     $this->db->delete('ip_import_details');
     // Delete any orphaned records
     $this->load->helper('orphan');
     delete_orphans();
 }
Exemplo n.º 5
0
} else {
    if (isset($_GET['del_forum'])) {
        $forum_to_delete = intval($_GET['del_forum']);
        if ($forum_to_delete < 1) {
            message($lang_common['Bad request']);
        }
        // User pressed the cancel button
        if (isset($_POST['del_forum_cancel'])) {
            redirect(forum_link($forum_url['admin_forums']), $lang_admin_common['Cancel redirect']);
        }
        ($hook = get_hook('afo_del_forum_form_submitted')) ? eval($hook) : null;
        if (isset($_POST['del_forum_comply'])) {
            @set_time_limit(0);
            // Prune all posts and topics
            prune($forum_to_delete, 1, -1);
            delete_orphans();
            // Delete the forum and any forum specific group permissions
            $query = array('DELETE' => 'forums', 'WHERE' => 'id=' . $forum_to_delete);
            ($hook = get_hook('afo_del_forum_qr_delete_forum')) ? eval($hook) : null;
            $forum_db->query_build($query) or error(__FILE__, __LINE__);
            $query = array('DELETE' => 'forum_perms', 'WHERE' => 'forum_id=' . $forum_to_delete);
            ($hook = get_hook('afo_del_forum_qr_delete_forum_perms')) ? eval($hook) : null;
            $forum_db->query_build($query) or error(__FILE__, __LINE__);
            // Regenerate the quickjump cache
            if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
                require FORUM_ROOT . 'include/cache.php';
            }
            generate_quickjump_cache();
            ($hook = get_hook('afo_del_forum_pre_redirect')) ? eval($hook) : null;
            redirect(forum_link($forum_url['admin_forums']), $lang_admin_forums['Forum deleted'] . ' ' . $lang_admin_common['Redirect']);
        } else {
Exemplo n.º 6
0
 public function delete($id = NULL)
 {
     // Get the invoice id before deleting payment
     $this->db->select('invoice_id');
     $this->db->where('payment_id', $id);
     $invoice_id = $this->db->get('ip_payments')->row()->invoice_id;
     // Delete the payment
     parent::delete($id);
     // Recalculate invoice amounts
     $this->load->model('invoices/mdl_invoice_amounts');
     $this->mdl_invoice_amounts->calculate($invoice_id);
     // Change invoice status back to sent
     $this->db->select('invoice_status_id');
     $this->db->where('invoice_id', $invoice_id);
     $invoice = $this->db->get('ip_invoices')->row();
     if ($invoice->invoice_status_id == 4) {
         $this->db->where('invoice_id', $invoice_id);
         $this->db->set('invoice_status_id', 2);
         $this->db->update('ip_invoices');
     }
     $this->load->helper('orphan');
     delete_orphans();
 }