function delete()
 {
     if (uri_assoc('payment_method_id', 4)) {
         $this->mdl_payment_methods->delete(array('payment_method_id' => uri_assoc('payment_method_id', 4)));
     }
     $this->redir->redirect('payments/payment_methods');
 }
Exemple #2
0
 function delete()
 {
     if (uri_assoc('field_id')) {
         $this->mdl_fields->delete(uri_assoc('field_id'));
     }
     $this->redir->redirect('fields');
 }
 public function get_table_headers()
 {
     $order_by = uri_assoc('order_by');
     $order = uri_assoc('order') == 'asc' ? 'desc' : 'asc';
     $headers = array('client_id' => anchor('clients/index/order_by/client_id/order/' . $order, $this->lang->line('id')), 'client_name' => anchor('clients/index/order_by/client_name/order/' . $order, $this->lang->line('client')), 'client_email' => anchor('clients/index/order_by/client_email/order/' . $order, $this->lang->line('email_address')), 'client_phone' => anchor('clients/index/order_by/client_phone/order/' . $order, $this->lang->line('phone_number')), 'credit_amount' => anchor('clients/index/order_by/credit_amount/order/' . $order, $this->lang->line('credit_amount')), 'balance' => anchor('clients/index/order_by/balance/order/' . $order, $this->lang->line('balance')), 'user' => anchor('clients/index/order_by/user/order/' . $order, $this->lang->line('user')), 'client_active' => anchor('clients/index/order_by/client_active/order/' . $order, $this->lang->line('active')));
     return $headers;
 }
 public function get_table_headers()
 {
     $order_by = uri_assoc('order_by');
     $order = uri_assoc('order') == 'asc' ? 'desc' : 'asc';
     $headers = array('inventory_id' => anchor('inventory/index/order_by/inventory_id/order/' . $order, $this->lang->line('id')), 'inventory_type' => anchor('inventory/index/order_by/inventory_type/order/' . $order, $this->lang->line('type')), 'inventory_item' => anchor('inventory/index/order_by/inventory_item/order/' . $order, $this->lang->line('item')), 'inventory_stock' => anchor('inventory/index/order_by/inventory_stock/order/' . $order, $this->lang->line('stock')), 'inventory_price' => anchor('inventory/index/order_by/inventory_price/order/' . $order, $this->lang->line('price')));
     return $headers;
 }
 function delete()
 {
     if (uri_assoc('client_credit_id', 4)) {
         $this->mdl_client_credits->delete(array('client_credit_id' => uri_assoc('client_credit_id', 4)));
     }
     $this->redir->redirect('payments/client_credits');
 }
 function _get_results($params = array())
 {
     $search_hash = $this->session->userdata('search_hash');
     $params = array_merge($params, $search_hash[uri_assoc('search_hash', 4)]);
     $params['set_client'] = TRUE;
     return $this->mdl_invoices->get($params);
 }
 public function delete()
 {
     if (uri_assoc('expense_payment_type_id')) {
         $this->mdl_expense_payment_type->delete(array('expense_payment_type_id' => uri_assoc('expense_payment_type_id')));
     }
     $this->redir->redirect('expenses/expense_payment_type');
 }
 function delete()
 {
     if (uri_assoc('tax_rate_id')) {
         $this->mdl_tax_rates->delete(uri_assoc('tax_rate_id'));
     }
     $this->redir->redirect('tax_rates');
 }
Exemple #9
0
 public function delete()
 {
     if (uri_assoc('expense_category_id')) {
         $this->mdl_expense_category->delete(array('expense_category_id' => uri_assoc('expense_category_id')));
     }
     $this->redir->redirect('expenses/category');
 }
Exemple #10
0
 public function delete()
 {
     if (uri_assoc('bank_id')) {
         $this->mdl_bank->delete(array('bank_id' => uri_assoc('bank_id')));
     }
     $this->redir->redirect('expenses/bank');
 }
 function delete()
 {
     if (uri_assoc('invoice_status_id')) {
         $this->mdl_invoice_statuses->delete(array('invoice_status_id' => uri_assoc('invoice_status_id')));
     }
     $this->redir->redirect('invoice_statuses');
 }
Exemple #12
0
 function delete()
 {
     if (uri_assoc('task_id', 3)) {
         $this->mdl_tasks->delete(array('task_id' => uri_assoc('task_id', 3)));
     }
     $this->redir->redirect('tasks');
 }
