griffin
Member
I have list of Registrations - nregister - for students to register for a course. In this list I have PHP Plugin to take some of the student's information from nregister to the Student Management System list - sms - which creates the student's record of learning which is done once they are confirmed as attending the course.
This works fine however I would like it to redirect to the SMS after executed. Wiki says:
Programming constraints(top)
Would someone be able to provide the js code I need to achieve the redirect after execution. I would very much appreciate help with this as have no experience with java script.
ALSO, how can I prevent duplicates of students on the SMS list? Don't want to have the student having more than one record of learning on SMS for a course - I do want to be able to create more than one record for a student where they attend more than one course.
Is there are way to indicate on the NREGISTER list that the student has been created on the SMS list?
Thanks in advance - really appreciate any help with this.
$db = JFactory :: getDbo();
$ids = JRequest::getVar('ids', array());
JArrayHelper::toInteger($ids); // ensure that they really are numbers!
$record = "INSERT INTO sms (studentid,firstname,lastname) SELECT id,firstname,lastname FROM nregister WHERE id IN (" . implode(',', $ids) . ")";
$db-> setQuery ($record);
$db->query();
This works fine however I would like it to redirect to the SMS after executed. Wiki says:
Programming constraints(top)
Because AJAX ... < to be explained... >
some PHP can't be done :
- Redirection to an URL
- Load a specific Form
For these purposes, use Javascript Plugin.
Would someone be able to provide the js code I need to achieve the redirect after execution. I would very much appreciate help with this as have no experience with java script.
ALSO, how can I prevent duplicates of students on the SMS list? Don't want to have the student having more than one record of learning on SMS for a course - I do want to be able to create more than one record for a student where they attend more than one course.
Is there are way to indicate on the NREGISTER list that the student has been created on the SMS list?
Thanks in advance - really appreciate any help with this.