I have the following situation:
I have Subject, Seminar, Participants and Pending.
I register participants in Seminars for a specific Subject.
If a Seminar is cancelled, the registered Participants go into Pending (so in the next Seminar of the same subject, the user will be notified about these pending Participants).
How can I display these pending participants in the registration form?
Seminar Model:
public function createPending(){
$listParticipants=Register::model()->findAllByAttributes(array('seminarID'=>$this->seminarID));
foreach ($listParticipants as $lp){
$pending=new Pending();
$pending->subjectID=$this->subjectID;
$pending->participantID=$lp->participantID;
$pending->save();
}
}
Registration _form:
<div class="row">
<?php echo $form->labelEx($model,'seminarID'); ?>
<?php echo $form->textField($model,'seminarID',$model->getSeminar()); ?>
<?php echo $form->error($model,'seminarID'); ?>
</div>
And here is what I want: when a seminar is selected (which is of a specific subject)
I want to show here if there is any pending participant for the same subject...
and I want to select from this list and it should store that participant ID in the registration.
How can it work at the same time when there is also the below field for selecting participants?
<div class="row">
<?php echo $form->labelEx($model,'participantID'); ?>
<?php echo $form->dropDownList($model,'participantID',$model->getParticipant()); ?>
<?php echo $form->error($model,'cTeilnehmerID'); ?>
</div>