/**
 * Transforms and returs the given string. Spaces are replaced with underscores and only characters and numbers are left
 * 
 * @access		public
 * @param		$string		string	The given string	
 * @return		string | false
 * @example
 * @see
 * 
 * @author 		Damiano Venturin
 * @copyright 	2V S.r.l.
 * @license		GPL
 * @link		http://www.squadrainformatica.com/en/development#mcbsb  MCB-SB official page
 * @since		Feb 5, 2012
 * 
 */
function retrieve_uid_oid()
{
    $CI =& get_instance();
    $uid = uri_assoc('uid');
    $oid = uri_assoc('oid');
    if (empty($uid) && empty($oid)) {
        if (uri_assoc('client_id')) {
            $client_id = uri_assoc('client_id');
            //retrieving client_id from GET
        } else {
            if ($CI->input->get_post('client_id')) {
                $client_id = $this->input->post('client_id');
            }
            //retrieving client_id from POST
        }
    }
    if ($uid) {
        $params = array('uid' => $uid, 'client_id' => $uid, 'client_id_key' => 'uid');
    }
    if ($oid) {
        $params = array('oid' => $oid, 'client_id' => $oid, 'client_id_key' => 'oid');
    }
    if (isset($client_id) && $client_id) {
        $params = array('client_id' => $client_id);
    }
    return isset($params) ? $params : null;
}
 public function get_table_headers()
 {
     $order_by = uri_assoc('order_by');
     $order = uri_assoc('order') == 'asc' ? 'desc' : 'asc';
     $headers = array('payment_id' => anchor('payments/index/order_by/payment_id/order/' . $order, $this->lang->line('id')), 'date' => anchor('payments/index/order_by/date/order/' . $order, $this->lang->line('date')), 'invoice_id' => anchor('payments/index/order_by/invoice_id/order/' . $order, $this->lang->line('invoice_number')), 'client' => anchor('payments/index/order_by/client/order/' . $order, $this->lang->line('client')), 'amount' => anchor('payments/index/order_by/amount/order/' . $order, $this->lang->line('amount')));
     return $headers;
 }
Exemple #15
0
 public function delete()
 {
     if (uri_assoc('inventory_id')) {
         $this->mdl_inventory->delete(array('inventory_id' => uri_assoc('inventory_id')));
     }
     $this->redir->redirect('inventory');
 }
Exemple #16
0
 public function delete()
 {
     if (uri_assoc('expense_provider_id')) {
         $this->mdl_provider->delete(array('expense_provider_id' => uri_assoc('expense_provider_id')));
     }
     $this->redir->redirect('expenses/provider');
 }
Exemple #17
0
 public function delete()
 {
     if (uri_assoc('inventory_type_id', 4)) {
         $this->mdl_inventory_types->delete(uri_assoc('inventory_type_id', 4));
     }
     $this->redir->redirect('inventory/inventory_types');
 }
Exemple #18
0
 function delete()
 {
     $invoice_group_id = uri_assoc('invoice_group_id', 4);
     if ($invoice_group_id and $invoice_group_id != 1) {
         $this->mdl_invoice_groups->delete(array('invoice_group_id' => $invoice_group_id));
     }
     $this->redir->redirect('invoices/invoice_groups');
 }
Exemple #19
0
 public function save()
 {
     $db_array = $this->db_array();
     if (!$this->input->post('provider_active')) {
         $db_array['provider_active'] = 0;
     }
     parent::save($db_array, uri_assoc('provider_id', 4));
 }
Exemple #20
0
 function change_password()
 {
     if (!$this->mdl_users->validate_change_password() and uri_assoc('user_id')) {
         $this->load->view('change_password');
     } else {
         $this->mdl_users->save_change_password();
         $this->redir->redirect('users');
     }
 }
Exemple #21
0
 function delete()
 {
     unlink('./uploads/invoice_logos/' . uri_assoc('invoice_logo', 4));
     if ($this->mdl_mcb_data->setting('invoice_logo') == uri_assoc('invoice_logo', 4)) {
         $this->mdl_mcb_data->delete('invoice_logo');
         $this->session->unset_userdata('invoice_logo');
     }
     redirect('settings');
 }
