function db_install() { $return = array(); $this->load->database(); $this->db->db_debug = 0; if ($this->db_install_tables()) { $return[] = $this->lang->line('install_database_success'); } else { $return[] = $this->lang->line('install_database_problem'); return $return; } $db_array = parent::db_array(); $db_array['password'] = md5($db_array['password']); $db_array['global_admin'] = 1; unset($db_array['passwordv']); if (parent::save($db_array, NULL, FALSE)) { $return[] = $this->lang->line('install_admin_account_success'); } else { $return[] = $this->lang->line('install_admin_account_problem'); return $return; } $return[] = $this->lang->line('installation_complete'); $return[] = $this->lang->line('install_delete_folder'); $return[] = APPPATH . 'modules_core/setup'; $return[] = anchor('sessions/login', $this->lang->line('log_in')); $this->mdl_mcb_modules->refresh(); return $return; }
public function db_array() { $db_array = parent::db_array(); if (uri_assoc('mcb_expense_id')) { $db_array['mcb_expense_id'] = uri_assoc('mcb_expense_id'); } else { if ($this->input->post('mcb_expense_id')) { $db_array['mcb_expense_id'] = $this->input->post('mcb_expense_id'); } } $db_array['mcb_expense_date'] = strtotime(standardize_date($db_array['mcb_expense_date'])); $db_array['mcb_expense_amount'] = standardize_number($db_array['mcb_expense_amount']); $db_array['mcb_base_expense_amount'] = standardize_number($db_array['mcb_base_expense_amount']); $db_array['mcb_expense_tax_amount'] = standardize_number($db_array['mcb_expense_tax_amount']); $db_array['mcb_expense_tax2_amount'] = standardize_number($db_array['mcb_expense_tax2_amount']); $db_array['expense_invoice_with_tax2'] = standardize_number($db_array['expense_invoice_with_tax2']); if (isset($db_array['expense_invoice_yesno'])) { $db_array['expense_invoice_yesno'] = $this->_standardize_checkbox($db_array['expense_invoice_yesno']); } else { $db_array['expense_invoice_yesno'] = 0; } if (isset($db_array['expense_payed'])) { $db_array['expense_payed'] = $this->_standardize_checkbox($db_array['expense_payed']); } else { $db_array['expense_payed'] = 0; } if (!isset($db_array['expense_paymentTypeId'])) { $db_array['expense_paymentTypeId'] = 0; } $db_array['expense_invoice_date'] = strtotime(standardize_date($db_array['expense_invoice_date'])); $db_array['expense_invoice_overdue_date'] = strtotime(standardize_date($db_array['expense_invoice_overdue_date'])); return $db_array; }
public function db_array() { $db_array = parent::db_array(); $custom_tables = $this->custom_tables(); $custom_field_column = strtolower($custom_tables[$db_array['custom_field_table']]) . '_custom_' . preg_replace('/[^a-zA-Z0-9_\\s]/', '', strtolower(str_replace(' ', '_', $db_array['custom_field_label']))); $db_array['custom_field_column'] = $custom_field_column; return $db_array; }
public function db_array() { $db_array = parent::db_array(); unset($db_array['client_id_autocomplete_label']); $db_array['client_credit_date'] = strtotime(standardize_date($db_array['client_credit_date'])); $db_array['client_credit_amount'] = standardize_number($db_array['client_credit_amount']); return $db_array; }
public function db_array() { $db_array = parent::db_array(); $db_array['inventory_unit_price'] = standardize_number($db_array['inventory_unit_price']); if (!isset($db_array['inventory_track_stock'])) { $db_array['inventory_track_stock'] = 0; } return $db_array; }
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; }
public function db_array() { $db_array = parent::db_array(); if (uri_assoc('invoice_id')) { $db_array['invoice_id'] = uri_assoc('invoice_id'); } elseif ($this->input->post('invoice_id')) { $db_array['invoice_id'] = $this->input->post('invoice_id'); } $db_array['payment_date'] = strtotime(standardize_date($db_array['payment_date'])); $db_array['payment_amount'] = standardize_number($db_array['payment_amount']); return $db_array; }
public function db_array() { $db_array = parent::db_array(); if (isset($db_array['password'])) { $db_array['password'] = md5($db_array['password']); } if (!$this->input->post('global_admin')) { $db_array['global_admin'] = 0; } unset($db_array['passwordv']); return $db_array; }
public function db_array() { $db_array = parent::db_array(); if (uri_assoc('bank_id')) { $db_array['bank_id'] = uri_assoc('bank_id'); } else { if ($this->input->post('bank_id')) { $db_array['bank_id'] = $this->input->post('bank_id'); } } return $db_array; }
public function db_array() { $db_array = parent::db_array(); if (uri_assoc('expense_category_id', 4)) { $db_array['expense_category_id'] = uri_assoc('expense_category_id', 4); } else { if ($this->input->post('expense_category_id')) { $db_array['expense_category_id'] = $this->input->post('expense_category_id'); } } return $db_array; }
public function db_array() { // Get the default db array $db_array = parent::db_array(); // Get the array of custom tables $custom_tables = $this->custom_tables(); // Create the name for the custom field column $custom_field_column = strtolower($custom_tables[$db_array['custom_field_table']]) . '_custom_' . preg_replace('/[^a-zA-Z0-9_\\s]/', '', strtolower(str_replace(' ', '_', $db_array['custom_field_label']))); // Add the custom field column to the db array $db_array['custom_field_column'] = $custom_field_column; // Return the db array return $db_array; }
function save() { $db_array = parent::db_array(); if (!uri_assoc('task_id', 3)) { $db_array['user_id'] = $this->session->userdata('user_id'); } if (isset($db_array['due_date']) and $db_array['due_date']) { $db_array['due_date'] = strtotime(standardize_date($db_array['due_date'])); } if (isset($db_array['complete_date']) and $db_array['complete_date']) { $db_array['complete_date'] = strtotime(standardize_date($db_array['complete_date'])); } $db_array['start_date'] = strtotime(standardize_date($db_array['start_date'])); parent::save($db_array, uri_assoc('task_id', 3)); }
public function save() { $db_array = parent::db_array(); $field_id = uri_assoc('field_id'); if (!$field_id) { $field_index = $this->get_next_field_index($db_array['object_id']); $column_name = $this->column_prefixes[$db_array['object_id']] . 'custom_' . $field_index; $this->add_column($db_array['object_id'], $column_name); } else { $field_index = $this->get_current_field_index($field_id); $column_name = $this->column_prefixes[$db_array['object_id']] . 'custom_' . $field_index; } $db_array['field_index'] = $field_index; $db_array['column_name'] = $column_name; parent::save($db_array, $field_id); }
public function db_array() { // Get the default db array $db_array = parent::db_array(); // Get the array of custom tables $custom_tables = $this->custom_tables(); // Check if the user wants to add 'id' as custom field if (strtolower($db_array['custom_field_label']) == 'id') { // Replace 'id' with 'field_id' to avoid problems with the primary key $custom_field_label = 'field_id'; } else { $custom_field_label = strtolower(str_replace(' ', '_', $db_array['custom_field_label'])); } // Create the name for the custom field column $this->load->helper('diacritics'); $clean_name = preg_replace('/[^a-z0-9_\\s]/', '', strtolower(diacritics_remove_diacritics($custom_field_label))); $db_array['custom_field_column'] = $custom_tables[$db_array['custom_field_table']] . '_custom_' . $clean_name; // Return the db array return $db_array; }
public function db_array() { // Get the default db array $db_array = parent::db_array(); // Get the array of custom tables $custom_tables = $this->custom_tables(); // Check if the user wants to add 'id' as custom field if (strtolower($db_array['custom_field_label']) == 'id') { // Replace 'id' with 'field_id' to avoid problems with the primary key $custom_field_label = 'field_id'; } else { $custom_field_label = strtolower(str_replace(' ', '_', $db_array['custom_field_label'])); } // Create the name for the custom field column $custom_field_column = strtolower($custom_tables[$db_array['custom_field_table']]) . '_custom_' . preg_replace('/[^a-zA-Z0-9_\\s]/', '', $custom_field_label); // Add the custom field column to the db array $db_array['custom_field_column'] = $custom_field_column; // Return the db array return $db_array; }
public function db_array() { $db_array = parent::db_array(); $db_array['item_price'] = standardize_amount($db_array['item_price']); return $db_array; }
public function save($db_array = NULL) { if (!$db_array) { $db_array = parent::db_array(); } if (!$this->input->post('client_active') and !isset($db_array['client_active'])) { $db_array['client_active'] = 0; } parent::save($db_array, uri_assoc('client_id')); }
function save() { $db_array = parent::db_array(); parent::save($db_array, $this->session->userdata('client_id')); }
public function save() { $db_array = parent::db_array(); if (!$this->input->post('client_active')) { $db_array['client_active'] = 0; } parent::save($db_array, uri_assoc('client_id')); }
public function db_array() { $db_array = parent::db_array(); $db_array['client_id'] = uri_assoc('client_id', 4); return $db_array; }