hi,
this is what i am doing,
in the add function
$funareas = $this->Funcionario->Funtoare->Funarea->generateList();
in the add view
<?php echo $form->input('funare_id', array('options' =>
$funareas,'multiple'=>'true'));?>
then in the add function of the controller after saved
$fun_id = $this->Funcionario->getLastInsertId();
foreach($this->data['Funcionario']['funare_id'] as $funare):
  $funareas = $this->Funcionario->Funtoare->execute('insert into
funtoares(funarea_id,funcionario_id) values('.$funare.','.
$fun_id.')');
endforeach;

the model is this:
i have a employee that has several sectors, and this relation n to n
is broken with the table
funtoares.
Inserting is not my problem, i have no idea how to search for the
sectors selected and then display them, the selected and the no
selected, in the list of the edit view. i do not know what to do
please help me, should I change the idea an do it with check boxes.
Hope you understand my question
Christian Andrade
Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to