ci = &get_instance(); $this->db = $this->ci->load->database('accounting', TRUE); $t="select * from admin_menu where parent_id=22 and page_link='account/defaults'"; $r=$this->ci->db->query($t); if($r->num_rows()==0){ $t="INSERT INTO `admin_menu` (`id`, `menu_name`, `parent_id`, `order_number`, `inactive_icon`, `active_icon`, `is_active`, `page_link`, `created_on`) VALUES (NULL, 'Accounting Settings', '22', '6', ' ', ' ', 'yes', 'account/defaults', '".date("y-m-d h:i:s")."');"; $q=$this->ci->db->query($t); } // $this->init(); } function pre($Obj) { echo "
";
        print_r($Obj);
        echo "
"; } function init() { $tbl_acgroups = "CREATE TABLE IF NOT EXISTS `tbl_acgroups` ( `acgroup_id` INT(11) NOT NULL, `acgroup_code` VARCHAR(250) NOT NULL, `acgroup_name` VARCHAR(250) NOT NULL, `posting_side` VARCHAR(20) NOT NULL, `created_on` DATE NOT NULL, `created_by` VARCHAR(250) NOT NULL, `remarks` TEXT NOT NULL, `status` INT(11) NOT NULL, `display_order` INT(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; "; } function showFeeTypeMappingOption($default="") { $Accategoreies = $this->db->query("select * from tbl_accategories where accategory_id in (select accategory_id from tbl_accounts where tbl_accounts.status<>1)")->result(); foreach ($Accategoreies as $AccountCategory) { $AccountCategory->Accounts = $this->db->query("select * from tbl_accounts where accategory_id='$AccountCategory->accategory_id'")->result(); } ?>
db->query($t); $q = $this->db->query("SELECT * FROM tbl_accmaping WHERE bbmodel='fee_types' AND bbpk='$feetype_id'"); if ($q->num_rows() > 0) { $q = $this->db->query("UPDATE tbl_accmaping SET account_id='$account_id' WHERE bbmodel='fee_types' AND bbpk='$feetype_id'"); } else { $q = $this->db->query("INSERT INTO tbl_accmaping (account_id, bbmodel, bbpk) VALUES ('$account_id', 'fee_types', '$feetype_id')"); } } function fetchMappedAccount($model, $bbpk) { $q = $this->db->query("SELECT * FROM tbl_accounts WHERE account_id=(SELECT account_id FROM tbl_accmaping WHERE bbmodel='$model' AND bbpk='$bbpk')"); if ($q->num_rows() > 0) { return $q->row()->account_name; } else { return null; } } }