Student by Form Group

Hello there.
How to include parent address and phone in student form group?
Any idea…please.
Thank you

Hello there again.
I hope someone will help me.
Some how i was able to get to show student family with phone and email.
But i am can’t get to show student/parent home address.
This a code i am trying to insert in student module (report_students_byFormGroup.php)


I realy need some help please.
Thanks

1 Like

Hi @calx, there is a report called Family Address by Student that may be of use here. Keep in mind that your edits to the core will likely be replaced by new code the next time you update Gibbon. One way to make these custom styles of report is to use the Query Builder module.

Hi there.
Thanks for your replay.
On staff dashboard there is option export to excel.
When teacher export student list in their class it will show all student in their class.
I edited indexExport.php in root directory.
Added few colummn (gender, dob, address1, phone1, emergency1Name, emergency1Number1, emergency2Name, emergency2Number1)
Now looks like this.
$sql = "SELECT surname, firstName, email, gender, dob, address1, phone1, emergency1Name, emergency1Number1, emergency2Name, emergency2Number1.


How to show a student parent name, phone and address?
Thank you

Hi @calx Adding this data would require more complex table joins in the query, which is best done using the Query Builder, as the class list export isn’t necessarily meant to be used as a full student directory.

For example, a more complete export of student and parent data might look like:

SELECT DISTINCT 
    student.surname AS studentSurname, 
    student.preferredName AS studentpreferredName, 
    gibbonFamily.name as family, 
    homeAddress, 
    homeAddressDistrict, 
    homeAddressCountry,gibbonFormGroup.name AS formGroup, 
    student.gender AS studentGender, 
    student.officialName AS studentOfficialName, 
    student.nameInCharacters AS studentChineseName, 
    student.studentID AS studentID, 
    student.email AS studentEmail, 
    student.phone1 AS studentPhone1, 
    student.phone2 AS studentPhone2, 
    parent1.title AS parent1Title, 
    parent1.surname AS parent1Surname, 
    parent1.preferredName AS parent1PreferredName, 
    parent1.gender AS parent1Gender, 
    parent1.email AS parent1Email, 
    CONCAT(parent1.phone1Type,' ',parent1.phone1CountryCode,' ', parent1.phone1) AS parent1phone1, 
    CONCAT(parent1.phone2Type,' ',parent1.phone2CountryCode,' ', parent1.phone2) AS parent1phone2, 
    CONCAT(parent1.phone3Type,' ',parent1.phone3CountryCode,' ', parent1.phone3) AS parent1phone3, 
    CONCAT(parent1.phone4Type,' ',parent1.phone4CountryCode,' ', parent1.phone4) AS pparent1hone4, 
    parent1.address1 AS parent1Address, 
    parent1.address1District AS parent1AddressDistrict, 
    parent1.address1Country AS parent1AddressCountry, 
    parent1.vehicleRegistration AS parent1VehicleRegistration, 
    parent1Fam.contactCall, 
    parent1Fam.contactSMS, 
    parent1Fam.contactEmail, 
    parent1Fam.contactMail, 
    parent1Fam.contactPriority, 
    parent2.title AS parent2Title, 
    parent2.surname AS parent2Surname, 
    parent2.preferredName AS parent2PreferredName, 
    parent2.gender AS parent2Gender, 
    parent2.email AS parent2Email, 
    CONCAT(parent2.phone1Type,' ',parent2.phone1CountryCode,' ', parent2.phone1) AS parent2phone1, 
    CONCAT(parent2.phone2Type,' ',parent2.phone2CountryCode,' ', parent2.phone2) AS parent2phone2, 
    CONCAT(parent2.phone3Type,' ',parent2.phone3CountryCode,' ', parent2.phone3) AS parent2phone3, 
    CONCAT(parent2.phone4Type,' ',parent2.phone4CountryCode,' ', parent2.phone4) AS parent2phone4, 
    parent2.address1 AS parent2Address, 
    parent2.address1District AS parent2AddressDistrict, 
    parent2.address1Country AS parent2AddressCountry, 
    parent2.vehicleRegistration AS parent2VehicleRegistration, 
    parent2Fam.contactCall, 
    parent2Fam.contactSMS, 
    parent2Fam.contactEmail, 
    parent2Fam.contactMail, 
    parent2Fam.contactPriority
FROM 
    gibbonPerson AS student
    JOIN gibbonStudentEnrolment ON (student.gibbonPersonID=gibbonStudentEnrolment.gibbonPersonID)
    JOIN gibbonFormGroup ON (gibbonFormGroup.gibbonFormGroupID=gibbonStudentEnrolment.gibbonFormGroupID)
    LEFT JOIN gibbonFamilyChild ON (gibbonFamilyChild.gibbonPersonID=student.gibbonPersonID)
    LEFT JOIN gibbonFamily ON (gibbonFamilyChild.gibbonFamilyID=gibbonFamily.gibbonFamilyID)
    LEFT JOIN gibbonFamilyAdult AS parent1Fam ON (parent1Fam.gibbonFamilyID=gibbonFamily.gibbonFamilyID AND parent1Fam.contactPriority=1)
    LEFT JOIN gibbonPerson AS parent1 ON (parent1Fam.gibbonPersonID=parent1.gibbonPersonID AND parent1.status='Full')
    LEFT JOIN gibbonFamilyAdult AS parent2Fam ON (parent2Fam.gibbonFamilyID=gibbonFamily.gibbonFamilyID AND parent2Fam.contactPriority=2)
    LEFT JOIN gibbonPerson AS parent2 ON (parent2Fam.gibbonPersonID=parent2.gibbonPersonID AND parent2.status='Full')
WHERE 
    gibbonStudentEnrolment.gibbonSchoolYearID=(SELECT gibbonSchoolYearID FROM gibbonSchoolYear WHERE status='Current') 
    AND student.status='Full';