anilherath
(Anilherath)
September 15, 2012, 11:42am
1
Hi All,
I have only two weeks experience in yii.
My situation is like this.
I have three tables student, class and attendance. student and class tables are not related, But attendance table contain student_id and class_id.
I want to create a view to select attended students to a selected class as follows;
Select a class from list. ( Table: class)
Select students by checkbox list.( Table: Student)
Update the attendance table by class_id and selected student_ids.
Avoid duplication of class_id, student_id combination in attendance table.
It’s really appreciate any help to create relevant MVC pages.
So far I checked following pages, but still failed to solve the situation.
http://www.yiiframework.com/doc/guide/1.1/en/database.ar
yiiframework.ru/doc/guide/en/database.arr
http://www.yiiframework.com/forum/index.php/topic/35072-cgridview-with-ccheckboxcolumn/page__p__168655__fromsearch__1#entry168655
Thanks for any support.
anilherath
(Anilherath)
September 15, 2012, 1:27pm
3
Dear Orey,
Thank you very much for the quick reply.
I tried to use the extension multimodelforms before. It didn’t meet with my requirements.
I never thought about such a big list of extensions until your suggestion. Thanks for that and I’ll try them.
Actually my biggest problem is, " How to post (from view) and get (in controller) two data columns. ( class_id is only one record while student_id will be more than one at a time).
Check out this post on how to display many-many checkboxes. This technique uses cadvancedarbehavior.
Matt
anilherath
(Anilherath)
September 17, 2012, 7:19pm
5
Thank you very much.
This is a life saver. Worked like charm.