⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

GC newb-need some help



mabbitt

mabbitt
  • profile picture
  • Member

Posted 25 May 2013 - 03:34 AM

hello folks,

newb here..

 

i'm currently learning GC

and want to try something like this..

 

 

the tables

   

 2z9mq6e.png

 

 

 

wanted output..

 

Destination : [a dropdown of city list]

Shipping Line : [a dropdown of line list]

Price : [normal input text]

 

 

i'll appreciate if there someone willing to help this newb.. :D

thanks in advance

 

 


davidoster

davidoster
  • profile picture
  • Member

Posted 25 May 2013 - 05:24 AM

Hello and welcome to the forums.

Try this and let us know if it is what you need.

$crud = new grocery_CRUD();
$crud->set_table('tariff');
$crud->set_relation('city_code', 'city', 'city_name');
$crud->set_relation('line_id', 'line', 'line_type');

mabbitt

mabbitt
  • profile picture
  • Member

Posted 25 May 2013 - 05:34 AM

wow, it works.

thanks a lot...


mabbitt

mabbitt
  • profile picture
  • Member

Posted 26 May 2013 - 02:12 AM

hello again, peeps.

still learning about set_relation,

and feel a bit confused

 

here's the schema

 

 

 

2wpp6cj.jpg

 

 

 

 

 

 

wanted output:

 

trans code:

Destination : [a dropdown of city list]

Shipping Line : [a dropdown of line list]

 

weight:normal text input 

total: generated from multiplying price in tariff by weight in trans

status:a dropdown of status list

trans_date

 

thanks again