Jump to content


loginet

Member Since 12 Mar 2012
Offline Last Active Apr 26 2012 02:37 PM
-----

Topics I've Started

Romanian translation file

22 March 2012 - 06:41 PM

Hi all,

I love gCRUD so I made my part.

Enjoy,
Adrian

Select date in edit mode 10 years by default

14 March 2012 - 07:44 PM

Hi,

A small problem: I have a date field in database: birthDate.
In edit mode the select box show me 10 years before and 10 years after but my poor user is 40 years old, so his birth date in in 1972. :)
How can I change this default 10 years up/down on date field?

Huge page load on large tables on set_relation

13 March 2012 - 03:23 PM

Hi,

I have a problem of huge load on some large tables.
What I'm trying to do is set a relation to a large table.
There are more than 10,000 records in cities table, 241 records in country table and 64 records in states table.

There is a better way to do this?

Suggestion: When table is huge can we have an ajax loading gif and limit de result to first 500 records.
Can you use some cache, once is fully joined the tables?

Thank you for your time.

SQL

CREATE TABLE IF NOT EXISTS `cities` (
  `country_iso` varchar(2) NOT NULL,
  `state_iso` varchar(2) NOT NULL DEFAULT '',
  `region_id` tinyint(2) unsigned zerofill NOT NULL,
  `place_code` varchar(9) NOT NULL,
  `name_fr` text NOT NULL,
  `name_en` text NOT NULL,
  `url` varchar(43) NOT NULL,
  `lang` enum('fr','en') NOT NULL DEFAULT 'en',
  PRIMARY KEY (`country_iso`,`state_iso`,`place_code`),
  UNIQUE KEY `placeCode` (`place_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `country` (
  `ISO` varchar(2) NOT NULL,
  `nom_fr` varchar(50) NOT NULL,
  `nom_en` varchar(50) NOT NULL,
  `name` varchar(255) NOT NULL,
  `printable_name` int(255) NOT NULL,
  PRIMARY KEY (`ISO`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `states` (
  `country_iso` varchar(2) NOT NULL,
  `state_iso` varchar(2) NOT NULL,
  `name_fr` varchar(50) NOT NULL,
  `name_en` varchar(50) NOT NULL,
  `ip_region` varchar(2) NOT NULL,
  PRIMARY KEY (`country_iso`,`state_iso`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



PHP



$crud = new grocery_CRUD();

$crud->set_theme('datatables');
$crud->set_table('cities');
$crud->set_relation('country_iso', 'country', 'ISO');
$crud->set_relation('state_iso', 'states', 'state_iso');
$crud->set_subject('Ville');
$crud->required_fields('country_iso','state_iso','region_id','place_code','name_fr','name_en','url','lang');
$crud->columns('country_iso','state_iso','region_id','place_code','name_fr','name_en','url','lang');

$output = $crud->render();

$this->_admin_output($output);

Installation error: Fatal error: Call to undefined method CI_DB_mysql_driver::select()

12 March 2012 - 05:22 PM

Sorry to bother with this basic question but I can’t make it work.
Maybe is something in my configuration, maybe not.


So I tried your basic example but I got all the time:
Fatal error: Call to undefined method CI_DB_mysql_driver::select() in C:\xampp\htdocs\...\application\models\grocery_model.php on line 41


I’m sure all files are in place: library, model, assets etc.


Can you help, please?


Many thanks,
Adrian