本文整理汇总了PHP中MY_Model::db_array方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::db_array方法的具体用法?PHP MY_Model::db_array怎么用?PHP MY_Model::db_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MY_Model
的用法示例。
在下文中一共展示了MY_Model::db_array方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
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;
}
示例2: db_array
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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: save
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));
}
示例12: save
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);
}
示例13: 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
$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;
}
示例14: 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;
}
示例15: db_array
public function db_array()
{
$db_array = parent::db_array();
$db_array['item_price'] = standardize_amount($db_array['item_price']);
return $db_array;
}