Exemple #22
0
 function _post_handler()
 {
     if ($this->input->post('btn_add')) {
         redirect('contacts/form');
     } elseif ($this->input->post('btn_cancel')) {
         $this->session->set_flashdata('tab_index', 2);
         $this->redir->redirect('clients/form/client_id/' . uri_assoc('client_id', 4));
     }
 }
 public function generate_html()
 {
     $invoice_id = uri_assoc('invoice_id');
     if (!$this->mdl_client_center->invoice_belongs_to_client($invoice_id, $this->session->userdata('client_id'))) {
         redirect('client_center');
     }
     $this->load->model('invoices/mdl_invoice_history');
     $this->mdl_invoice_history->save($invoice_id, $this->session->userdata('user_id'), $this->lang->line('client_generated_invoice_html'));
     $this->lib_output->html($invoice_id, $this->_get_invoice_template());
 }
Exemple #24
0
 public function db_array()
 {
     $db_array = parent::db_array();
     $db_array['invoice_id'] = uri_assoc('invoice_id', 4);
     if (!$this->input->post('is_taxable')) {
         $db_array['is_taxable'] = 0;
     }
     $db_array['item_date'] = strtotime(standardize_date($db_array['item_date']));
     return $db_array;
 }
Exemple #25
0
 public function delete($type)
 {
     if (count($this->get($type)) > 1) {
         if (unlink($this->template_dir[$type] . uri_assoc('template_name') . '.php')) {
             $this->session->set_flashdata('success_delete', TRUE);
         }
     } else {
         $this->session->set_flashdata('custom_error', $this->lang->line('template_cannot_be_deleted'));
     }
 }
Exemple #26
0
 public function delete()
 {
     if (uri_assoc('mcb_expense_id')) {
         $this->mdl_expenses->delete(array('mcb_expense_id' => uri_assoc('mcb_expense_id')));
     }
     if (uri_assoc('mcb_expense_file_id')) {
         $this->db->delete('mcb_expense_file', array('mcb_expense_file_id' => uri_assoc('mcb_expense_file_id')));
     }
     $this->redir->redirect('expenses');
 }
 public function save()
 {
     $db_array = $this->db_array();
     parent::save($db_array, uri_assoc('payment_id'));
     if (isset($db_array['payment_method_id']) and $db_array['payment_method_id'] == '9999') {
         $this->db->select('client_id');
         $this->db->where('invoice_id', $db_array['invoice_id']);
         $client_id = $this->db->get('mcb_invoices')->row()->client_id;
         $credit_db_array = array('client_credit_client_id' => $client_id, 'client_credit_amount' => $db_array['payment_amount'] * -1, 'client_credit_date' => $db_array['payment_date']);
         $this->db->insert('mcb_client_credits', $credit_db_array);
     }
 }
 public function get_table_headers()
 {
     $is_quote = uri_assoc('is_quote');
     if (!$is_quote) {
         $quote_str = '';
     } else {
         $quote_str = '/is_quote/1';
     }
     $order_by = uri_assoc('order_by');
     $order = uri_assoc('order') == 'asc' ? 'desc' : 'asc';
     $headers = array('invoice_number' => anchor('invoices/index' . $quote_str . '/order_by/invoice_id/order/' . $order, !$is_quote ? $this->lang->line('invoice_number') : $this->lang->line('quote_number')), 'date' => anchor('invoices/index' . $quote_str . '/order_by/date/order/' . $order, $this->lang->line('date')), 'due_date' => anchor('invoices/index' . $quote_str . '/order_by/duedate/order/' . $order, $this->lang->line('due_date')), 'client' => anchor('invoices/index' . $quote_str . '/order_by/client/order/' . $order, $this->lang->line('client')), 'amount' => anchor('invoices/index' . $quote_str . '/order_by/amount/order/' . $order, $this->lang->line('amount')));
     return $headers;
 }
 public function username_check($username)
 {
     $this->db->where('username', $username);
     if (uri_assoc('user_id', 4)) {
         $this->db->where('user_id <>', uri_assoc('user_id', 4));
     }
     $query = $this->db->get('mcb_users');
     if ($query->num_rows()) {
         $this->form_validation->set_message('username_check', $this->lang->line('username_already_exists'));
         return FALSE;
     }
     return TRUE;
 }
Exemple #30
0
 function form()
 {
     if (!$this->mdl_templates->validate()) {
         if (!$_POST and uri_assoc('template_name')) {
             $this->mdl_templates->get_content(uri_assoc('template_name'), $this->type);
         }
         $data = array('dir_is_writable' => $this->mdl_templates->dir_is_writable($this->type), 'template_dir' => $this->mdl_templates->template_dir[$this->type], 'page_title' => $this->page_titles['form'][$this->type]);
         $this->load->view('form', $data);
     } else {
         $this->mdl_templates->save($this->type);
         redirect('templates/index/type/' . $this->type);
     }
 }