Full Compatible Verion With Oracle, Now Available. pheeeew!
- Single Page
Posted 03 May 2012 - 04:01 AM
I Honestly Dont Know How Im gonna upload cos its a .rar file containing different modifications
Regards
Tee
Posted 03 May 2012 - 05:57 AM
Thanks by the way.
Posted 03 May 2012 - 08:35 AM
Posted 03 May 2012 - 08:38 AM
Pls remember to add the following line to the grocery_crud_model.php file at line 70 to enable the datepickers and field work effectively
$this->db->query("alter session set nls_date_format='DD-MM-YYYY HH24:MI:SS'");
Posted 17 June 2012 - 18:46 PM
[b]Fatal error[/b][color=#000000]: Cannot access empty property in [/color][b]D:xxxx\application\libraries\grocery_crud.php[/b][color=#000000] on line [/color][b]1388[/b]
if I made the comment this code
foreach($data->list as $num_row => $row)
{
$data->list[$num_row]->edit_url = $data->edit_url.'/'.$row->{$data->primary_key};
$data->list[$num_row]->delete_url = $data->delete_url.'/'.$row->{$data->primary_key};
}
the data can show but on the action error like this
Edit D
Edit
A PHP Error was encountered
Severity: Notice
Message: Undefined property: stdClass::$edit_url
Filename: views/list.php
Line Number: 34
" class="edit_button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" role="button">
Edit
A PHP Error was encountered
Severity: Notice
Message: Undefined property: stdClass::$delete_url
Filename: views/list.php
Line Number: 40
', '0')" href="javascript:void(0)" class="delete_button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" role="button">
Delete
please help me
Posted 19 June 2012 - 06:24 AM
1. You don't get a primary key at application/models/grocery_crud_model.php at around line 523-571 from
function get_primary_key($table_name = null)
2. You don't have a primary key at your table. Make sure that you have at least one primary key at your table
Posted 20 June 2012 - 02:16 AM
my feeling the wrong on models/grocary_crud_model.php
if i using mysql database it's no problem, but if i use oracle and use grocery crud for oracle, i get error, this is function get_primary_key on grocary_crud_model.php, any wrong on this line?
please help me johnny thanks alot :-)
function get_primary_key($table_name = null)
{
if($table_name == null)
{
if(empty($this->primary_key))
{
$fields = $this->get_field_types_basic_table();
foreach($fields as $field)
{
if($field->CONSTRAINT_TYPE == 'P')
{
return $field->name;
}
}
return false;
}
else
{
return $this->primary_key;
}
}
else
{
$fields = $this->get_field_types($table_name);
foreach($fields as $field)
{
if($field->CONSTRAINT_TYPE == 'P')
{
return $field->name;
}
}
return false;
}
}
Posted 20 June 2012 - 02:53 AM
CREATE TABLE matkuliah (
id_matkul CHAR(5) NOT NULL,
nm_matkul VARCHAR2(30) NOT NULL,
jml_sks NUMBER(5,2) NOT NULL,
CONSTRAINT pk_matkul PRIMARY KEY(id_matkul)
);
CREATE TABLE mahasiswa(
nim CHAR(8) NOT NULL,
nama VARCHAR2(30) NOT NULL,
alamat VARCHAR2(60) NOT NULL,
id_matkul CHAR(5) NOT NULL,
CONSTRAINT pk_mhs PRIMARY KEY(nim),
CONSTRAINT fk_mhs FOREIGN KEY(id_matkul) REFERENCES matkul(id_matkul)
);
please help me johnny .. i upload my source on http://android.developers.or.id/cinta2.zip because filesize 1 Mb.
thanks alot
Posted 21 June 2012 - 17:18 PM
I had the same problem, and i realised that the query used for the model to find the columns and its features (for example if it is a primary key) was with problems.
Then, the funcion get_field_types_basic_table() on "grocery_crud_model.php" dosen't find if the column is Primary Key, becose the column CONSTRAINT_TYPE was empty.
(you can print the query on the line 322 on grocery_crud_model.php and test it on the database).
Then i find that the problem was the name of the user database defined in config/database.php ($db['default']['username']) was in lowercase,
The solution was to change the name of the user to uppercase.
i hope you can fix the problem
Bye
Posted 23 June 2012 - 06:41 AM
Posted 26 June 2012 - 11:58 AM
{TABLENAME}_SEQ to mimic autonumbers in mysql which was my little dirty hack to allow the insert functionality work on oracle
that is FILMS table would have FILMS_SEQ as its sequence in oracle
i've modified the oci drivers to reflect updates too.
Happy coding y'all
Posted 12 July 2012 - 08:45 AM
function db_relation_n_n_update($field_info, $post_data ,$main_primary_key)
{
$this->db->where($field_info->primary_key_alias_to_this_table, $main_primary_key);
if(!empty($post_data))
$this->db->where_not_in($field_info->primary_key_alias_to_selection_table , $post_data);
$this->db->delete($field_info->relation_table);
$counter = 0;
if(!empty($post_data))
{
/**ob_start();
var_dump($post_data);
$xxx = ob_get_clean();
$xxx .= '<br/>primary_key_alias_to_this_table:'.$field_info->primary_key_alias_to_this_table;
$xxx .= '<br/>primary_key_alias_to_selection_table:'.$field_info->primary_key_alias_to_selection_table;
$xxx .= '<br/>main_primary_key:'. $main_primary_key;
var_dump($where_array);
$xxx .= ob_get_clean();
$xxx .= '<br/>relation_table:'. $field_info->relation_table;
$xxx .= '<br/>priority_field_relation_table:'. $field_info->priority_field_relation_table;
$xxx .= '<br/>Count:'. $count;
if ( ! write_file(@'./debug.txt', $xxx))
{
// echo 'Unable to write the file';
}
else
{
// echo 'File written!';
}
**/
foreach($post_data as $primary_key_value)
{
$where_array = array(
$field_info->primary_key_alias_to_this_table => $main_primary_key,
$field_info->primary_key_alias_to_selection_table => $primary_key_value,
);
$this->db->where($where_array);
$count = $this->db->from($field_info->relation_table)->count_all_results();
if($count == 0)
{
if(!empty($field_info->priority_field_relation_table))
$where_array[$field_info->priority_field_relation_table] = $counter;
$sql = "select {$field_info->relation_table}_SEQ.nextval AS NEXTID from dual";
$query = $this->db->query($sql);
$row = $query->row();
$newid= $row->NEXTID;
$pkfield = $this->get_primary_key("{$field_info->relation_table}");
$where_array[$pkfield] = $newid;
$this->db->insert($field_info->relation_table, $where_array);
}elseif($count >= 1 && !empty($field_info->priority_field_relation_table))
{
$this->db->update( $field_info->relation_table, array($field_info->priority_field_relation_table => $counter) , $where_array);
}
$counter++;
}
}
}
Posted 13 December 2012 - 06:52 AM
i need to switch to oracle and i tried you lib
it's not working anymore and it's an old version
can you update your lib
or guide me to
how or where in library to modify
Posted 30 December 2012 - 20:18 PM
Sorry for the late response been working with other projects.
Regards
Posted 02 December 2013 - 10:49 AM
Hello tee_porche,
I am attempting to use your Oracle version with Grocery CRUD 1.4.1 and CodeIgniter 2.1.4 but I am getting errors which I think is because I am trying to use your modifications with the wrong version. Can you tell me which version of Grocery CRUD and CodeIgniter your modifications are for?
Many thanks,
MoonBrain
Posted 11 April 2017 - 17:55 PM
hi All, I've made a lot of changes to the oracle gcrud library ..This should make it compatible with previous version. for now I'm trying to keep up with the latest changes ....would upload the changes as soon as I'm done.
Sorry for the late response been working with other projects.
Regards
Hi, you really helped me but I got the next message error:
A PHP Error was encountered Severity: Error Message: Cannot access empty property Filename: libraries/Grocery_CRUD.php Line Number: 1612 Backtrace:
How can I fix it?