function update_coa($account_code, $account_group, $account_desc_short, $account_desc_long, $parent_account_id, $account_status) { //Define $now ??? where is it comming from $edit = DB::UPDATE(DB_PREFIX . $_SESSION['co_prefix'] . 'coa', array('account_code' => $account_code, 'account_group' => $account_group, 'account_desc_short' => $account_desc_short, 'account_desc_long' => $account_desc_long, 'parent_account_id' => $parent_account_id, 'last_modified_by' => $user_name, 'last_modified_on' => $now, 'account_status' => $account_status), "account_id =%s", $coa_id); $coa_id = DB::insertId(); return $coa_id; }
function update_journal_voucher_detail($voucher_id, $voucher_date, $account_id, $entry_desc, $debit_amount, $credit_amount, $voucher_detail_id) { $now = getDateTime(0, 'mySQL'); $insert = DB::UPDATE(DB_PREFIX . $_SESSION['co_prefix'] . 'journal_voucher_details', array('voucher_id' => $voucher_id, 'voucher_date' => $voucher_date, 'account_id' => $account_id, 'entry_description' => $entry_desc, 'debit_amount' => $debit_amount, 'credit_amount' => $credit_amount, 'created_on' => $now, 'created_by' => $_SESSION['user_name'], 'voucher_detail_status' => 'Draft'), "voucher_detail_id =%s", $voucher_detail_id); $voucher_detail_id = DB::insertId(); if ($voucher_detail_id) { return $voucher_detail_id; return $voucher_id; } else { return 0; } }
function reset_password($user_id, $password) { $password = sha1($password); $update = DB::UPDATE('users', array('password' => $password), "user_id=%s", $user_id); return $update; }