~[if#sib.pref.familyrepsiblingalert=1]
<a class="dialogDivM" title="~[text:psx.htmlc.admin.instantfamilyreps.adminstudentalert.Siblings]" href="#familyrepsibling" id="alert_familyrepsibling" class="hidden">
    <img src="/images/img/alert_familyrepsibling.png" alt="~[text:psx.htmlc.admin.instantfamilyreps.adminstudentalert.Siblings]">
</a>

<div id="familyrepsibling" class="hidden">
    <table class="grid" style="margin: 0 20px 20px; outline: none;" tabindex="-1" autofocus>
        <thead>
            <tr class="bold">
                <th>~[text:psx.htmlc.admin.instantfamilyreps.adminstudentalert.Name]</th>
                <th>~[text:psx.htmlc.admin.instantfamilyreps.adminstudentalert.Grade]</th>
                <th>~[text:psx.htmlc.admin.instantfamilyreps.adminstudentalert.School]</th>
            </tr>
        </thead>
        <tbody>
            ~[tlist_sql;
            SELECT
                s.lastfirst,
                s.dcid,
                CASE WHEN s.schoolid = ~(curschoolid) THEN 1 ELSE 0 END AS sameschool,
                s.grade_level AS grade,
                schools.name AS school,
                CASE WHEN s.enroll_status = -1 THEN ' (~[text:psx.htmlc.admin.instantfamilyreps.adminstudentalert.Pre-Reg])' END AS status
            FROM Students s
            JOIN schools ON schools.school_number = s.schoolid
            WHERE s.enroll_status in (0,-1)
                AND REGEXP_REPLACE(s.home_phone, '\D+', '') = (SELECT REGEXP_REPLACE(s.home_phone, '\D+', '') FROM students s WHERE s.id = ~(curstudid))
                AND s.id <> ~(curstudid)
            ORDER BY s.grade_level;nonemessage=<div class="nofamilyrepsibling">No Siblings Found</div>]
            <tr>
                <td>
                    ~(lastfirst)&nbsp;
                    <a href="/admin/students/home.html?frn=001~(dcid;t)" target="_blank" class="siblingLinkA" data-sameschool="~(sameschool)" title="~[text:psx.htmlc.admin.instantfamilyreps.adminstudentalert.Open_in_new_tab]">
                        <svg viewBox="0 0 24 24" width="1em" height="1em" fill="currentColor" style="vertical-align: -0.125em;" aria-hidden="true">
                            <path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/>
                        </svg>
                    </a>
                </td>
                <td>~(grade)</td>
                <td>~(school)~(status)</td>
            </tr>
            [/tlist_sql]
        </tbody>
    </table>
    <table style="display:none;"><tr><td>&nbsp;</td></tr></table>
    <div class="feedback-note">
         ~[text:psx.htmlc.admin.instantfamilyreps.adminstudentalert.Siblings_based_on_home_phone]
    </div>
</div>

<script>
    if($j('div.nofamilyrepsibling').length){
        $j('#alert_familyrepsibling').remove();
    } else {
        $j('#alert_familyrepsibling').show();
        ~[if#sch.is.a.school]
        $j('.siblingLinkA[data-sameschool="0"]').remove();
        [/if#sch]
    }
</script>
[/if#sib]