$(document).ready(function() {

    function getQueryParams() {
        const params = new URLSearchParams(window.location.search);
        return {
            name: params.get('name'),
            group_names: params.get('group_names'),
            position: params.get('position'),
            cid_no: params.get('cid_no'),
            mobile_no: params.get('mobile_no'),
            email: params.get('email')
        };
    }

    const apiData = getQueryParams();

    if (apiData.name) $('#name').text(apiData.name);
    if (apiData.group_names) $('#group_names').text(apiData.group_names);
    if (apiData.position) $('#position').text(apiData.position);
    if (apiData.cid_no) $('#cid_no').text(apiData.cid_no);
    if (apiData.mobile_no) $('#mobile_no').text(apiData.mobile_no);
    if (apiData.email) $('#email').text(apiData.email);
});
