<!DOCTYPE html>
<html>
<head>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap" rel="stylesheet">
</head>
<body>

<?php
    ob_start(); // Start get HTML code
    session_start();
    require_once '../../include/condb_help.php'; 
    require_once __DIR__ . '/vendor/autoload.php';

    // กำหนดขนาดกระดาษ A4
    $mpdf = new \Mpdf\Mpdf(['format' => 'A4']);

    $mpdf->SetTitle('รายงาน');

    $mpdf->AddPageByArray([
        'margin-left' => '15mm',
        'margin-right' => '20mm',
        'margin-top' => '15mm',
        'margin-bottom' => '5mm',
    ]);

    function DateThai($strDate){
        $strYear = date("Y",strtotime($strDate))+543;
        $strMonth= date("n",strtotime($strDate));
        $strDay= date("j",strtotime($strDate));
        $strHour= date("H",strtotime($strDate));
        $strMinute= date("i",strtotime($strDate));
        $strSeconds= date("s",strtotime($strDate));
        $strMonthCut = Array("","มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม");
        $strMonthThai=$strMonthCut[$strMonth];
         return "$strDay $strMonthThai $strYear";
    }


    $idnumber       = (isset($_GET['idnumber']) ? $_GET['idnumber'] : '');
    $head_class     = (isset($_GET['head_class']) ? $_GET['head_class'] : '');

    $query = "SELECT * FROM tbl_head WHERE head_idnumber = '$idnumber'";
    $result = $conn->query($query);
    $row = $result->fetch_assoc();

    $queryHeadClass = "SELECT * FROM tbl_headclass WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND head_class = '$head_class'";
    $resultHeadClass = $conn->query($queryHeadClass);
    $rowHeadClass = $resultHeadClass->fetch_assoc();
?>

<div id="hid">
    <h1> ปริ้นท์ <a href="Report.pdf">คลิกที่นี้</a> </h1>
</div>

<table style="width: 100%;">
    <tr>
        <td style="width: 33.33%;"></td>
        <td style="text-align: center; width: 33.33%;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 120px; height: 120px;">
        </td>
        <td style="text-align: right; width: 33.33%;">
            <?php  
                if($row["head_img"] != ""){

                    echo '<img src="../img/student/'.$row["head_img"].'" style="width: 120px; height: 120px;">';

                }else{

                    echo '<img src="../img/student/null.png" style="width: 120px; height: 120px;">';

                }
            ?>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td colspan="2" style="text-align: center; padding-top: 10px;">
            <h1>งานระบบดูแลช่วยเหลือนักเรียน</h1>
            <h2>กลุ่มงานกิจการนักเรียน ฝ่ายปกครอง</h2>
            <h2>โรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center; padding-top: 120px; padding-bottom: 120px; ">
            <h2>
                เลขประจำตัวนักเรียน&nbsp;
                <!--
                <span style="border-bottom:2px dotted;">
                    &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
                </span>
                -->
                <span><?php echo $row["head_idnumber"]; ?></span>
            </h2>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center; padding-bottom: 10px;">
            <h3 class="textsubtitle">
                ชื่อ
                <span><?php echo $row["head_pre"].$row["head_name"]; ?></span>
                &nbsp;
                สกุล
                <span><?php echo $row["head_lname"]; ?></span>
            </h3>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center;">
            <h3 class="textsubtitle">
                ชั้น ม.
                <span><?php echo $rowHeadClass["headc_class_one"]; ?></span>
                &nbsp;
                เลขที่
                <span><?php echo $rowHeadClass["headc_number_one"]; ?></span>
                &nbsp;
                ปีการศึกษา
                <span><?php echo $rowHeadClass["headc_year_one"]; ?></span>
            </h3>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center;">
            <h3 class="textsubtitle">
                ชั้น ม.
                <span><?php echo $rowHeadClass["headc_class_two"].$rowHeadClass["headc_class_twolap"]; ?></span>
                &nbsp;
                เลขที่
                <span><?php echo $rowHeadClass["headc_number_two"]; ?></span>
                &nbsp;
                ปีการศึกษา
                <span><?php echo $rowHeadClass["headc_year_two"]; ?></span>
            </h3>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center;">
            <h3 class="textsubtitle">
                ชั้น ม.
                <span><?php echo $rowHeadClass["headc_class_three"].$rowHeadClass["headc_class_threelap"]; ?></span>
                &nbsp;
                เลขที่
                <span><?php echo $rowHeadClass["headc_number_three"]; ?></span>
                &nbsp;
                ปีการศึกษา
                <span><?php echo $rowHeadClass["headc_year_three"]; ?></span>
            </h3>
        </td>
    </tr>
    <tr>
        <td style="width: 50%; text-align: right; padding-top: 30px;">
            <h3 class="textsubtitle">
                ปีที่ 1 &nbsp;ชั้น ม.
                <span><?php echo $rowHeadClass["headc_class_one"].$rowHeadClass["headc_class_onelap"]; ?></span>
                &nbsp;
            </h3>
        </td>
        <td style="width: 50%; text-align: left; padding-top: 30px;">
            <h3 class="textsubtitle">
                ครูที่ปรึกษา 1.  
                <span>
                    
                    <?php  
                        if($rowHeadClass["headc_tcone_one"] != ""){

                            echo $rowHeadClass["headc_tcone_one"];

                        }else{

                            echo "-";

                        }
                    ?>
                    
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td style="width: 50%; text-align: right;"></td>
        <td style="width: 50%; text-align: left;">
            <h3 class="textsubtitle">
                ครูที่ปรึกษา 2.  
                <span>
                    
                    <?php  
                        if($rowHeadClass["headc_tctwo_one"] != ""){

                            echo $rowHeadClass["headc_tctwo_one"];

                        }else{

                            echo "-";

                        }
                    ?>
                    
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td style="width: 50%; text-align: right; padding-top: 30px;">
            <h3 class="textsubtitle">
                ปีที่ 2 &nbsp;ชั้น ม.
                <span><?php echo $rowHeadClass["headc_class_two"].$rowHeadClass["headc_class_twolap"]; ?></span>
                &nbsp;
            </h3>
        </td>
        <td style="width: 50%; text-align: left; padding-top: 30px;">
            <h3 class="textsubtitle">
                ครูที่ปรึกษา 1.
                <span>
                
                    <?php  
                        if($rowHeadClass["headc_tcone_two"] != ""){

                            echo $rowHeadClass["headc_tcone_two"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td style="width: 50%; text-align: right;"></td>
        <td style="width: 50%; text-align: left;">
            <h3 class="textsubtitle">
                ครูที่ปรึกษา 2.
                <span>
                   
                    <?php  
                        if($rowHeadClass["headc_tctwo_two"] != ""){

                            echo $rowHeadClass["headc_tctwo_two"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td style="width: 50%; text-align: right; padding-top: 30px;">
            <h3 class="textsubtitle">
                ปีที่ 3 &nbsp;ชั้น ม.
                <span><?php echo $rowHeadClass["headc_class_three"].$rowHeadClass["headc_class_threelap"]; ?></span>
                &nbsp;
            </h3>
        </td>
        <td style="width: 50%; text-align: left; padding-top: 30px;">
            <h3 class="textsubtitle">
                ครูที่ปรึกษา 1.&nbsp;  
                <span>
                    <?php  
                        if($rowHeadClass["headc_tcone_three"] != ""){

                            echo $rowHeadClass["headc_tcone_three"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td style="width: 50%; text-align: right;"></td>
        <td style="width: 50%; text-align: left;">
            <h3 class="textsubtitle">
                ครูที่ปรึกษา 2.
                <span>
                    
                    <?php  
                        if($rowHeadClass["headc_tctwo_three"] != ""){

                            echo $rowHeadClass["headc_tctwo_three"];

                        }else{

                            echo "-";

                        }
                    ?>
                
                </span>
            </h3>
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- คำนำ (3) --------------------------->

<table>
    <tr>
        <td style="text-align: center;">
            <h1>คำนำ</h1>
        </td>
    </tr>
    <tr>
        <td>
            <img src="images/1.jpg" style="width: 100%;">
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- บันทึกการส่งตรวจระบบดูแลช่วยเหลือนักเรียน (4) --------------------------->

<h2 style="text-align: center;">บันทึกการส่งตรวจระบบดูแลช่วยเหลือนักเรียน</h2>

<table>
    <tr>
        <th width="15%"><h3>ครั้งที่</h3></th>
        <th width="20%"><h3>วัน เดือน ปี</h3></th>
        <th width="20%"><h3>หัวหน้าระดับชั้น</h3></th>
        <th width="20%"><h3>รองผู้อำนวยการฯ<br />ผ่ายปกครอง</h3></th>
        <th width="25%"><h3>ผู้อำนวยการ<br />สถานศึกษา</h3></th>
    </tr>

    <?php 
        $sql = "SELECT * FROM tbl_headcheck
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND head_class = '$head_class' ORDER BY headcheck_no ASC";
        $query = $conn->query($sql);
        $i = 0;
        while($row = $query->fetch_assoc()){ $i = $i + 1;
    ?>

    <tr>
        <th>
            <?php echo '<h3>'.$row['headcheck_no'].'</h3>'; ?>
                                                                    
            <?php  

                if($row['headcheck_no'] == 1)
                {

                    echo '<h3>
                    ภาคเรียนที่ 1 <br />
                    ปีการศึกษา <br />
                        <span>'.$rowHeadClass['headc_year_one'].'</span>
                    </h3>';

                }
                elseif($row['headcheck_no'] == 2)
                {

                    echo '<h3>
                    ภาคเรียนที่ 2 <br />
                    ปีการศึกษา <br />
                        <span>'.$rowHeadClass['headc_year_one'].'</span>
                   </h3>';

                }
                elseif($row['headcheck_no'] == 3)
                {

                    echo '<h3>
                    ภาคเรียนที่ 1 <br />
                    ปีการศึกษา <br />
                        <span>'.$rowHeadClass['headc_year_two'].'</span>
                    </h3>';

                }
                elseif($row['headcheck_no'] == 4)
                {

                    echo '<h3>
                    ภาคเรียนที่ 2 <br />
                    ปีการศึกษา <br />
                        <span>'.$rowHeadClass['headc_year_two'].'</span>
                    </h3>';

                }
                elseif($row['headcheck_no'] == 5)
                {

                    echo '<h3>
                    ภาคเรียนที่ 1 <br />
                    ปีการศึกษา <br />
                        <span>'.$rowHeadClass['headc_year_three'].'</span>
                    </h3>';

                }
                elseif($row['headcheck_no'] == 6)
                {

                    echo '<h3>
                    ภาคเรียนที่ 2 <br />
                    ปีการศึกษา <br />
                        <span>'.$rowHeadClass['headc_year_three'].'</span>
                    </h3>';

                }else{}

            ?>
        </th>
        <th>

            <?php 
                if($row['headcheck_date'] != ""){

                    echo '<h5><span>'.DateThai($row['headcheck_date']).'</span></h5>';

                }else{

                    echo "<h5>-</h5>";

                }
            ?>

        </th>
        <th>

            <?php 
                if($row['headcheck_classleader'] != ""){

                    echo '<h5><span>'.$row['headcheck_classleader'].'</span></h5>';

                }else{

                    echo "<h5>-</h5>";

                }
            ?>

        </th>
        <th>

            <?php 
                if($row['headcheck_minor'] != ""){

                    echo '<h5><span>'.$row['headcheck_minor'].'</span></h5>';

                }else{

                    echo "<h5>-</h5>";

                }
            ?>

        </th>
        <th>

            <?php 
                if($row['headcheck_director'] != ""){

                    echo '<h5><span>'.$row['headcheck_director'].'</span></h5>';

                }else{

                    echo "<h5><span>-</span></h5>";

                }
            ?>

        </th>
    </tr>

    <?php } ?>

</table>

<pagebreak/>

<!-- -------------------------- ข้อมูลนักเรียนและผู้ปกครอง (5) --------------------------->

<?php 
    $querysp = "SELECT * FROM tbl_headstudents_and_parents WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $resultsp = $conn->query($querysp);
    $rowsp = $resultsp->fetch_assoc();
?>

<h2 style="text-align: center;">ข้อมูลนักเรียนและผู้ปกครอง</h2>

<table>
    <tr>
        <td>
            <h3>
                ชื่อนักเรียน :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_name"] != ""){

                            echo $rowsp["sp_name"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h3>
        </td>
        <td>
            <h5>
                นามสกุล :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_lname"] != ""){

                            echo $rowsp["sp_lname"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                ชื่อเล่น :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_nickname"] != ""){

                            echo $rowsp["sp_nickname"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h3>
                ชื่อผู้ปกครอง :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parentsname"] != ""){

                            echo $rowsp["sp_parentsname"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h3>
        </td>
        <td>
            <h5>
                นามสกุล :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parentslname"] != ""){

                            echo $rowsp["sp_parentslname"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                ชื่อเล่น :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parentsnickname"] != ""){

                            echo $rowsp["sp_parentsnickname"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                อาชีพ :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parprofession"] != ""){

                            echo $rowsp["sp_parprofession"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                ศาสนา :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parreligion"] != ""){

                            echo $rowsp["sp_parreligion"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                เกี่ยวข้องกับนักเรียนเป็น :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_status"] != ""){

                            echo $rowsp["sp_status"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td colspan="5"><h3>ที่อยู่ปัจจุบันของผู้ปกครอง (ที่ติดต่อได้สะดวก)</h3></td>
    </tr>
    <tr>
        <td>
            <h5>
                อยู่บ้านเลขที่ :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parhousenumber"] != ""){

                            echo $rowsp["sp_parhousenumber"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                หมู่ที่ :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parmoo"] != ""){

                            echo $rowsp["sp_parmoo"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                ซอย :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parsoi"] != ""){

                            echo $rowsp["sp_parsoi"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                ถนน :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parroad"] != ""){

                            echo $rowsp["sp_parroad"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                ตำบล :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parsubdistricts"] != ""){

                            echo $rowsp["sp_parsubdistricts"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                อำเภอ :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_pardistrict"] != ""){

                            echo $rowsp["sp_pardistrict"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                จังหวัด :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parprovince"] != ""){

                            echo $rowsp["sp_parprovince"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td colspan="3">
            <h5>
                โทรศัพท์ :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_partel"] != ""){

                            echo $rowsp["sp_partel"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                สถานที่ทำงาน :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parworkplace"] != ""){

                            echo $rowsp["sp_parworkplace"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td colspan="4">
            <h5>
                โทรศัพท์ทำงาน :&nbsp;  
                <span>
                    <?php  
                        if($rowsp["sp_parworktel"] != ""){

                            echo $rowsp["sp_parworktel"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>
</table>

<?php
    $sqlReport = "SELECT * FROM tbl_headreport
    WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' ORDER BY rep_no ASC";
    $queryReport = $conn->query($sqlReport);
    while($rowReport = $queryReport->fetch_assoc()){
?>

<h2 style="text-align: center;">
    รายงานการดูแลช่วยเหลือนักเรียน ณ วันสิ้นปีการศึกษา&nbsp;  
    <span>
        <?php  
            if($rowReport["rep_year"] != ""){

                echo $rowReport["rep_year"];

            }else{

                echo "-";

            }
        ?>
    </span>
</h2>

<table>
    <tr>
        <td colspan="2">
            <h3>
                ด้านการเรียน :&nbsp;
                <span>
                 
                    <?php  
                        if($rowReport["rep_learn"] != ""){

                            echo $rowReport["rep_learn"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <h3>
                ด้านพฤติกรรม :&nbsp;
                <span>
                 
                    <?php  
                        if($rowReport["rep_actions"] != ""){

                            echo $rowReport["rep_actions"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td colspan="2">
             <h3>
                ด้านสุขภาพ :&nbsp;
                <span>
                 
                    <?php  
                        if($rowReport["rep_health"] != ""){

                            echo $rowReport["rep_health"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <h3>
                ด้านการช่วยเหลือ (ถ้ามี) :&nbsp;
                <span>
                 
                    <?php  
                        if($rowReport["rep_help"] != ""){

                            echo $rowReport["rep_help"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>
            </h3>
        </td>
    </tr>
    <tr>
        <td style="text-align: center;">
            
            <?php 
                if($rowReport['rep_no'] == 1){

                    if($rowHeadClass['headc_tcone_one'] != ""){

                        echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tcone_one'].'</span> ครูที่ปรึกษา                            
                        <br />
                        (...............................................)</h5>';

                    }else{

                        echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                        <br />
                        &nbsp;&nbsp;(...................................................)</h5>';

                    }

                    }elseif($rowReport['rep_no'] == 2){

                        if($rowHeadClass['headc_tcone_two'] != ""){

                            echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tcone_two'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                        }else{

                            echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                        }

                    }elseif($rowReport['rep_no'] == 3){

                        if($rowHeadClass['headc_tcone_three'] != ""){

                            echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tcone_three'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                        }else{

                            echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                        }

                    }else{}
                ?>

        </td>
        <td style="text-align: center;">
            
            <?php 
                if($rowReport['rep_no'] == 1){

                    if($rowHeadClass['headc_tctwo_one'] != ""){

                        echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tctwo_one'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                    }else{

                        echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                    }

                }elseif($rowReport['rep_no'] == 2){

                    if($rowHeadClass['headc_tctwo_two'] != ""){

                        echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tctwo_two'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                    }else{

                        echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                    }

                }elseif($rowReport['rep_no'] == 3){

                    if($rowHeadClass['headc_tctwo_three'] != ""){

                        echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tctwo_three'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                    }else{

                        echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                    }

                }else{}
            ?>

        </td>
    </tr>
</table>

<?php } ?>

<pagebreak/>

<!-- -------------------------- การคัดกรองนักเรียน (6) --------------------------->

<table>
    <tr>
        <td style="text-align: center; padding-top: 350px;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 200px; height: 200px;">
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 10px;">
            <h6>การคัดกรองนักเรียน</h6>
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- สรุปผลการคัดกรองนักเรียน (7) --------------------------->

<?php
    $sqlScreening = "SELECT * FROM tbl_screening
    WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' ORDER BY scr_id ASC";
    $queryScreening = $conn->query($sqlScreening);
    while($rowScreening = $queryScreening->fetch_assoc()){
?>

<h2 style="text-align: center; padding-top: 10px; padding-bottom: -5px;">

    สรุปผลการคัดกรองนักเรียน ปีที่ <?php echo $rowScreening['scr_year_no']; ?>&nbsp; ปีการศึกษา
    <span>
        <?php  
            if($rowScreening["scr_year"] != ""){

                echo $rowScreening["scr_year"];

            }else{

                echo "-";

            }
        ?>
    </span>
</h2>

<table>
    <tr>
        <tr style="text-align: center;">
            <th rowspan="2"><h3>ด้าน</h3></th>
            <th colspan="3"><h3>ระดับการคัดกรอง</h3></th>
            <th rowspan="2"><h3>บึกทึกเพิ่มเติมหรือบันทึกช่วยจำ<br />(ถ้ามี)</h3></th>
        </tr>
    </tr>
    <tr style="text-align: center;">
        <th><h3>3</h3></th>
        <th><h3>2</h3></th>
        <th><h3>1</h3></th>
    </tr>
    <tr>
        <th width="20%" style="text-align: center;"><h5>พฤติกรรม/อารมณ์</h5></th>
        <th width="10%">

            <?php  
                if($rowScreening['scr_behavior'] == '3'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

            }else{} ?>

        </th>
        <th width="10%">

            <?php  
                if($rowScreening['scr_behavior'] == '2'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

            }else{} ?>

        </th>
        <th width="10%">

            <?php  
                if($rowScreening['scr_behavior'] == '1'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

            }else{} ?>

        </th width="50%">
        <th style="text-align: left;">

            <?php  
                if($rowScreening['scr_behavior_note'] != ""){

                    echo '<h5><span>'.$rowScreening['scr_behavior_note'].'</span></h5>';

            }else{ echo "-"; } ?>

        </th>
    </tr>

    <tr>
        <th style="text-align: center;"><h5>การเรียนรู้</h5></th>
        <th>

            <?php  
                if($rowScreening['scr_learning'] == '3'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

            }else{} ?>

        </th>
        <th>

            <?php  
                if($rowScreening['scr_learning'] == '2'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

            }else{} ?>

        </th>
        <th>

            <?php  
                if($rowScreening['scr_learning'] == '1'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

            }else{} ?>

        </th>
        <th style="text-align: left;">

            <?php  
                if($rowScreening['scr_learning_note'] != ""){

                    echo '<h5><span>'.$rowScreening['scr_learning_note'].'</span></h5>';

            }else{ echo "-"; } ?>

        </th>
    </tr>

    <tr>
        <th style="text-align: center;"><h5>สุขภาพ</h5></th>
        <th>

            <?php  
                if($rowScreening['scr_health'] == '3'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

            }else{} ?>

        </th>
        <th>

            <?php  
                if($rowScreening['scr_health'] == '2'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

            }else{} ?>

        </th>
        <th>

            <?php  
                if($rowScreening['scr_health'] == '1'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

            }else{} ?>

        </th>
        <th style="text-align: left;">

            <?php  
                if($rowScreening['scr_health_note'] != ""){

                    echo '<h5><span>'.$rowScreening['scr_health_note'].'</span></h5>';

            }else{ echo "-"; } ?>

        </th>
    </tr>

    <tr>
        <th style="text-align: center;"><h5>สภาพครอบครัว</h5></th>
        <th>

            <?php  
                if($rowScreening['scr_family'] == '3'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

            }else{} ?>

        </th>
        <th>

            <?php  
                if($rowScreening['scr_family'] == '2'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

            }else{} ?>

        </th>
        <th>

            <?php  
                if($rowScreening['scr_family'] == '1'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                      <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

            }else{} ?>

        </th>
        <th style="text-align: left;">

            <?php  
                if($rowScreening['scr_family_note'] != ""){

                    echo '<h5><span>'.$rowScreening['scr_family_note'].'</span></h5>';

            }else{ echo "-"; } ?>

        </th>
    </tr>
</table>

<div style="padding-top: 10px;"></div>

<table>
    <tr>
        <td style="text-align: center; width: 50%;">
            
            <?php 
                if($rowScreening['scr_year_no'] == 1){

                    if($rowHeadClass['headc_tcone_one'] != ""){

                        echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tcone_one'].'</span> ครูที่ปรึกษา                            
                        <br />
                        (...............................................)</h5>';

                    }else{

                        echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                        <br />
                        &nbsp;&nbsp;(...................................................)</h5>';

                    }

                    }elseif($rowScreening['scr_year_no'] == 2){

                        if($rowHeadClass['headc_tcone_two'] != ""){

                            echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tcone_two'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                        }else{

                            echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                        }

                    }elseif($rowScreening['scr_year_no'] == 3){

                        if($rowHeadClass['headc_tcone_three'] != ""){

                            echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tcone_three'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                        }else{

                            echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                        }

                    }else{}
                ?>

        </td>
        <td style="text-align: center; width: 50%;">
            
            <?php 
                if($rowScreening['scr_year_no'] == 1){

                    if($rowHeadClass['headc_tctwo_one'] != ""){

                        echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tctwo_one'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                    }else{

                        echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                    }

                }elseif($rowScreening['scr_year_no'] == 2){

                    if($rowHeadClass['headc_tctwo_two'] != ""){

                        echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tctwo_two'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                    }else{

                        echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                    }

                }elseif($rowScreening['scr_year_no'] == 3){

                    if($rowHeadClass['headc_tctwo_three'] != ""){

                        echo '<h5>ลงชื่อ <span>'.$rowHeadClass['headc_tctwo_three'].'</span> ครูที่ปรึกษา                            
                            <br />
                            (...............................................)</h5>';

                    }else{

                        echo '<h5>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ลงชื่อ <span style="color: #000;">..............................................</span> ครูที่ปรึกษา
                            <br />
                            &nbsp;&nbsp;(...................................................)</h5>';

                    }

                }else{}
            ?>

        </td>
    </tr>
</table>

<?php } ?>

<pagebreak/>

<!-- -------------------------- แบบคัดกรองนักเรียนรายบุคคล (8) --------------------------->

<table>
    <tr>
        <td style="text-align: center;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 120px; height: 120px;">
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 10px;">
            <h1>แบบคัดกรองนักเรียนรายบุคคล</h1>
        </td>
    </tr>
    <tr>
        <td>
            <img src="images/2.jpg" style="width: 100%;">
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- แบบคัดกรองนักเรียนด้านพฤติกรรมและอารมณ์ (9) --------------------------->

<table>
    <tr>
        <td style="text-align: center;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 80px; height: 80px;">
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 10px;">
            <h1>แบบคัดกรองนักเรียนด้านพฤติกรรมและอารมณ์</h1>
        </td>
    </tr>
    <tr>
        <td style="text-align: left;">
            <h3>
                <u>คำชี้แจง</u> ให้ทำเครื่องหมาย
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                    <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                </svg>
                ในช่องที่ตรงกับลักษณะของนักเรียน
            </h3>
        </td>
    </tr>
</table>

<table>
    <tr style="text-align: center;">
        <th rowspan="2"><h3>ที่</h3></th>
        <th rowspan="2"><h3>รายการพฤติกรรม</h3></th>
        <th colspan="2"><h3>ปีที่ 1</h3></th>
        <th colspan="2"><h3>ปีที่ 2</h3></th>
        <th colspan="2"><h3>ปีที่ 3</h3></th>
    </tr>
    <tr style="text-align: center;">
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>1</h5></th>
        <th style="text-align: left;"><h5>มาโรงเรียนสายบ่อย</h5></th>

        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_1'] == 'ใช่'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_1'] == 'ไม่ใช่'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>2</h5></th>
        <th style="text-align: left;"><h5>มีนิสัยลักเล็กขโมยน้อย</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_two'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_two'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>3</h5></th>
        <th style="text-align: left;"><h5>ก้าวร้าว ชอบรังแกผู้อื่น</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_three'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_three'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>4</h5></th>
        <th style="text-align: left;"><h5>มักพูดโกหกเป็นนิสัย</h5></th>

        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_four'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_four'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>                                             
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>5</h5></th>
        <th style="text-align: left;"><h5>ดื้อ ไม่ค่อยเชื่อฟัง</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_five'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_five'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>                                                    
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>6</h5></th>
        <th style="text-align: left;"><h5>ทำงานไม่เสร็จ ไม่ส่งการบ้านเป็นประจำ</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_six'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';  

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_six'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>7</h5></th>
        <th style="text-align: left;"><h5>เฉื่อยช้า ทำงานช้า</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_seven'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_seven'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>8</h5></th>
        <th style="text-align: left;"><h5>นั่งหลับในห้องเรียนบ่อยๆ</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_eight'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_eight'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>9</h5></th>
        <th style="text-align: left;"><h5>ขี้อาย ไม่มั่นใจในตัวเอง</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_nine'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_nine'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->

    <tr>
        <th style="text-align: center;"><h5>10</h5></th>
        <th style="text-align: left;"><h5>ขี้โมโห ฉุนเฉียว</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_ten'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_ten'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>11</h5></th>
        <th style="text-align: left;"><h5>อยู่ไม่เป็นสุขเวลาเรียน</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_eleven'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_eleven'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>12</h5></th>
        <th style="text-align: left;"><h5>ทำอะไรนานๆ ไม่ได้</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_twelve'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_twelve'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>13</h5></th>
        <th style="text-align: left;"><h5>ทำอะไรนานๆ ไม่ได้</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_thirteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_thirteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>14</h5></th>
        <th style="text-align: left;"><h5>ขี้กลัว ตกใจง่าย</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_fourteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_fourteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>15</h5></th>
        <th style="text-align: left;"><h5>ซึมเศร้า ไม่ร่าเริง</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_fifteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_fifteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>16</h5></th>
        <th style="text-align: left;"><h5>เข้ากับเพือนไม่ได้ ชอบปลีกตัว</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_sixteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_sixteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>17</h5></th>
        <th style="text-align: left;"><h5>เอาแต่ใจตนเอง จะเอาอะไรต้องให้ได้ทันที</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_seventeen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_seventeen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>18</h5></th>
        <th style="text-align: left;"><h5>มักตำหนิผู้อื่นในเรื่องที่ตนเองเป็นคนผิด</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_eighteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </td>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_eighteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>19</h5></th>
        <th style="text-align: left;"><h5>เก็บกดหรือมีการทำร้ายร่างกายตัวเอง</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_nineteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_nineteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>20</h5></th>
        <th style="text-align: left;"><h5>หวาดระแวง มองผู้อื่นในแง่ร้าย</h5></th>
        <?php
            $sqlBehavior = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryBehavior = $conn->query($sqlBehavior);
            while($rowBehavior = $queryBehavior->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_twenty'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowBehavior['beh_twenty'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr style="text-align: center;">
        <th colspan="2"><h3>รวม</h3></th>
        <th>
        <?php 
            $queryOneY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_one = 'yes'";
            $resultOneY = $conn->query($queryOneY);
            $numOneY = mysqli_num_rows($resultOneY);

            $queryTwoY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_two = 'yes'";
            $resultTwoY = $conn->query($queryTwoY);
            $numTwoY = mysqli_num_rows($resultTwoY);

            $queryThreeY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_three = 'yes'";
            $resultThreeY = $conn->query($queryThreeY);
            $numThreeY = mysqli_num_rows($resultThreeY);

            $queryFourY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_four = 'yes'";
            $resultFourY = $conn->query($queryFourY);
            $numFourY = mysqli_num_rows($resultFourY);

            $queryFiveY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_five = 'yes'";
            $resultFiveY = $conn->query($queryFiveY);
            $numFiveY = mysqli_num_rows($resultFiveY);

            $querySixY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_six = 'yes'";
            $resultSixY = $conn->query($querySixY);
            $numSixY = mysqli_num_rows($resultSixY);

            $querySevenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_seven = 'yes'";
            $resultSevenY = $conn->query($querySevenY);
            $numSevenY = mysqli_num_rows($resultSevenY);

            $queryEightY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_eight = 'yes'";
            $resultEightY = $conn->query($queryEightY);
            $numEightY = mysqli_num_rows($resultEightY);

            $queryNineY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_nine = 'yes'";
            $resultNineY = $conn->query($queryNineY);
            $numNineY = mysqli_num_rows($resultNineY);

            $queryTenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_ten = 'yes'";
            $resultTenY = $conn->query($queryTenY);
            $numTenY = mysqli_num_rows($resultTenY);

            $queryElevenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_eleven = 'yes'";
            $resultElevenY = $conn->query($queryElevenY);
            $numElevenY = mysqli_num_rows($resultElevenY);

            $queryTwelveY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_twelve = 'yes'";
            $resultTwelveY = $conn->query($queryTwelveY);
            $numTwelveY = mysqli_num_rows($resultTwelveY);

            $queryThirteenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_thirteen = 'yes'";
            $resultThirteenY = $conn->query($queryThirteenY);
            $numThirteenY = mysqli_num_rows($resultThirteenY);

            $queryFourteenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_fourteen = 'yes'";
            $resultFourteenY = $conn->query($queryFourteenY);
            $numFourteenY = mysqli_num_rows($resultFourteenY);

            $queryFifteenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_fifteen = 'yes'";
            $resultFifteenY = $conn->query($queryFifteenY);
            $numFifteenY = mysqli_num_rows($resultFifteenY);

            $querySixteenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_sixteen = 'yes'";
            $resultSixteenY = $conn->query($querySixteenY);
            $numSixteenY = mysqli_num_rows($resultSixteenY);

            $querySeventeenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_seventeen = 'yes'";
            $resultSeventeenY = $conn->query($querySeventeenY);
            $numSeventeenY = mysqli_num_rows($resultSeventeenY);

            $queryEighteenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_eighteen = 'yes'";
            $resultEighteenY = $conn->query($queryEighteenY);
            $numEighteenY = mysqli_num_rows($resultEighteenY);

            $queryNineteenY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_nineteen = 'yes'";
            $resultNineteenY = $conn->query($queryNineteenY);
            $numNineteenY = mysqli_num_rows($resultNineteenY);

            $queryTwentyY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_twenty = 'yes'";
            $resultTwentyY = $conn->query($queryTwentyY);
            $numTwentyY = mysqli_num_rows($resultTwentyY);

            $sum_OneY = $numOneY+$numTwoY+$numThreeY+$numFourY+$numFiveY+$numSixY+$numSevenY+$numEightY+$numNineY+$numTenY+$numElevenY
            +$numTwelveY+$numThirteenY+$numFourteenY+$numFifteenY+$numSixteenY+$numSeventeenY+$numEighteenY+$numNineteenY+$numTwentyY;

            echo '<h3>'.number_format($sum_OneY).'</h3>';
        ?>
        </th>

        <th>
        <?php 
            $queryOneN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_one = 'no'";
            $resultOneN = $conn->query($queryOneN);
            $numOneN = mysqli_num_rows($resultOneN);

            $queryTwoN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_two = 'no'";
            $resultTwoN = $conn->query($queryTwoN);
            $numTwoN = mysqli_num_rows($resultTwoN);

            $queryThreeN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_three = 'no'";
            $resultThreeN = $conn->query($queryThreeN);
            $numThreeN = mysqli_num_rows($resultThreeN);

            $queryFourN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_four = 'no'";
            $resultFourN = $conn->query($queryFourN);
            $numFourN = mysqli_num_rows($resultFourN);

            $queryFiveN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_five = 'no'";
            $resultFiveN = $conn->query($queryFiveN);
            $numFiveN = mysqli_num_rows($resultFiveN);

            $querySixN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_six = 'no'";
            $resultSixN = $conn->query($querySixN);
            $numSixN = mysqli_num_rows($resultSixN);

            $querySevenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_seven = 'no'";
            $resultSevenN = $conn->query($querySevenN);
            $numSevenN = mysqli_num_rows($resultSevenN);

            $queryEightN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_eight = 'no'";
            $resultEightN = $conn->query($queryEightN);
            $numEightN = mysqli_num_rows($resultEightN);

            $queryNineN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_nine = 'no'";
            $resultNineN = $conn->query($queryNineN);
            $numNineN = mysqli_num_rows($resultNineN);

            $queryTenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_ten = 'no'";
            $resultTenN = $conn->query($queryTenN);
            $numTenN = mysqli_num_rows($resultTenN);

            $queryElevenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_eleven = 'no'";
            $resultElevenN = $conn->query($queryElevenN);
            $numElevenN = mysqli_num_rows($resultElevenN);

            $queryTwelveN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_twelve = 'no'";
            $resultTwelveN = $conn->query($queryTwelveN);
            $numTwelveN = mysqli_num_rows($resultTwelveN);

            $queryThirteenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_thirteen = 'no'";
            $resultThirteenN = $conn->query($queryThirteenN);
            $numThirteenN = mysqli_num_rows($resultThirteenN);

            $queryFourteenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_fourteen = 'no'";
            $resultFourteenN = $conn->query($queryFourteenN);
            $numFourteenN = mysqli_num_rows($resultFourteenN);

            $queryFifteenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_fifteen = 'no'";
            $resultFifteenN = $conn->query($queryFifteenN);
            $numFifteenN = mysqli_num_rows($resultFifteenN);

            $querySixteenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_sixteen = 'no'";
            $resultSixteenN = $conn->query($querySixteenN);
            $numSixteenN = mysqli_num_rows($resultSixteenN);

            $querySeventeenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_seventeen = 'no'";
            $resultSeventeenN = $conn->query($querySeventeenN);
            $numSeventeenN = mysqli_num_rows($resultSeventeenN);

            $queryEighteenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_eighteen = 'no'";
            $resultEighteenN = $conn->query($queryEighteenN);
            $numEighteenN = mysqli_num_rows($resultEighteenN);

            $queryNineteenN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_nineteen = 'no'";
            $resultNineteenN = $conn->query($queryNineteenN);
            $numNineteenN = mysqli_num_rows($resultNineteenN);

            $queryTwentyN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '1' AND beh_twenty = 'no'";
            $resultTwentyN = $conn->query($queryTwentyN);
            $numTwentyN = mysqli_num_rows($resultTwentyN);

            $sum_OneN = $numOneN+$numTwoN+$numThreeN+$numFourN+$numFiveN+$numSixN+$numSevenN+$numEightN+$numNineN+$numTenN+$numElevenN
            +$numTwelveN+$numThirteenN+$numFourteenN+$numFifteenN+$numSixteenN+$numSeventeenN+$numEighteenN+$numNineteenN+$numTwentyN;

            echo '<h3>'.number_format($sum_OneN).'</h3>';
        ?>
    </th>
                                                                    
    <th>
    <?php 
        $queryOneYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_one = 'yes'";
        $resultOneYY = $conn->query($queryOneYY);
        $numOneYY = mysqli_num_rows($resultOneYY);

        $queryTwoYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_two = 'yes'";
        $resultTwoYY = $conn->query($queryTwoYY);
        $numTwoYY = mysqli_num_rows($resultTwoYY);

        $queryThreeYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_three = 'yes'";
        $resultThreeYY = $conn->query($queryThreeYY);
        $numThreeYY = mysqli_num_rows($resultThreeYY);

        $queryFourYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_four = 'yes'";
        $resultFourYY = $conn->query($queryFourYY);
        $numFourYY = mysqli_num_rows($resultFourYY);

        $queryFiveYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_five = 'yes'";
        $resultFiveYY = $conn->query($queryFiveYY);
        $numFiveYY = mysqli_num_rows($resultFiveYY);

        $querySixYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_six = 'yes'";
        $resultSixYY = $conn->query($querySixYY);
        $numSixYY = mysqli_num_rows($resultSixYY);

        $querySevenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_seven = 'yes'";
        $resultSevenYY = $conn->query($querySevenYY);
        $numSevenYY = mysqli_num_rows($resultSevenYY);

        $queryEightYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_eight = 'yes'";
        $resultEightYY = $conn->query($queryEightYY);
        $numEightYY = mysqli_num_rows($resultEightYY);

        $queryNineYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_nine = 'yes'";
        $resultNineYY = $conn->query($queryNineYY);
        $numNineYY = mysqli_num_rows($resultNineYY);

        $queryTenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_ten = 'yes'";
        $resultTenYY = $conn->query($queryTenYY);
        $numTenYY = mysqli_num_rows($resultTenYY);

        $queryElevenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_eleven = 'yes'";
        $resultElevenYY = $conn->query($queryElevenYY);
        $numElevenYY = mysqli_num_rows($resultElevenYY);

        $queryTwelveYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_twelve = 'yes'";
        $resultTwelveYY = $conn->query($queryTwelveYY);
        $numTwelveYY = mysqli_num_rows($resultTwelveYY);

        $queryThirteenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_thirteen = 'yes'";
        $resultThirteenYY = $conn->query($queryThirteenYY);
        $numThirteenYY = mysqli_num_rows($resultThirteenYY);

        $queryFourteenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_fourteen = 'yes'";
        $resultFourteenYY = $conn->query($queryFourteenYY);
        $numFourteenYY = mysqli_num_rows($resultFourteenYY);

        $queryFifteenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_fifteen = 'yes'";
        $resultFifteenYY = $conn->query($queryFifteenYY);
        $numFifteenYY = mysqli_num_rows($resultFifteenYY);

        $querySixteenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_sixteen = 'yes'";
        $resultSixteenYY = $conn->query($querySixteenYY);
        $numSixteenYY = mysqli_num_rows($resultSixteenYY);

        $querySeventeenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_seventeen = 'yes'";
        $resultSeventeenYY = $conn->query($querySeventeenYY);
        $numSeventeenYY = mysqli_num_rows($resultSeventeenYY);

        $queryEighteenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_eighteen = 'yes'";
        $resultEighteenYY = $conn->query($queryEighteenYY);
        $numEighteenYY = mysqli_num_rows($resultEighteenYY);

        $queryNineteenYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_nineteen = 'yes'";
        $resultNineteenYY = $conn->query($queryNineteenYY);
        $numNineteenYY = mysqli_num_rows($resultNineteenYY);

         $queryTwentyYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_twenty = 'yes'";
        $resultTwentyYY = $conn->query($queryTwentyYY);
        $numTwentyYY = mysqli_num_rows($resultTwentyYY);

        $sum_TwoYY = $numOneYY+$numTwoYY+$numThreeYY+$numFourYY+$numFiveYY+$numSixYY+$numSevenYY+$numEightYY+$numNineYY+$numTenYY+$numElevenYY
        +$numTwelveYY+$numThirteenYY+$numFourteenYY+$numFifteenYY+$numSixteenYY+$numSeventeenYY+$numEighteenYY+$numNineteenYY+$numTwentyYY;

        echo '<h3>'.number_format($sum_TwoYY).'</h3>';
    ?>
    </th>
                                                                    
    <th>
    <?php 
        $queryOneNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_one = 'no'";
        $resultOneNN = $conn->query($queryOneNN);
        $numOneNN = mysqli_num_rows($resultOneNN);

        $queryTwoNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_two = 'no'";
        $resultTwoNN = $conn->query($queryTwoNN);
        $numTwoNN = mysqli_num_rows($resultTwoNN);

        $queryThreeNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_three = 'no'";
        $resultThreeNN = $conn->query($queryThreeNN);
        $numThreeNN = mysqli_num_rows($resultThreeNN);

        $queryFourNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_four = 'no'";
        $resultFourNN = $conn->query($queryFourNN);
        $numFourNN = mysqli_num_rows($resultFourNN);

        $queryFiveNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_five = 'no'";
        $resultFiveNN = $conn->query($queryFiveNN);
        $numFiveNN = mysqli_num_rows($resultFiveNN);

        $querySixNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_six = 'no'";
        $resultSixNN = $conn->query($querySixNN);
        $numSixNN = mysqli_num_rows($resultSixNN);

        $querySevenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_seven = 'no'";
        $resultSevenNN = $conn->query($querySevenNN);
        $numSevenNN = mysqli_num_rows($resultSevenNN);

        $queryEightNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_eight = 'no'";
        $resultEightNN = $conn->query($queryEightNN);
        $numEightNN = mysqli_num_rows($resultEightNN);

        $queryNineNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_nine = 'no'";
        $resultNineNN = $conn->query($queryNineNN);
        $numNineNN = mysqli_num_rows($resultNineNN);

        $queryTenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_ten = 'no'";
        $resultTenNN = $conn->query($queryTenNN);
        $numTenNN = mysqli_num_rows($resultTenNN);

        $queryElevenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_eleven = 'no'";
        $resultElevenNN = $conn->query($queryElevenNN);
        $numElevenNN = mysqli_num_rows($resultElevenNN);

        $queryTwelveNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_twelve = 'no'";
        $resultTwelveNN = $conn->query($queryTwelveNN);
        $numTwelveNN = mysqli_num_rows($resultTwelveNN);

        $queryThirteenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_thirteen = 'no'";
        $resultThirteenNN = $conn->query($queryThirteenNN);
        $numThirteenNN = mysqli_num_rows($resultThirteenNN);

        $queryFourteenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_fourteen = 'no'";
        $resultFourteenNN = $conn->query($queryFourteenNN);
        $numFourteenNN = mysqli_num_rows($resultFourteenNN);

        $queryFifteenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_fifteen = 'no'";
        $resultFifteenNN = $conn->query($queryFifteenNN);
        $numFifteenNN = mysqli_num_rows($resultFifteenNN);

        $querySixteenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_sixteen = 'no'";
        $resultSixteenNN = $conn->query($querySixteenNN);
        $numSixteenNN = mysqli_num_rows($resultSixteenNN);

        $querySeventeenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_seventeen = 'no'";
        $resultSeventeenNN = $conn->query($querySeventeenNN);
        $numSeventeenNN = mysqli_num_rows($resultSeventeenNN);

        $queryEighteenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_eighteen = 'no'";
        $resultEighteenNN = $conn->query($queryEighteenNN);
        $numEighteenNN = mysqli_num_rows($resultEighteenNN);

        $queryNineteenNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_nineteen = 'no'";
        $resultNineteenNN = $conn->query($queryNineteenNN);
        $numNineteenNN = mysqli_num_rows($resultNineteenNN);

        $queryTwentyNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '2' AND beh_twenty = 'no'";
        $resultTwentyNN = $conn->query($queryTwentyNN);
        $numTwentyNN = mysqli_num_rows($resultTwentyNN);

        $sum_TwoNN = $numOneNN+$numTwoNN+$numThreeNN+$numFourNN+$numFiveNN+$numSixNN+$numSevenNN+$numEightNN+$numNineNN+$numTenNN+$numElevenNN
        +$numTwelveNN+$numThirteenNN+$numFourteenNN+$numFifteenNN+$numSixteenNN+$numSeventeenNN+$numEighteenNN+$numNineteenNN+$numTwentyNN;

        echo '<h3>'.number_format($sum_TwoNN).'</h3>';
    ?>
    </th>

    <th>
    <?php 
        $queryOneYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_one = 'yes'";
        $resultOneYYY = $conn->query($queryOneYYY);
        $numOneYYY = mysqli_num_rows($resultOneYYY);

        $queryTwoYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_two = 'yes'";
        $resultTwoYYY = $conn->query($queryTwoYYY);
        $numTwoYYY = mysqli_num_rows($resultTwoYYY);

        $queryThreeYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_three = 'yes'";
        $resultThreeYYY = $conn->query($queryThreeYYY);
        $numThreeYYY = mysqli_num_rows($resultThreeYYY);

        $queryFourYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_four = 'yes'";
        $resultFourYYY = $conn->query($queryFourYYY);
        $numFourYYY = mysqli_num_rows($resultFourYYY);

        $queryFiveYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_five = 'yes'";
        $resultFiveYYY = $conn->query($queryFiveYYY);
        $numFiveYYY = mysqli_num_rows($resultFiveYYY);

        $querySixYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_six = 'yes'";
        $resultSixYYY = $conn->query($querySixYYY);
        $numSixYYY = mysqli_num_rows($resultSixYYY);

        $querySevenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_seven = 'yes'";
        $resultSevenYYY = $conn->query($querySevenYYY);
        $numSevenYYY = mysqli_num_rows($resultSevenYYY);

        $queryEightYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_eight = 'yes'";
        $resultEightYYY = $conn->query($queryEightYYY);
        $numEightYYY = mysqli_num_rows($resultEightYYY);

        $queryNineYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_nine = 'yes'";
        $resultNineYYY = $conn->query($queryNineYYY);
        $numNineYYY = mysqli_num_rows($resultNineYYY);

        $queryTenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_ten = 'yes'";
        $resultTenYYY = $conn->query($queryTenYYY);
        $numTenYYY = mysqli_num_rows($resultTenYYY);

        $queryElevenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_eleven = 'yes'";
        $resultElevenYYY = $conn->query($queryElevenYYY);
        $numElevenYYY = mysqli_num_rows($resultElevenYYY);

        $queryTwelveYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_twelve = 'yes'";
        $resultTwelveYYY = $conn->query($queryTwelveYYY);
        $numTwelveYYY = mysqli_num_rows($resultTwelveYYY);

        $queryThirteenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_thirteen = 'yes'";
        $resultThirteenYYY = $conn->query($queryThirteenYYY);
        $numThirteenYYY = mysqli_num_rows($resultThirteenYYY);

        $queryFourteenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_fourteen = 'yes'";
        $resultFourteenYYY = $conn->query($queryFourteenYYY);
        $numFourteenYYY = mysqli_num_rows($resultFourteenYYY);

        $queryFifteenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_fifteen = 'yes'";
        $resultFifteenYYY = $conn->query($queryFifteenYYY);
        $numFifteenYYY = mysqli_num_rows($resultFifteenYYY);

        $querySixteenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_sixteen = 'yes'";
        $resultSixteenYYY = $conn->query($querySixteenYYY);
        $numSixteenYYY = mysqli_num_rows($resultSixteenYYY);

        $querySeventeenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_seventeen = 'yes'";
        $resultSeventeenYYY = $conn->query($querySeventeenYYY);
        $numSeventeenYYY = mysqli_num_rows($resultSeventeenYYY);

        $queryEighteenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_eighteen = 'yes'";
        $resultEighteenYYY = $conn->query($queryEighteenYYY);
        $numEighteenYYY = mysqli_num_rows($resultEighteenYYY);

        $queryNineteenYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_nineteen = 'yes'";
        $resultNineteenYYY = $conn->query($queryNineteenYYY);
        $numNineteenYYY = mysqli_num_rows($resultNineteenYYY);

        $queryTwentyYYY = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_twenty = 'yes'";
        $resultTwentyYYY = $conn->query($queryTwentyYYY);
        $numTwentyYYY = mysqli_num_rows($resultTwentyYYY);

        $sum_ThreeYYY = $numOneYYY+$numTwoYYY+$numThreeYYY+$numFourYYY+$numFiveYYY+$numSixYYY+$numSevenYYY
        +$numEightYYY+$numNineYYY+$numTenYYY+$numElevenYYY+$numTwelveYYY+$numThirteenYYY+$numFourteenYYY
        +$numFifteenYYY+$numSixteenYYY+$numSeventeenYYY+$numEighteenYYY+$numNineteenYYY+$numTwentyYYY;

        echo '<h3>'.number_format($sum_ThreeYYY).'</h3>';
    ?>
    </th>
                                                                    
    <th>
    <?php 
        $queryOneNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_one = 'no'";
        $resultOneNNN = $conn->query($queryOneNNN);
        $numOneNNN = mysqli_num_rows($resultOneNNN);

        $queryTwoNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_two = 'no'";
        $resultTwoNNN = $conn->query($queryTwoNNN);
        $numTwoNNN = mysqli_num_rows($resultTwoNNN);

        $queryThreeNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_three = 'no'";
        $resultThreeNNN = $conn->query($queryThreeNNN);
        $numThreeNNN = mysqli_num_rows($resultThreeNNN);

        $queryFourNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_four = 'no'";
        $resultFourNNN = $conn->query($queryFourNNN);
        $numFourNNN = mysqli_num_rows($resultFourNNN);

        $queryFiveNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_five = 'no'";
        $resultFiveNNN = $conn->query($queryFiveNNN);
        $numFiveNNN = mysqli_num_rows($resultFiveNNN);

        $querySixNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_six = 'no'";
        $resultSixNNN = $conn->query($querySixNNN);
        $numSixNNN = mysqli_num_rows($resultSixNNN);

        $querySevenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_seven = 'no'";
        $resultSevenNNN = $conn->query($querySevenNNN);
        $numSevenNNN = mysqli_num_rows($resultSevenNNN);

        $queryEightNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_eight = 'no'";
        $resultEightNNN = $conn->query($queryEightNNN);
        $numEightNNN = mysqli_num_rows($resultEightNNN);

        $queryNineNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_nine = 'no'";
        $resultNineNNN = $conn->query($queryNineNNN);
        $numNineNNN = mysqli_num_rows($resultNineNNN);

        $queryTenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_ten = 'no'";
        $resultTenNNN = $conn->query($queryTenNNN);
        $numTenNNN = mysqli_num_rows($resultTenNNN);

        $queryElevenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_eleven = 'no'";
        $resultElevenNNN = $conn->query($queryElevenNNN);
        $numElevenNNN = mysqli_num_rows($resultElevenNNN);

        $queryTwelveNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_twelve = 'no'";
        $resultTwelveNNN = $conn->query($queryTwelveNNN);
        $numTwelveNNN = mysqli_num_rows($resultTwelveNNN);

        $queryThirteenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_thirteen = 'no'";
        $resultThirteenNNN = $conn->query($queryThirteenNNN);
        $numThirteenNNN = mysqli_num_rows($resultThirteenNNN);

        $queryFourteenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_fourteen = 'no'";
        $resultFourteenNNN = $conn->query($queryFourteenNNN);
        $numFourteenNNN = mysqli_num_rows($resultFourteenNNN);

        $queryFifteenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_fifteen = 'no'";
        $resultFifteenNNN = $conn->query($queryFifteenNNN);
        $numFifteenNNN = mysqli_num_rows($resultFifteenNNN);

        $querySixteenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_sixteen = 'no'";
        $resultSixteenNNN = $conn->query($querySixteenNNN);
        $numSixteenNNN = mysqli_num_rows($resultSixteenNNN);

        $querySeventeenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_seventeen = 'no'";
        $resultSeventeenNNN = $conn->query($querySeventeenNNN);
        $numSeventeenNNN = mysqli_num_rows($resultSeventeenNNN);

        $queryEighteenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_eighteen = 'no'";
        $resultEighteenNNN = $conn->query($queryEighteenNNN);
        $numEighteenNNN = mysqli_num_rows($resultEighteenNNN);

        $queryNineteenNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_nineteen = 'no'";
        $resultNineteenNNN = $conn->query($queryNineteenNNN);
        $numNineteenNNN = mysqli_num_rows($resultNineteenNNN);

        $queryTwentyNNN = "SELECT * FROM tbl_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND beh_year_no = '3' AND beh_twenty = 'no'";
        $resultTwentyNNN = $conn->query($queryTwentyNNN);
        $numTwentyNNN = mysqli_num_rows($resultTwentyNNN);

        $sum_ThreeNNN = $numOneNNN+$numTwoNNN+$numThreeNNN+$numFourNNN+$numFiveNNN+$numSixNNN+$numSevenNNN+$numEightNNN+$numNineNNN
        +$numTenNNN+$numElevenNNN+$numTwelveNNN+$numThirteenNNN+$numFourteenNNN+$numFifteenNNN+$numSixteenNNN+$numSeventeenNNN
        +$numEighteenNNN+$numNineteenNNN+$numTwentyNNN;

        echo '<h3>'.number_format($sum_ThreeNNN).'</h3>';
        ?>
        </th>
    </tr>
</table>

<table>
    <tr>
        <td>
            <img src="images/3.jpg" style="width: 60%;">
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- แบบคัดกรองนักเรียนด้านการเรียนรู้ (10) --------------------------->

<table>
    <tr>
        <td style="text-align: center;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 80px; height: 80px;">
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 10px;">
            <h1>แบบคัดกรองนักเรียนด้านการเรียนรู้</h1>
        </td>
    </tr>
    <tr>
        <td style="text-align: left;">
            <h3>
                <u>คำชี้แจง</u> ให้ทำเครื่องหมาย
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                    <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                </svg>
                ในช่องที่ตรงกับลักษณะของนักเรียน
            </h3>
        </td>
    </tr>
</table>  

<table>
    <tr style="text-align: center;">
        <th rowspan="2"><h3>ที่</h3></th>
        <th rowspan="2"><h3>รายการ</h3></th>
        <th colspan="2"><h3>ปีที่ 1</h3></th>
        <th colspan="2"><h3>ปีที่ 2</h3></th>
        <th colspan="2"><h3>ปีที่ 3</h3></th>
    </tr>
    <tr style="text-align: center;">
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>1</h5></th>
        <th style="text-align: left;"><h5>ด้านการฟัง (ไม่ค่อยได้ยินเวลาผู้อื่นพูด)</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_one'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_one'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>2</h5></th>
        <th style="text-align: left;"><h5>ด้านการพูด (พูดติดอ่าง พูดไม่ชัด)</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_two'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_two'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>3</h5></th>
        <th style="text-align: left;"><h5>ด้านการอ่าน (อ่านไม่ออก อ่านไม่คล่อง)</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_three'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_three'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>4</h5></th>
        <th style="text-align: left;"><h5>ด้านการเขียน (เขียนไม่ถูก)</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_four'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_four'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>                                             
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>5</h5></th>
        <th style="text-align: left;"><h5>ด้านการคิดคำนวณ (บวก ลบ คูณ หาร ตามช่วงวัย)</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_five'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_five'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>                                                    
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>6</h5></th>
        <th style="text-align: left;"><h5>ด้านความเข้าใจภาษา (การสื่อสารกับผู้อื่น)</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_six'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';  

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_six'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>7</h5></th>
        <th style="text-align: left;"><h5>ด้านศิลปะ (วาดภาพ ระบายสี)</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_seven'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_seven'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>8</h5></th>
        <th style="text-align: left;"><h5>ด้านดนตรี นาฏศิลป์</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_eight'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_eight'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>9</h5></th>
        <th style="text-align: left;"><h5>ด้านการเคลื่อนไหวรางกาย (กีฬา)</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_nine'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_nine'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>10</h5></th>
        <th style="text-align: left;"><h5>ด้านเชาว์ปัญญาและไหวพริบปฏิภาณ</h5></th>
        <?php
            $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryLearn = $conn->query($sqlLearn);
            while($rowLearn = $queryLearn->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_ten'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowLearn['learn_ten'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr style="text-align: center;">
        <th colspan="2"><h3>รวม</h3></th>
        <th>
        <?php 
            $queryOneY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_one = 'yes'";
            $resultOneY = $conn->query($queryOneY);
            $numOneY = mysqli_num_rows($resultOneY);

            $queryTwoY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_two = 'yes'";
            $resultTwoY = $conn->query($queryTwoY);
            $numTwoY = mysqli_num_rows($resultTwoY);

            $queryThreeY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_three = 'yes'";
            $resultThreeY = $conn->query($queryThreeY);
            $numThreeY = mysqli_num_rows($resultThreeY);

            $queryFourY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_four = 'yes'";
            $resultFourY = $conn->query($queryFourY);
            $numFourY = mysqli_num_rows($resultFourY);

            $queryFiveY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_five = 'yes'";
            $resultFiveY = $conn->query($queryFiveY);
            $numFiveY = mysqli_num_rows($resultFiveY);

            $querySixY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_six = 'yes'";
            $resultSixY = $conn->query($querySixY);
            $numSixY = mysqli_num_rows($resultSixY);

            $querySevenY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_seven = 'yes'";
            $resultSevenY = $conn->query($querySevenY);
            $numSevenY = mysqli_num_rows($resultSevenY);

            $queryEightY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_eight = 'yes'";
            $resultEightY = $conn->query($queryEightY);
            $numEightY = mysqli_num_rows($resultEightY);

            $queryNineY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_nine = 'yes'";
            $resultNineY = $conn->query($queryNineY);
            $numNineY = mysqli_num_rows($resultNineY);

            $queryTenY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_ten = 'yes'";
            $resultTenY = $conn->query($queryTenY);
            $numTenY = mysqli_num_rows($resultTenY);

            $sum_OneY = $numOneY+$numTwoY+$numThreeY+$numFourY+$numFiveY+$numSixY+$numSevenY+$numEightY+$numNineY+$numTenY;

            echo '<h3>'.number_format($sum_OneY).'</h3>';
        ?>
        </th>

        <th>
        <?php 
            $queryOneN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_one = 'no'";
            $resultOneN = $conn->query($queryOneN);
            $numOneN = mysqli_num_rows($resultOneN);

            $queryTwoN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_two = 'no'";
            $resultTwoN = $conn->query($queryTwoN);
            $numTwoN = mysqli_num_rows($resultTwoN);

            $queryThreeN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_three = 'no'";
            $resultThreeN = $conn->query($queryThreeN);
            $numThreeN = mysqli_num_rows($resultThreeN);

            $queryFourN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_four = 'no'";
            $resultFourN = $conn->query($queryFourN);
            $numFourN = mysqli_num_rows($resultFourN);

            $queryFiveN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_five = 'no'";
            $resultFiveN = $conn->query($queryFiveN);
            $numFiveN = mysqli_num_rows($resultFiveN);

            $querySixN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_six = 'no'";
            $resultSixN = $conn->query($querySixN);
            $numSixN = mysqli_num_rows($resultSixN);

            $querySevenN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_seven = 'no'";
            $resultSevenN = $conn->query($querySevenN);
            $numSevenN = mysqli_num_rows($resultSevenN);

            $queryEightN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_eight = 'no'";
            $resultEightN = $conn->query($queryEightN);
            $numEightN = mysqli_num_rows($resultEightN);

            $queryNineN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_nine = 'no'";
            $resultNineN = $conn->query($queryNineN);
            $numNineN = mysqli_num_rows($resultNineN);

            $queryTenN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '1' AND learn_ten = 'no'";
            $resultTenN = $conn->query($queryTenN);
            $numTenN = mysqli_num_rows($resultTenN);


            $sum_OneN = $numOneN+$numTwoN+$numThreeN+$numFourN+$numFiveN+$numSixN+$numSevenN+$numEightN+$numNineN+$numTenN;

            echo '<h3>'.number_format($sum_OneN).'</h3>';
        ?>
    </th>
                                                                    
    <th>
    <?php 
        $queryOneYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_one = 'yes'";
        $resultOneYY = $conn->query($queryOneYY);
        $numOneYY = mysqli_num_rows($resultOneYY);

        $queryTwoYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_two = 'yes'";
        $resultTwoYY = $conn->query($queryTwoYY);
        $numTwoYY = mysqli_num_rows($resultTwoYY);

        $queryThreeYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_three = 'yes'";
        $resultThreeYY = $conn->query($queryThreeYY);
        $numThreeYY = mysqli_num_rows($resultThreeYY);

        $queryFourYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_four = 'yes'";
        $resultFourYY = $conn->query($queryFourYY);
        $numFourYY = mysqli_num_rows($resultFourYY);

        $queryFiveYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_five = 'yes'";
        $resultFiveYY = $conn->query($queryFiveYY);
        $numFiveYY = mysqli_num_rows($resultFiveYY);

        $querySixYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_six = 'yes'";
        $resultSixYY = $conn->query($querySixYY);
        $numSixYY = mysqli_num_rows($resultSixYY);

        $querySevenYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_seven = 'yes'";
        $resultSevenYY = $conn->query($querySevenYY);
        $numSevenYY = mysqli_num_rows($resultSevenYY);

        $queryEightYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_eight = 'yes'";
        $resultEightYY = $conn->query($queryEightYY);
        $numEightYY = mysqli_num_rows($resultEightYY);

        $queryNineYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_nine = 'yes'";
        $resultNineYY = $conn->query($queryNineYY);
        $numNineYY = mysqli_num_rows($resultNineYY);

        $queryTenYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_ten = 'yes'";
        $resultTenYY = $conn->query($queryTenYY);
        $numTenYY = mysqli_num_rows($resultTenYY);

        $sum_TwoYY = $numOneYY+$numTwoYY+$numThreeYY+$numFourYY+$numFiveYY+$numSixYY+$numSevenYY+$numEightYY+$numNineYY+$numTenYY;

        echo '<h3>'.number_format($sum_TwoYY).'</h3>';
    ?>
    </th>
                                                                    
    <th>
    <?php 
        $queryOneNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_one = 'no'";
        $resultOneNN = $conn->query($queryOneNN);
        $numOneNN = mysqli_num_rows($resultOneNN);

        $queryTwoNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_two = 'no'";
        $resultTwoNN = $conn->query($queryTwoNN);
        $numTwoNN = mysqli_num_rows($resultTwoNN);

        $queryThreeNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_three = 'no'";
        $resultThreeNN = $conn->query($queryThreeNN);
        $numThreeNN = mysqli_num_rows($resultThreeNN);

        $queryFourNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_four = 'no'";
        $resultFourNN = $conn->query($queryFourNN);
        $numFourNN = mysqli_num_rows($resultFourNN);

        $queryFiveNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_five = 'no'";
        $resultFiveNN = $conn->query($queryFiveNN);
        $numFiveNN = mysqli_num_rows($resultFiveNN);

        $querySixNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_six = 'no'";
        $resultSixNN = $conn->query($querySixNN);
        $numSixNN = mysqli_num_rows($resultSixNN);

        $querySevenNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_seven = 'no'";
        $resultSevenNN = $conn->query($querySevenNN);
        $numSevenNN = mysqli_num_rows($resultSevenNN);

        $queryEightNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_eight = 'no'";
        $resultEightNN = $conn->query($queryEightNN);
        $numEightNN = mysqli_num_rows($resultEightNN);

        $queryNineNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_nine = 'no'";
        $resultNineNN = $conn->query($queryNineNN);
        $numNineNN = mysqli_num_rows($resultNineNN);

        $queryTenNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '2' AND learn_ten = 'no'";
        $resultTenNN = $conn->query($queryTenNN);
        $numTenNN = mysqli_num_rows($resultTenNN);

        $sum_TwoNN = $numOneNN+$numTwoNN+$numThreeNN+$numFourNN+$numFiveNN+$numSixNN+$numSevenNN+$numEightNN+$numNineNN+$numTenNN;

        echo '<h3>'.number_format($sum_TwoNN).'</h3>';
    ?>
    </th>

    <th>
    <?php 
        $queryOneYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_one = 'yes'";
        $resultOneYYY = $conn->query($queryOneYYY);
        $numOneYYY = mysqli_num_rows($resultOneYYY);

        $queryTwoYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_two = 'yes'";
        $resultTwoYYY = $conn->query($queryTwoYYY);
        $numTwoYYY = mysqli_num_rows($resultTwoYYY);

        $queryThreeYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_three = 'yes'";
        $resultThreeYYY = $conn->query($queryThreeYYY);
        $numThreeYYY = mysqli_num_rows($resultThreeYYY);

        $queryFourYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_four = 'yes'";
        $resultFourYYY = $conn->query($queryFourYYY);
        $numFourYYY = mysqli_num_rows($resultFourYYY);

        $queryFiveYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_five = 'yes'";
        $resultFiveYYY = $conn->query($queryFiveYYY);
        $numFiveYYY = mysqli_num_rows($resultFiveYYY);

        $querySixYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_six = 'yes'";
        $resultSixYYY = $conn->query($querySixYYY);
        $numSixYYY = mysqli_num_rows($resultSixYYY);

        $querySevenYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_seven = 'yes'";
        $resultSevenYYY = $conn->query($querySevenYYY);
        $numSevenYYY = mysqli_num_rows($resultSevenYYY);

        $queryEightYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_eight = 'yes'";
        $resultEightYYY = $conn->query($queryEightYYY);
        $numEightYYY = mysqli_num_rows($resultEightYYY);

        $queryNineYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_nine = 'yes'";
        $resultNineYYY = $conn->query($queryNineYYY);
        $numNineYYY = mysqli_num_rows($resultNineYYY);

        $queryTenYYY = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_ten = 'yes'";
        $resultTenYYY = $conn->query($queryTenYYY);
        $numTenYYY = mysqli_num_rows($resultTenYYY);

        $sum_ThreeYYY = $numOneYYY+$numTwoYYY+$numThreeYYY+$numFourYYY+$numFiveYYY+$numSixYYY+$numSevenYYY+$numEightYYY+$numNineYYY+$numTenYYY;

        echo '<h3>'.number_format($sum_ThreeYYY).'</h3>';
    ?>
    </th>
                                                                    
    <th>
    <?php 
        $queryOneNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_one = 'no'";
        $resultOneNNN = $conn->query($queryOneNNN);
        $numOneNNN = mysqli_num_rows($resultOneNNN);

        $queryTwoNNN = "SELECT * FROM tbl_learn  WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_two = 'no'";
        $resultTwoNNN = $conn->query($queryTwoNNN);
        $numTwoNNN = mysqli_num_rows($resultTwoNNN);

        $queryThreeNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_three = 'no'";
        $resultThreeNNN = $conn->query($queryThreeNNN);
        $numThreeNNN = mysqli_num_rows($resultThreeNNN);

        $queryFourNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_four = 'no'";
        $resultFourNNN = $conn->query($queryFourNNN);
        $numFourNNN = mysqli_num_rows($resultFourNNN);

        $queryFiveNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_five = 'no'";
        $resultFiveNNN = $conn->query($queryFiveNNN);
        $numFiveNNN = mysqli_num_rows($resultFiveNNN);

        $querySixNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_six = 'no'";
        $resultSixNNN = $conn->query($querySixNNN);
        $numSixNNN = mysqli_num_rows($resultSixNNN);

        $querySevenNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_seven = 'no'";
        $resultSevenNNN = $conn->query($querySevenNNN);
        $numSevenNNN = mysqli_num_rows($resultSevenNNN);

        $queryEightNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_eight = 'no'";
        $resultEightNNN = $conn->query($queryEightNNN);
        $numEightNNN = mysqli_num_rows($resultEightNNN);

        $queryNineNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_nine = 'no'";
        $resultNineNNN = $conn->query($queryNineNNN);
        $numNineNNN = mysqli_num_rows($resultNineNNN);

        $queryTenNNN = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND learn_year_no = '3' AND learn_ten = 'no'";
        $resultTenNNN = $conn->query($queryTenNNN);
        $numTenNNN = mysqli_num_rows($resultTenNNN);

        $sum_ThreeNNN = $numOneNNN+$numTwoNNN+$numThreeNNN+$numFourNNN+$numFiveNNN+$numSixNNN+$numSevenNNN+$numEightNNN+$numNineNNN+$numTenNNN;

        echo '<h3>'.number_format($sum_ThreeNNN).'</h3>';
    ?>
        </th>
    </tr>
</table>

<div style="padding-top: 10px;"></div>

<table>
    <tr>
        <td>
            <h3>
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-forward" viewBox="0 0 16 16">
                  <path d="M9.502 5.513a.144.144 0 0 0-.202.134V6.65a.5.5 0 0 1-.5.5H2.5v2.9h6.3a.5.5 0 0 1 .5.5v1.003c0 .108.11.176.202.134l3.984-2.933a.51.51 0 0 1 .042-.028.147.147 0 0 0 0-.252.51.51 0 0 1-.042-.028L9.502 5.513zM8.3 5.647a1.144 1.144 0 0 1 1.767-.96l3.994 2.94a1.147 1.147 0 0 1 0 1.946l-3.994 2.94a1.144 1.144 0 0 1-1.767-.96v-.503H2a.5.5 0 0 1-.5-.5v-3.9a.5.5 0 0 1 .5-.5h6.3v-.503z"/>
                </svg>
                ทักษะหรือรายวิชาที่มีปัญหา และควรได้รับการแก้ไข
            </h3>
        </td>
    </tr>

    <?php
        $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
        $queryLearn = $conn->query($sqlLearn);
        $i_Learn = 0;
        while($rowLearn = $queryLearn->fetch_assoc()){
        $i_Learn = $i_Learn + 1;
    ?>

    <tr>
        <td>
            <h5>
                ปีที่ <?php echo $rowLearn["learn_year_no"]; ?>&nbsp;

                <span>
                 
                    <?php  
                        if($rowLearn["learn_edit_year"] != ""){

                            echo $rowLearn["learn_edit_year"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>

            </h5>
        </td>
    </tr>

    <?php } ?>

</table>

<div style="padding-top: 10px;"></div>

<table>
    <tr>
        <td>
            <h3>
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-forward" viewBox="0 0 16 16">
                  <path d="M9.502 5.513a.144.144 0 0 0-.202.134V6.65a.5.5 0 0 1-.5.5H2.5v2.9h6.3a.5.5 0 0 1 .5.5v1.003c0 .108.11.176.202.134l3.984-2.933a.51.51 0 0 1 .042-.028.147.147 0 0 0 0-.252.51.51 0 0 1-.042-.028L9.502 5.513zM8.3 5.647a1.144 1.144 0 0 1 1.767-.96l3.994 2.94a1.147 1.147 0 0 1 0 1.946l-3.994 2.94a1.144 1.144 0 0 1-1.767-.96v-.503H2a.5.5 0 0 1-.5-.5v-3.9a.5.5 0 0 1 .5-.5h6.3v-.503z"/>
                </svg>
                ความสามารถพิเศษหรือรายวิชาที่ควรส่งเสริมเพื่อความเป็นเลิศ
            </h3>
        </td>
    </tr>

    <?php
        $sqlLearn = "SELECT * FROM tbl_learn WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
        $queryLearn = $conn->query($sqlLearn);
        $i_Learn = 0;
        while($rowLearn = $queryLearn->fetch_assoc()){
        $i_Learn = $i_Learn + 1;
    ?>

    <tr>
        <td>
            <h5>
                ปีที่ <?php echo $rowLearn["learn_year_no"]; ?>&nbsp;

                <span>
                 
                    <?php  
                        if($rowLearn["learn_talent_year"] != ""){

                            echo $rowLearn["learn_talent_year"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>

            </h5>
        </td>
    </tr>

    <?php } ?>

</table>

<div style="padding-top: 10px;"></div>

<table>
    <tr>
        <td>
            <img src="images/4.jpg" style="width: 80%;">
        </td>
    </tr>
</table>    

<pagebreak/>

<!-- -------------------------- แบบคัดกรองนักเรียนด้านสุขภาพ (11) --------------------------->

<table>
    <tr>
        <td style="text-align: center;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 80px; height: 80px;">
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 10px;">
            <h1>แบบคัดกรองนักเรียนด้านสุขภาพ</h1>
        </td>
    </tr>
    <tr>
        <td style="text-align: left;">
            <h3>
                <u>คำชี้แจง</u> ให้ทำเครื่องหมาย
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                    <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                </svg>
                ในช่องที่ตรงกับลักษณะของนักเรียน
            </h3>
        </td>
    </tr>
</table> 

<table>
    <tr style="text-align: center;">
        <th rowspan="2"><h3>ที่</h3></th>
        <th rowspan="2"><h3>รายการพฤติกรรม</h3></th>
        <th colspan="2"><h3>ปีที่ 1</h3></th>
        <th colspan="2"><h3>ปีที่ 2</h3></th>
        <th colspan="2"><h3>ปีที่ 3</h3></th>
    </tr>
    <tr style="text-align: center;">
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>1</h5></th>
        <th style="text-align: left;"><h5>เป็นเหา</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_one'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_one'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>2</h5></th>
        <th style="text-align: left;"><h5>ปวดหัวบ่อย</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_two'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_two'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>3</h5></th>
        <th style="text-align: left;"><h5>เป็นหวัด คัดจมูกบ่อย</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_three'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_three'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>4</h5></th>
        <th style="text-align: left;"><h5>ปวดท้องบ่อย</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_four'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_four'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>                                             
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>5</h5></th>
        <th style="text-align: left;"><h5>กล้ามเนื้ออ่อนแรง</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_five'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_five'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>                                                    
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>6</h5></th>
        <th style="text-align: left;"><h5>ผอมแห้ง</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_six'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';  

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_six'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>7</h5></th>
        <th style="text-align: left;"><h5>อ้วนมาก</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_seven'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_seven'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>8</h5></th>
        <th style="text-align: left;"><h5>มีภาวะน้ำเหลืองเสีย</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_eight'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_eight'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>9</h5></th>
        <th style="text-align: left;"><h5>ตัวซีดเหลือง</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_nine'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_nine'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->

    <tr>
        <th style="text-align: center;"><h5>10</h5></th>
        <th style="text-align: left;"><h5>สายตาสั้น</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_ten'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_ten'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>11</h5></th>
        <th style="text-align: left;"><h5>สายตาเอียง</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_eleven'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_eleven'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>12</h5></th>
        <th style="text-align: left;"><h5>ช่องปากไม่สะอาด</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_twelve'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_twelve'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>13</h5></th>
        <th style="text-align: left;"><h5>ฟันผุ</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_thirteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_thirteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>14</h5></th>
        <th style="text-align: left;"><h5>เลือดกำเดาไหลบ่อย</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_fourteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_fourteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>15</h5></th>
        <th style="text-align: left;"><h5>เลือดหยุดไหลยากเมื่อมีบาดแผล</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_fifteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_fifteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>16</h5></th>
        <th style="text-align: left;"><h5>เป็นโรคผิวหนัง (หิด กลาก เกลื้อน)</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_sixteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_sixteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>17</h5></th>
        <th style="text-align: left;"><h5>มีขี้ไคล</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_seventeen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_seventeen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>18</h5></th>
        <th style="text-align: left;"><h5>หูน้ำหนวก</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_eighteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </td>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_eighteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>19</h5></th>
        <th style="text-align: left;"><h5>เล็บมือ เล็บเท้า สกปรกเป็นประจำ</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_nineteen'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_nineteen'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>20</h5></th>
        <th style="text-align: left;"><h5>เป็นแผลเรื้อรัง</h5></th>
        <?php
            $sqlHealth = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryHealth = $conn->query($sqlHealth);
            while($rowHealth = $queryHealth->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_twenty'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowHealth['health_twenty'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr style="text-align: center;">
        <th colspan="2"><h3>รวม</h3></th>
        <th>
        <?php 

            $queryOneY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_one = 'yes'";
            $resultOneY = $conn->query($queryOneY);
            $numOneY = mysqli_num_rows($resultOneY);

            $queryTwoY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_two = 'yes'";
            $resultTwoY = $conn->query($queryTwoY);
            $numTwoY = mysqli_num_rows($resultTwoY);

            $queryThreeY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_three = 'yes'";
            $resultThreeY = $conn->query($queryThreeY);
            $numThreeY = mysqli_num_rows($resultThreeY);

            $queryFourY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_four = 'yes'";
            $resultFourY = $conn->query($queryFourY);
            $numFourY = mysqli_num_rows($resultFourY);

            $queryFiveY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_five = 'yes'";
            $resultFiveY = $conn->query($queryFiveY);
            $numFiveY = mysqli_num_rows($resultFiveY);

            $querySixY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_six = 'yes'";
            $resultSixY = $conn->query($querySixY);
            $numSixY = mysqli_num_rows($resultSixY);

            $querySevenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_seven = 'yes'";
            $resultSevenY = $conn->query($querySevenY);
            $numSevenY = mysqli_num_rows($resultSevenY);

            $queryEightY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_eight = 'yes'";
            $resultEightY = $conn->query($queryEightY);
            $numEightY = mysqli_num_rows($resultEightY);

            $queryNineY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_nine = 'yes'";
            $resultNineY = $conn->query($queryNineY);
            $numNineY = mysqli_num_rows($resultNineY);

            $queryTenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_ten = 'yes'";
            $resultTenY = $conn->query($queryTenY);
            $numTenY = mysqli_num_rows($resultTenY);

            $queryElevenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_eleven = 'yes'";
            $resultElevenY = $conn->query($queryElevenY);
            $numElevenY = mysqli_num_rows($resultElevenY);

            $queryTwelveY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_twelve = 'yes'";
            $resultTwelveY = $conn->query($queryTwelveY);
            $numTwelveY = mysqli_num_rows($resultTwelveY);

            $queryThirteenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_thirteen = 'yes'";
            $resultThirteenY = $conn->query($queryThirteenY);
            $numThirteenY = mysqli_num_rows($resultThirteenY);

            $queryFourteenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_fourteen = 'yes'";
            $resultFourteenY = $conn->query($queryFourteenY);
            $numFourteenY = mysqli_num_rows($resultFourteenY);

            $queryFifteenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_fifteen = 'yes'";
            $resultFifteenY = $conn->query($queryFifteenY);
            $numFifteenY = mysqli_num_rows($resultFifteenY);

            $querySixteenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_sixteen = 'yes'";
            $resultSixteenY = $conn->query($querySixteenY);
            $numSixteenY = mysqli_num_rows($resultSixteenY);

            $querySeventeenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_seventeen = 'yes'";
            $resultSeventeenY = $conn->query($querySeventeenY);
            $numSeventeenY = mysqli_num_rows($resultSeventeenY);

            $queryEighteenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_eighteen = 'yes'";
            $resultEighteenY = $conn->query($queryEighteenY);
            $numEighteenY = mysqli_num_rows($resultEighteenY);

            $queryNineteenY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_nineteen = 'yes'";
            $resultNineteenY = $conn->query($queryNineteenY);
            $numNineteenY = mysqli_num_rows($resultNineteenY);

            $queryTwentyY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_twenty = 'yes'";
            $resultTwentyY = $conn->query($queryTwentyY);
            $numTwentyY = mysqli_num_rows($resultTwentyY);

            $sum_OneY = $numOneY+$numTwoY+$numThreeY+$numFourY+$numFiveY+$numSixY+$numSevenY+$numEightY+$numNineY+$numTenY+$numElevenY
            +$numTwelveY+$numThirteenY+$numFourteenY+$numFifteenY+$numSixteenY+$numSeventeenY+$numEighteenY+$numNineteenY+$numTwentyY;

            echo '<h3>'.number_format($sum_OneY).'</h3>';
        ?>
        </th>

        <th>
        <?php 

            $queryOneN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_one = 'no'";
            $resultOneN = $conn->query($queryOneN);
            $numOneN = mysqli_num_rows($resultOneN);

            $queryTwoN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_two = 'no'";
            $resultTwoN = $conn->query($queryTwoN);
            $numTwoN = mysqli_num_rows($resultTwoN);

            $queryThreeN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_three = 'no'";
            $resultThreeN = $conn->query($queryThreeN);
            $numThreeN = mysqli_num_rows($resultThreeN);

            $queryFourN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_four = 'no'";
            $resultFourN = $conn->query($queryFourN);
            $numFourN = mysqli_num_rows($resultFourN);

            $queryFiveN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_five = 'no'";
            $resultFiveN = $conn->query($queryFiveN);
            $numFiveN = mysqli_num_rows($resultFiveN);

            $querySixN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_six = 'no'";
            $resultSixN = $conn->query($querySixN);
            $numSixN = mysqli_num_rows($resultSixN);

            $querySevenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_seven = 'no'";
            $resultSevenN = $conn->query($querySevenN);
            $numSevenN = mysqli_num_rows($resultSevenN);

            $queryEightN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_eight = 'no'";
            $resultEightN = $conn->query($queryEightN);
            $numEightN = mysqli_num_rows($resultEightN);

            $queryNineN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_nine = 'no'";
            $resultNineN = $conn->query($queryNineN);
            $numNineN = mysqli_num_rows($resultNineN);

            $queryTenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_ten = 'no'";
            $resultTenN = $conn->query($queryTenN);
            $numTenN = mysqli_num_rows($resultTenN);

            $queryElevenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_eleven = 'no'";
            $resultElevenN = $conn->query($queryElevenN);
            $numElevenN = mysqli_num_rows($resultElevenN);

            $queryTwelveN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_twelve = 'no'";
            $resultTwelveN = $conn->query($queryTwelveN);
            $numTwelveN = mysqli_num_rows($resultTwelveN);

            $queryThirteenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'AND health_year_no = '1' AND health_thirteen = 'no'";
            $resultThirteenN = $conn->query($queryThirteenN);
            $numThirteenN = mysqli_num_rows($resultThirteenN);

            $queryFourteenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_fourteen = 'no'";
            $resultFourteenN = $conn->query($queryFourteenN);
            $numFourteenN = mysqli_num_rows($resultFourteenN);

            $queryFifteenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_fifteen = 'no'";
            $resultFifteenN = $conn->query($queryFifteenN);
            $numFifteenN = mysqli_num_rows($resultFifteenN);

            $querySixteenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_sixteen = 'no'";
            $resultSixteenN = $conn->query($querySixteenN);
            $numSixteenN = mysqli_num_rows($resultSixteenN);

            $querySeventeenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_seventeen = 'no'";
            $resultSeventeenN = $conn->query($querySeventeenN);
            $numSeventeenN = mysqli_num_rows($resultSeventeenN);

            $queryEighteenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_eighteen = 'no'";
            $resultEighteenN = $conn->query($queryEighteenN);
            $numEighteenN = mysqli_num_rows($resultEighteenN);

            $queryNineteenN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_nineteen = 'no'";
            $resultNineteenN = $conn->query($queryNineteenN);
            $numNineteenN = mysqli_num_rows($resultNineteenN);

            $queryTwentyN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '1' AND health_twenty = 'no'";
            $resultTwentyN = $conn->query($queryTwentyN);
            $numTwentyN = mysqli_num_rows($resultTwentyN);

            $sum_OneN = $numOneN+$numTwoN+$numThreeN+$numFourN+$numFiveN+$numSixN+$numSevenN+$numEightN+$numNineN+$numTenN+$numElevenN
            +$numTwelveN+$numThirteenN+$numFourteenN+$numFifteenN+$numSixteenN+$numSeventeenN+$numEighteenN+$numNineteenN+$numTwentyN;

            echo '<h3>'.number_format($sum_OneN).'</h3>';
        ?>
    </th>
                                                                    
    <th>
    <?php 

        $queryOneYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_one = 'yes'";
        $resultOneYY = $conn->query($queryOneYY);
        $numOneYY = mysqli_num_rows($resultOneYY);

        $queryTwoYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_two = 'yes'";
        $resultTwoYY = $conn->query($queryTwoYY);
        $numTwoYY = mysqli_num_rows($resultTwoYY);

        $queryThreeYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_three = 'yes'";
        $resultThreeYY = $conn->query($queryThreeYY);
        $numThreeYY = mysqli_num_rows($resultThreeYY);

        $queryFourYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_four = 'yes'";
        $resultFourYY = $conn->query($queryFourYY);
        $numFourYY = mysqli_num_rows($resultFourYY);

        $queryFiveYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_five = 'yes'";
        $resultFiveYY = $conn->query($queryFiveYY);
        $numFiveYY = mysqli_num_rows($resultFiveYY);

        $querySixYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_six = 'yes'";
        $resultSixYY = $conn->query($querySixYY);
        $numSixYY = mysqli_num_rows($resultSixYY);

        $querySevenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_seven = 'yes'";
        $resultSevenYY = $conn->query($querySevenYY);
        $numSevenYY = mysqli_num_rows($resultSevenYY);

        $queryEightYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_eight = 'yes'";
        $resultEightYY = $conn->query($queryEightYY);
        $numEightYY = mysqli_num_rows($resultEightYY);

        $queryNineYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_nine = 'yes'";
        $resultNineYY = $conn->query($queryNineYY);
        $numNineYY = mysqli_num_rows($resultNineYY);

        $queryTenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_ten = 'yes'";
        $resultTenYY = $conn->query($queryTenYY);
        $numTenYY = mysqli_num_rows($resultTenYY);

        $queryElevenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_eleven = 'yes'";
        $resultElevenYY = $conn->query($queryElevenYY);
        $numElevenYY = mysqli_num_rows($resultElevenYY);

        $queryTwelveYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_twelve = 'yes'";
        $resultTwelveYY = $conn->query($queryTwelveYY);
        $numTwelveYY = mysqli_num_rows($resultTwelveYY);

        $queryThirteenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_thirteen = 'yes'";
        $resultThirteenYY = $conn->query($queryThirteenYY);
        $numThirteenYY = mysqli_num_rows($resultThirteenYY);

        $queryFourteenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_fourteen = 'yes'";
        $resultFourteenYY = $conn->query($queryFourteenYY);
        $numFourteenYY = mysqli_num_rows($resultFourteenYY);

        $queryFifteenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_fifteen = 'yes'";
        $resultFifteenYY = $conn->query($queryFifteenYY);
        $numFifteenYY = mysqli_num_rows($resultFifteenYY);

        $querySixteenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_sixteen = 'yes'";
        $resultSixteenYY = $conn->query($querySixteenYY);
        $numSixteenYY = mysqli_num_rows($resultSixteenYY);

        $querySeventeenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_seventeen = 'yes'";
        $resultSeventeenYY = $conn->query($querySeventeenYY);
        $numSeventeenYY = mysqli_num_rows($resultSeventeenYY);

        $queryEighteenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_eighteen = 'yes'";
        $resultEighteenYY = $conn->query($queryEighteenYY);
        $numEighteenYY = mysqli_num_rows($resultEighteenYY);

        $queryNineteenYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_nineteen = 'yes'";
        $resultNineteenYY = $conn->query($queryNineteenYY);
        $numNineteenYY = mysqli_num_rows($resultNineteenYY);

        $queryTwentyYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_twenty = 'yes'";
        $resultTwentyYY = $conn->query($queryTwentyYY);
        $numTwentyYY = mysqli_num_rows($resultTwentyYY);

        $sum_TwoYY = $numOneYY+$numTwoYY+$numThreeYY+$numFourYY+$numFiveYY+$numSixYY+$numSevenYY+$numEightYY+$numNineYY+$numTenYY+$numElevenYY
        +$numTwelveYY+$numThirteenYY+$numFourteenYY+$numFifteenYY+$numSixteenYY+$numSeventeenYY+$numEighteenYY+$numNineteenYY+$numTwentyYY;

        echo '<h3>'.number_format($sum_TwoYY).'</h3>';
    ?>
    </th>
                                                                    
    <th>
    <?php 

        $queryOneNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_one = 'no'";
        $resultOneNN = $conn->query($queryOneNN);
        $numOneNN = mysqli_num_rows($resultOneNN);

        $queryTwoNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_two = 'no'";
        $resultTwoNN = $conn->query($queryTwoNN);
        $numTwoNN = mysqli_num_rows($resultTwoNN);

        $queryThreeNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_three = 'no'";
        $resultThreeNN = $conn->query($queryThreeNN);
        $numThreeNN = mysqli_num_rows($resultThreeNN);

        $queryFourNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_four = 'no'";
        $resultFourNN = $conn->query($queryFourNN);
        $numFourNN = mysqli_num_rows($resultFourNN);

        $queryFiveNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_five = 'no'";
        $resultFiveNN = $conn->query($queryFiveNN);
        $numFiveNN = mysqli_num_rows($resultFiveNN);

        $querySixNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_six = 'no'";
        $resultSixNN = $conn->query($querySixNN);
        $numSixNN = mysqli_num_rows($resultSixNN);

        $querySevenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_seven = 'no'";
        $resultSevenNN = $conn->query($querySevenNN);
        $numSevenNN = mysqli_num_rows($resultSevenNN);

        $queryEightNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_eight = 'no'";
        $resultEightNN = $conn->query($queryEightNN);
        $numEightNN = mysqli_num_rows($resultEightNN);

        $queryNineNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_nine = 'no'";
        $resultNineNN = $conn->query($queryNineNN);
        $numNineNN = mysqli_num_rows($resultNineNN);

        $queryTenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_ten = 'no'";
        $resultTenNN = $conn->query($queryTenNN);
        $numTenNN = mysqli_num_rows($resultTenNN);

        $queryElevenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_eleven = 'no'";
        $resultElevenNN = $conn->query($queryElevenNN);
        $numElevenNN = mysqli_num_rows($resultElevenNN);

        $queryTwelveNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_twelve = 'no'";
        $resultTwelveNN = $conn->query($queryTwelveNN);
        $numTwelveNN = mysqli_num_rows($resultTwelveNN);

        $queryThirteenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_thirteen = 'no'";
        $resultThirteenNN = $conn->query($queryThirteenNN);
        $numThirteenNN = mysqli_num_rows($resultThirteenNN);

        $queryFourteenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_fourteen = 'no'";
        $resultFourteenNN = $conn->query($queryFourteenNN);
        $numFourteenNN = mysqli_num_rows($resultFourteenNN);

        $queryFifteenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_fifteen = 'no'";
        $resultFifteenNN = $conn->query($queryFifteenNN);
        $numFifteenNN = mysqli_num_rows($resultFifteenNN);

        $querySixteenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_sixteen = 'no'";
        $resultSixteenNN = $conn->query($querySixteenNN);
        $numSixteenNN = mysqli_num_rows($resultSixteenNN);

        $querySeventeenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_seventeen = 'no'";
        $resultSeventeenNN = $conn->query($querySeventeenNN);
        $numSeventeenNN = mysqli_num_rows($resultSeventeenNN);

        $queryEighteenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_eighteen = 'no'";
        $resultEighteenNN = $conn->query($queryEighteenNN);
        $numEighteenNN = mysqli_num_rows($resultEighteenNN);

        $queryNineteenNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_nineteen = 'no'";
        $resultNineteenNN = $conn->query($queryNineteenNN);
        $numNineteenNN = mysqli_num_rows($resultNineteenNN);

        $queryTwentyNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND health_year_no = '2' AND health_twenty = 'no'";
        $resultTwentyNN = $conn->query($queryTwentyNN);
        $numTwentyNN = mysqli_num_rows($resultTwentyNN);

        $sum_TwoNN = $numOneNN+$numTwoNN+$numThreeNN+$numFourNN+$numFiveNN+$numSixNN+$numSevenNN+$numEightNN+$numNineNN+$numTenNN+$numElevenNN
        +$numTwelveNN+$numThirteenNN+$numFourteenNN+$numFifteenNN+$numSixteenNN+$numSeventeenNN+$numEighteenNN+$numNineteenNN+$numTwentyNN;

        echo '<h3>'.number_format($sum_TwoNN).'</h3>';
    ?>
    </th>

    <th>
    <?php 

        $queryOneYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_one = 'yes'";
        $resultOneYYY = $conn->query($queryOneYYY);
        $numOneYYY = mysqli_num_rows($resultOneYYY);

        $queryTwoYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_two = 'yes'";
        $resultTwoYYY = $conn->query($queryTwoYYY);
        $numTwoYYY = mysqli_num_rows($resultTwoYYY);

        $queryThreeYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_three = 'yes'";
        $resultThreeYYY = $conn->query($queryThreeYYY);
        $numThreeYYY = mysqli_num_rows($resultThreeYYY);

        $queryFourYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_four = 'yes'";
        $resultFourYYY = $conn->query($queryFourYYY);
        $numFourYYY = mysqli_num_rows($resultFourYYY);

        $queryFiveYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_five = 'yes'";
        $resultFiveYYY = $conn->query($queryFiveYYY);
        $numFiveYYY = mysqli_num_rows($resultFiveYYY);

        $querySixYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_six = 'yes'";
        $resultSixYYY = $conn->query($querySixYYY);
        $numSixYYY = mysqli_num_rows($resultSixYYY);

        $querySevenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_seven = 'yes'";
        $resultSevenYYY = $conn->query($querySevenYYY);
        $numSevenYYY = mysqli_num_rows($resultSevenYYY);

        $queryEightYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_eight = 'yes'";
        $resultEightYYY = $conn->query($queryEightYYY);
        $numEightYYY = mysqli_num_rows($resultEightYYY);

        $queryNineYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_nine = 'yes'";
        $resultNineYYY = $conn->query($queryNineYYY);
        $numNineYYY = mysqli_num_rows($resultNineYYY);

        $queryTenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_ten = 'yes'";
        $resultTenYYY = $conn->query($queryTenYYY);
        $numTenYYY = mysqli_num_rows($resultTenYYY);

        $queryElevenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_eleven = 'yes'";
        $resultElevenYYY = $conn->query($queryElevenYYY);
        $numElevenYYY = mysqli_num_rows($resultElevenYYY);

        $queryTwelveYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_twelve = 'yes'";
        $resultTwelveYYY = $conn->query($queryTwelveYYY);
        $numTwelveYYY = mysqli_num_rows($resultTwelveYYY);

        $queryThirteenYYY = "SELECT * FROM tbl_health
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_thirteen = 'yes'";
        $resultThirteenYYY = $conn->query($queryThirteenYYY);
        $numThirteenYYY = mysqli_num_rows($resultThirteenYYY);

        $queryFourteenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_fourteen = 'yes'";
        $resultFourteenYYY = $conn->query($queryFourteenYYY);
        $numFourteenYYY = mysqli_num_rows($resultFourteenYYY);

        $queryFifteenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_fifteen = 'yes'";
        $resultFifteenYYY = $conn->query($queryFifteenYYY);
        $numFifteenYYY = mysqli_num_rows($resultFifteenYYY);

        $querySixteenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_sixteen = 'yes'";
        $resultSixteenYYY = $conn->query($querySixteenYYY);
        $numSixteenYYY = mysqli_num_rows($resultSixteenYYY);

        $querySeventeenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_seventeen = 'yes'";
        $resultSeventeenYYY = $conn->query($querySeventeenYYY);
        $numSeventeenYYY = mysqli_num_rows($resultSeventeenYYY);

        $queryEighteenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_eighteen = 'yes'";
        $resultEighteenYYY = $conn->query($queryEighteenYYY);
        $numEighteenYYY = mysqli_num_rows($resultEighteenYYY);

        $queryNineteenYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_nineteen = 'yes'";
        $resultNineteenYYY = $conn->query($queryNineteenYYY);
        $numNineteenYYY = mysqli_num_rows($resultNineteenYYY);

        $queryTwentyYYY = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND health_year_no = '3' AND health_twenty = 'yes'";
        $resultTwentyYYY = $conn->query($queryTwentyYYY);
        $numTwentyYYY = mysqli_num_rows($resultTwentyYYY);

        $sum_ThreeYYY = $numOneYYY+$numTwoYYY+$numThreeYYY+$numFourYYY+$numFiveYYY+$numSixYYY+$numSevenYYY
        +$numEightYYY+$numNineYYY+$numTenYYY+$numElevenYYY+$numTwelveYYY+$numThirteenYYY+$numFourteenYYY
        +$numFifteenYYY+$numSixteenYYY+$numSeventeenYYY+$numEighteenYYY+$numNineteenYYY+$numTwentyYYY;


        echo '<h3>'.number_format($sum_ThreeYYY).'</h3>';
    ?>
    </th>
                                                                    
    <th>
    <?php 

            $queryOneNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_one = 'no'";
            $resultOneNNN = $conn->query($queryOneNNN);
            $numOneNNN = mysqli_num_rows($resultOneNNN);

            $queryTwoNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_two = 'no'";
            $resultTwoNNN = $conn->query($queryTwoNNN);
            $numTwoNNN = mysqli_num_rows($resultTwoNNN);

            $queryThreeNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_three = 'no'";
            $resultThreeNNN = $conn->query($queryThreeNNN);
            $numThreeNNN = mysqli_num_rows($resultThreeNNN);

            $queryFourNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_four = 'no'";
            $resultFourNNN = $conn->query($queryFourNNN);
            $numFourNNN = mysqli_num_rows($resultFourNNN);

            $queryFiveNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_five = 'no'";
            $resultFiveNNN = $conn->query($queryFiveNNN);
            $numFiveNNN = mysqli_num_rows($resultFiveNNN);

            $querySixNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_six = 'no'";
            $resultSixNNN = $conn->query($querySixNNN);
            $numSixNNN = mysqli_num_rows($resultSixNNN);

            $querySevenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_seven = 'no'";
            $resultSevenNNN = $conn->query($querySevenNNN);
            $numSevenNNN = mysqli_num_rows($resultSevenNNN);

            $queryEightNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_eight = 'no'";
            $resultEightNNN = $conn->query($queryEightNNN);
            $numEightNNN = mysqli_num_rows($resultEightNNN);

            $queryNineNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_nine = 'no'";
            $resultNineNNN = $conn->query($queryNineNNN);
            $numNineNNN = mysqli_num_rows($resultNineNNN);

            $queryTenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_ten = 'no'";
            $resultTenNNN = $conn->query($queryTenNNN);
            $numTenNNN = mysqli_num_rows($resultTenNNN);

            $queryElevenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_eleven = 'no'";
            $resultElevenNNN = $conn->query($queryElevenNNN);
            $numElevenNNN = mysqli_num_rows($resultElevenNNN);

            $queryTwelveNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_twelve = 'no'";
            $resultTwelveNNN = $conn->query($queryTwelveNNN);
            $numTwelveNNN = mysqli_num_rows($resultTwelveNNN);

            $queryThirteenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_thirteen = 'no'";
            $resultThirteenNNN = $conn->query($queryThirteenNNN);
            $numThirteenNNN = mysqli_num_rows($resultThirteenNNN);

            $queryFourteenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_fourteen = 'no'";
            $resultFourteenNNN = $conn->query($queryFourteenNNN);
            $numFourteenNNN = mysqli_num_rows($resultFourteenNNN);

            $queryFifteenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_fifteen = 'no'";
            $resultFifteenNNN = $conn->query($queryFifteenNNN);
            $numFifteenNNN = mysqli_num_rows($resultFifteenNNN);

            $querySixteenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_sixteen = 'no'";
            $resultSixteenNNN = $conn->query($querySixteenNNN);
            $numSixteenNNN = mysqli_num_rows($resultSixteenNNN);

            $querySeventeenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_seventeen = 'no'";
            $resultSeventeenNNN = $conn->query($querySeventeenNNN);
            $numSeventeenNNN = mysqli_num_rows($resultSeventeenNNN);

            $queryEighteenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_eighteen = 'no'";
            $resultEighteenNNN = $conn->query($queryEighteenNNN);
            $numEighteenNNN = mysqli_num_rows($resultEighteenNNN);

            $queryNineteenNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_nineteen = 'no'";
            $resultNineteenNNN = $conn->query($queryNineteenNNN);
            $numNineteenNNN = mysqli_num_rows($resultNineteenNNN);

            $queryTwentyNNN = "SELECT * FROM tbl_health WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND health_year_no = '3' AND health_twenty = 'no'";
            $resultTwentyNNN = $conn->query($queryTwentyNNN);
            $numTwentyNNN = mysqli_num_rows($resultTwentyNNN);

            $sum_ThreeNNN = $numOneNNN+$numTwoNNN+$numThreeNNN+$numFourNNN+$numFiveNNN+$numSixNNN+$numSevenNNN
            +$numEightNNN+$numNineNNN+$numTenNNN+$numElevenNNN+$numTwelveNNN+$numThirteenNNN+$numFourteenNNN
            +$numFifteenNNN+$numSixteenNNN+$numSeventeenNNN+$numEighteenNNN+$numNineteenNNN+$numTwentyNNN;

        

            echo '<h3>'.number_format($sum_ThreeNNN).'</h3>';
        ?>
        </th>
    </tr>
</table>      

<div style="padding-top: 10px;"></div>

<?php
    $sqlHealthTwo = "SELECT * FROM tbl_health_two WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHealthTwo = $conn->query($sqlHealthTwo);
    $rowHealthTwo = $queryHealthTwo->fetch_assoc();
?>

<table>
    <tr>
        <td>
          <h3>
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-forward" viewBox="0 0 16 16">
                <path d="M9.502 5.513a.144.144 0 0 0-.202.134V6.65a.5.5 0 0 1-.5.5H2.5v2.9h6.3a.5.5 0 0 1 .5.5v1.003c0 .108.11.176.202.134l3.984-2.933a.51.51 0 0 1 .042-.028.147.147 0 0 0 0-.252.51.51 0 0 1-.042-.028L9.502 5.513zM8.3 5.647a1.144 1.144 0 0 1 1.767-.96l3.994 2.94a1.147 1.147 0 0 1 0 1.946l-3.994 2.94a1.144 1.144 0 0 1-1.767-.96v-.503H2a.5.5 0 0 1-.5-.5v-3.9a.5.5 0 0 1 .5-.5h6.3v-.503z"/>
            </svg>
            หมู่โลหิต
          </h3>
        </td>

        <?php $health_two_bloodtype = (isset($rowHealthTwo['health_two_bloodtype']) ? $rowHealthTwo['health_two_bloodtype'] : ''); ?>

        <td>
            <?php if($health_two_bloodtype == "A (เอ)"){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;A (เอ)
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;A (เอ)
                    </span>
                </h5>

            <?php } ?>
        </td>
        <td>
            <?php if($health_two_bloodtype == "B (บี)"){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;B (บี)
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;B (บี)
                    </span>
                </h5>

            <?php } ?>
        </td>
        <td>
            <?php if($health_two_bloodtype == "AB (เอบี)"){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;AB (เอบี)
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;AB (เอบี)
                    </span>
                </h5>

            <?php } ?>
        </td>
        <td>
            <?php if($health_two_bloodtype == "O (โอ)"){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;O (โอ)
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;O (โอ)
                    </span>
                </h5>

            <?php } ?>
        </td>
    </tr>

    <tr>
        <td>
          <h3>
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-forward" viewBox="0 0 16 16">
                <path d="M9.502 5.513a.144.144 0 0 0-.202.134V6.65a.5.5 0 0 1-.5.5H2.5v2.9h6.3a.5.5 0 0 1 .5.5v1.003c0 .108.11.176.202.134l3.984-2.933a.51.51 0 0 1 .042-.028.147.147 0 0 0 0-.252.51.51 0 0 1-.042-.028L9.502 5.513zM8.3 5.647a1.144 1.144 0 0 1 1.767-.96l3.994 2.94a1.147 1.147 0 0 1 0 1.946l-3.994 2.94a1.144 1.144 0 0 1-1.767-.96v-.503H2a.5.5 0 0 1-.5-.5v-3.9a.5.5 0 0 1 .5-.5h6.3v-.503z"/>
            </svg>
            โรคประจำตัวตัว
          </h3>
        </td>

        <?php $health_two_condise = (isset($rowHealthTwo['health_two_condise']) ? $rowHealthTwo['health_two_condise'] : ''); ?>

        <td>
            <?php if($health_two_condise == "ไม่มี"){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ไม่มี
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ไม่มี
                    </span>
                </h5>

            <?php } ?>
        </td>
        <td colspan="3">
            <?php if($health_two_condise == "มี"){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มี

                        <?php  
                            if($rowHealthTwo["health_two_condise_note"] != ""){

                                echo '(ระบุ) : &nbsp;'.$rowHealthTwo["health_two_condise_note"];

                            }else{}
                        ?>

                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มี
                    </span>
                </h5>

            <?php } ?>
        </td>
    </tr>

    <tr>
        <td>
          <h3>
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-forward" viewBox="0 0 16 16">
                <path d="M9.502 5.513a.144.144 0 0 0-.202.134V6.65a.5.5 0 0 1-.5.5H2.5v2.9h6.3a.5.5 0 0 1 .5.5v1.003c0 .108.11.176.202.134l3.984-2.933a.51.51 0 0 1 .042-.028.147.147 0 0 0 0-.252.51.51 0 0 1-.042-.028L9.502 5.513zM8.3 5.647a1.144 1.144 0 0 1 1.767-.96l3.994 2.94a1.147 1.147 0 0 1 0 1.946l-3.994 2.94a1.144 1.144 0 0 1-1.767-.96v-.503H2a.5.5 0 0 1-.5-.5v-3.9a.5.5 0 0 1 .5-.5h6.3v-.503z"/>
            </svg>
            ยาที่ต้องรับประทานเป็นประจำ
          </h3>
        </td>

        <?php $health_two_drug = (isset($rowHealthTwo['health_two_drug']) ? $rowHealthTwo['health_two_drug'] : ''); ?>

        <td>
            <?php if($health_two_drug == "ไม่มี"){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ไม่มี
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ไม่มี
                    </span>
                </h5>

            <?php } ?>
        </td>
        <td colspan="3">
            <?php if($health_two_drug == "มี"){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มี

                        <?php  
                            if($rowHealthTwo["health_two_drug_note"] != ""){

                                echo '(ระบุ) : &nbsp;'.$rowHealthTwo["health_two_drug_note"];

                            }else{}
                        ?>

                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มี
                    </span>
                </h5>

            <?php } ?>
        </td>
    </tr>
    <tr>
        <td colspan="5">
            <img src="images/5.jpg" style="width: 70%;">
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- แบบคัดกรองนักเรียนด้านสภาพครอบครัว (12) --------------------------->

<table>
    <tr>
        <td style="text-align: center;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 80px; height: 80px;">
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 10px;">
            <h1>แบบคัดกรองนักเรียนด้านสภาพครอบครัว</h1>
        </td>
    </tr>
    <tr>
        <td style="text-align: left;">
            <h3>
                <u>คำชี้แจง</u> ให้ทำเครื่องหมาย
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                    <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                </svg>
                ในช่องที่ตรงกับลักษณะของนักเรียน
            </h3>
        </td>
    </tr>
</table>  

<table>
    <tr style="text-align: center;">
        <th rowspan="2" width="5%"><h3>ที่</h3></th>
        <th rowspan="2" width="50%"><h3>รายการ</h3></th>
        <th colspan="2" width="15%"><h3>ปีที่ 1</h3></th>
        <th colspan="2" width="15%"><h3>ปีที่ 2</h3></th>
        <th colspan="2" width="15%"><h3>ปีที่ 3</h3></th>
    </tr>
    <tr style="text-align: center;">
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
        <th><h3>ใช่</h3></th>
        <th><h3>ไม่ใช่</h3></th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>1</h5></th>
        <th style="text-align: left;"><h5>พ่อหรือแม่เสียชีวิตหรือหย่าร้างหรือแยกกันอยู่</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_one'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_one'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';   

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>2</h5></th>
        <th style="text-align: left;"><h5>นักเรียนอาศัยอยู่กับบุคคลอื่นที่ไม่ใช่พ่อแม่</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_two'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_two'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>3</h5></th>
        <th style="text-align: left;"><h5>พ่อแม่ทะเลาะกันบ่อยครั้ง</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_three'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_three'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>4</h5></th>
        <th style="text-align: left;"><h5>บุคคลในบ้าน สูบบุหรี่ ดื่มสุรา หรือสารเสพติดอื่น</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_four'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_four'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>                                             
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>5</h5></th>
        <th style="text-align: left;"><h5>นักเรียนมีพี่น้องมากกว่า 3 คน</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_five'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_five'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>                                                    
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>6</h5></th>
        <th style="text-align: left;"><h5>นักเรียนต้องทำงานหารายได้เพื่อช่วยเหลือครอบครัว</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_six'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';  

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_six'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';    

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>7</h5></th>
        <th style="text-align: left;"><h5>นักเรียนถูกพ่อแม่หรือผู้ปกครองทุบตีบ่อย</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_seven'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_seven'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>8</h5></th>
        <th style="text-align: left;"><h5>นักเรียนมีปัญหาขัดแย้งกับคนในครอบครัว</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_eight'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_eight'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>9</h5></th>
        <th style="text-align: left;"><h5>นักเรียนเดินทางมาโรงเรียนด้วยตนเอง ผู้ปกครองไม่ได้รับส่ง <br /> หรือไม่มีรถประจำ</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_nine'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_nine'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr>
        <th style="text-align: center;"><h5>10</h5></th>
        <th style="text-align: left;"><h5>นักเรียนอาศัยอยู่ในชุมชนแออัด เสื่อมโทรม</h5></th>
        <?php
            $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
            $queryFamily = $conn->query($sqlFamily);
            while($rowFamily = $queryFamily->fetch_assoc()){
        ?>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_ten'] == 'yes'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';      

                }else{}
            ?>
        </th>
        <th style="text-align: center; color: #000;">
            <?php  
                if($rowFamily['family_ten'] == 'no'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';     

                }else{}
            ?>
        </th>
        <?php } ?>
    </tr>
    <!-- -------------------------------------- -->
    <tr style="text-align: center;">
        <th colspan="2"><h3>รวม</h3></th>
        <th>
        <?php 

            $queryOneY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_one = 'yes'";
            $resultOneY = $conn->query($queryOneY);
            $numOneY = mysqli_num_rows($resultOneY);

            $queryTwoY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_two = 'yes'";
            $resultTwoY = $conn->query($queryTwoY);
            $numTwoY = mysqli_num_rows($resultTwoY);

            $queryThreeY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_three = 'yes'";
            $resultThreeY = $conn->query($queryThreeY);
            $numThreeY = mysqli_num_rows($resultThreeY);

            $queryFourY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_four = 'yes'";
            $resultFourY = $conn->query($queryFourY);
            $numFourY = mysqli_num_rows($resultFourY);

            $queryFiveY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_five = 'yes'";
            $resultFiveY = $conn->query($queryFiveY);
            $numFiveY = mysqli_num_rows($resultFiveY);

            $querySixY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_six = 'yes'";
            $resultSixY = $conn->query($querySixY);
            $numSixY = mysqli_num_rows($resultSixY);

            $querySevenY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_seven = 'yes'";
            $resultSevenY = $conn->query($querySevenY);
            $numSevenY = mysqli_num_rows($resultSevenY);

            $queryEightY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_eight = 'yes'";
            $resultEightY = $conn->query($queryEightY);
            $numEightY = mysqli_num_rows($resultEightY);

            $queryNineY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_nine = 'yes'";
            $resultNineY = $conn->query($queryNineY);
            $numNineY = mysqli_num_rows($resultNineY);

            $queryTenY = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_ten = 'yes'";
            $resultTenY = $conn->query($queryTenY);
            $numTenY = mysqli_num_rows($resultTenY);

            $sum_OneY = $numOneY+$numTwoY+$numThreeY+$numFourY+$numFiveY+$numSixY+$numSevenY+$numEightY+$numNineY+$numTenY;

            echo '<h3>'.number_format($sum_OneY).'</h3>';
        ?>
        </th>

        <th>
        <?php 

            $queryOneN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_one = 'no'";
            $resultOneN = $conn->query($queryOneN);
            $numOneN = mysqli_num_rows($resultOneN);

            $queryTwoN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_two = 'no'";
            $resultTwoN = $conn->query($queryTwoN);
            $numTwoN = mysqli_num_rows($resultTwoN);

            $queryThreeN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_three = 'no'";
            $resultThreeN = $conn->query($queryThreeN);
            $numThreeN = mysqli_num_rows($resultThreeN);

            $queryFourN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_four = 'no'";
            $resultFourN = $conn->query($queryFourN);
            $numFourN = mysqli_num_rows($resultFourN);

            $queryFiveN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_five = 'no'";
            $resultFiveN = $conn->query($queryFiveN);
            $numFiveN = mysqli_num_rows($resultFiveN);

            $querySixN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_six = 'no'";
            $resultSixN = $conn->query($querySixN);
            $numSixN = mysqli_num_rows($resultSixN);

            $querySevenN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_seven = 'no'";
            $resultSevenN = $conn->query($querySevenN);
            $numSevenN = mysqli_num_rows($resultSevenN);

            $queryEightN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_eight = 'no'";
            $resultEightN = $conn->query($queryEightN);
            $numEightN = mysqli_num_rows($resultEightN);

            $queryNineN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_nine = 'no'";
            $resultNineN = $conn->query($queryNineN);
            $numNineN = mysqli_num_rows($resultNineN);

            $queryTenN = "SELECT * FROM tbl_family
            WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
            AND family_year_no = '1' AND family_ten = 'no'";
            $resultTenN = $conn->query($queryTenN);
            $numTenN = mysqli_num_rows($resultTenN);

            $sum_OneN = $numOneN+$numTwoN+$numThreeN+$numFourN+$numFiveN+$numSixN+$numSevenN+$numEightN+$numNineN+$numTenN;

            echo '<h3>'.number_format($sum_OneN).'</h3>';
        ?>
    </th>
                                                                    
    <th>
    <?php 

        $queryOneYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_one = 'yes'";
        $resultOneYY = $conn->query($queryOneYY);
        $numOneYY = mysqli_num_rows($resultOneYY);

        $queryTwoYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_two = 'yes'";
        $resultTwoYY = $conn->query($queryTwoYY);
        $numTwoYY = mysqli_num_rows($resultTwoYY);

        $queryThreeYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_three = 'yes'";
        $resultThreeYY = $conn->query($queryThreeYY);
        $numThreeYY = mysqli_num_rows($resultThreeYY);

        $queryFourYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_four = 'yes'";
        $resultFourYY = $conn->query($queryFourYY);
        $numFourYY = mysqli_num_rows($resultFourYY);

        $queryFiveYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_five = 'yes'";
        $resultFiveYY = $conn->query($queryFiveYY);
        $numFiveYY = mysqli_num_rows($resultFiveYY);

        $querySixYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_six = 'yes'";
        $resultSixYY = $conn->query($querySixYY);
        $numSixYY = mysqli_num_rows($resultSixYY);

        $querySevenYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_seven = 'yes'";
        $resultSevenYY = $conn->query($querySevenYY);
        $numSevenYY = mysqli_num_rows($resultSevenYY);

        $queryEightYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_eight = 'yes'";
        $resultEightYY = $conn->query($queryEightYY);
        $numEightYY = mysqli_num_rows($resultEightYY);

        $queryNineYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_nine = 'yes'";
        $resultNineYY = $conn->query($queryNineYY);
        $numNineYY = mysqli_num_rows($resultNineYY);

        $queryTenYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_ten = 'yes'";
        $resultTenYY = $conn->query($queryTenYY);
        $numTenYY = mysqli_num_rows($resultTenYY);

        $sum_TwoYY = $numOneYY+$numTwoYY+$numThreeYY+$numFourYY+$numFiveYY+$numSixYY+$numSevenYY+$numEightYY+$numNineYY+$numTenYY;

        echo '<h3>'.number_format($sum_TwoYY).'</h3>';
    ?>
    </th>
                                                                    
    <th>
    <?php 

        $queryOneNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_one = 'no'";
        $resultOneNN = $conn->query($queryOneNN);
        $numOneNN = mysqli_num_rows($resultOneNN);

        $queryTwoNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_two = 'no'";
        $resultTwoNN = $conn->query($queryTwoNN);
        $numTwoNN = mysqli_num_rows($resultTwoNN);

        $queryThreeNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_three = 'no'";
        $resultThreeNN = $conn->query($queryThreeNN);
        $numThreeNN = mysqli_num_rows($resultThreeNN);

        $queryFourNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_four = 'no'";
        $resultFourNN = $conn->query($queryFourNN);
        $numFourNN = mysqli_num_rows($resultFourNN);

        $queryFiveNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_five = 'no'";
        $resultFiveNN = $conn->query($queryFiveNN);
        $numFiveNN = mysqli_num_rows($resultFiveNN);

        $querySixNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_six = 'no'";
        $resultSixNN = $conn->query($querySixNN);
        $numSixNN = mysqli_num_rows($resultSixNN);

        $querySevenNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_seven = 'no'";
        $resultSevenNN = $conn->query($querySevenNN);
        $numSevenNN = mysqli_num_rows($resultSevenNN);

        $queryEightNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_eight = 'no'";
        $resultEightNN = $conn->query($queryEightNN);
        $numEightNN = mysqli_num_rows($resultEightNN);

        $queryNineNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_nine = 'no'";
        $resultNineNN = $conn->query($queryNineNN);
        $numNineNN = mysqli_num_rows($resultNineNN);

        $queryTenNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '2' AND family_ten = 'no'";
        $resultTenNN = $conn->query($queryTenNN);
        $numTenNN = mysqli_num_rows($resultTenNN);

        $sum_TwoNN = $numOneNN+$numTwoNN+$numThreeNN+$numFourNN+$numFiveNN+$numSixNN+$numSevenNN+$numEightNN+$numNineNN+$numTenNN;

        echo '<h3>'.number_format($sum_TwoNN).'</h3>';
    ?>
    </th>

    <th>
    <?php 

        $queryOneYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_one = 'yes'";
        $resultOneYYY = $conn->query($queryOneYYY);
        $numOneYYY = mysqli_num_rows($resultOneYYY);

        $queryTwoYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_two = 'yes'";
        $resultTwoYYY = $conn->query($queryTwoYYY);
        $numTwoYYY = mysqli_num_rows($resultTwoYYY);

        $queryThreeYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_three = 'yes'";
        $resultThreeYYY = $conn->query($queryThreeYYY);
        $numThreeYYY = mysqli_num_rows($resultThreeYYY);

        $queryFourYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_four = 'yes'";
        $resultFourYYY = $conn->query($queryFourYYY);
        $numFourYYY = mysqli_num_rows($resultFourYYY);

        $queryFiveYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_five = 'yes'";
        $resultFiveYYY = $conn->query($queryFiveYYY);
        $numFiveYYY = mysqli_num_rows($resultFiveYYY);

        $querySixYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_six = 'yes'";
        $resultSixYYY = $conn->query($querySixYYY);
        $numSixYYY = mysqli_num_rows($resultSixYYY);

        $querySevenYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_seven = 'yes'";
        $resultSevenYYY = $conn->query($querySevenYYY);
        $numSevenYYY = mysqli_num_rows($resultSevenYYY);

        $queryEightYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_eight = 'yes'";
        $resultEightYYY = $conn->query($queryEightYYY);
        $numEightYYY = mysqli_num_rows($resultEightYYY);

        $queryNineYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_nine = 'yes'";
        $resultNineYYY = $conn->query($queryNineYYY);
        $numNineYYY = mysqli_num_rows($resultNineYYY);

        $queryTenYYY = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_ten = 'yes'";
        $resultTenYYY = $conn->query($queryTenYYY);
        $numTenYYY = mysqli_num_rows($resultTenYYY);

        $sum_ThreeYYY = $numOneYYY+$numTwoYYY+$numThreeYYY+$numFourYYY+$numFiveYYY+$numSixYYY+$numSevenYYY+$numEightYYY+$numNineYYY+$numTenYYY;

        echo '<h3>'.number_format($sum_ThreeYYY).'</h3>';
    ?>
    </th>
                                                                    
    <th>
    <?php 

        $queryOneNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_one = 'no'";
        $resultOneNNN = $conn->query($queryOneNNN);
        $numOneNNN = mysqli_num_rows($resultOneNNN);

        $queryTwoNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_two = 'no'";
        $resultTwoNNN = $conn->query($queryTwoNNN);
        $numTwoNNN = mysqli_num_rows($resultTwoNNN);

        $queryThreeNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_three = 'no'";
        $resultThreeNNN = $conn->query($queryThreeNNN);
        $numThreeNNN = mysqli_num_rows($resultThreeNNN);

        $queryFourNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_four = 'no'";
        $resultFourNNN = $conn->query($queryFourNNN);
        $numFourNNN = mysqli_num_rows($resultFourNNN);

        $queryFiveNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_five = 'no'";
        $resultFiveNNN = $conn->query($queryFiveNNN);
        $numFiveNNN = mysqli_num_rows($resultFiveNNN);

        $querySixNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_six = 'no'";
        $resultSixNNN = $conn->query($querySixNNN);
        $numSixNNN = mysqli_num_rows($resultSixNNN);

        $querySevenNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_seven = 'no'";
        $resultSevenNNN = $conn->query($querySevenNNN);
        $numSevenNNN = mysqli_num_rows($resultSevenNNN);

        $queryEightNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_eight = 'no'";
        $resultEightNNN = $conn->query($queryEightNNN);
        $numEightNNN = mysqli_num_rows($resultEightNNN);

        $queryNineNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_nine = 'no'";
        $resultNineNNN = $conn->query($queryNineNNN);
        $numNineNNN = mysqli_num_rows($resultNineNNN);

        $queryTenNNN = "SELECT * FROM tbl_family
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND family_year_no = '3' AND family_ten = 'no'";
        $resultTenNNN = $conn->query($queryTenNNN);
        $numTenNNN = mysqli_num_rows($resultTenNNN);

        $sum_ThreeNNN = $numOneNNN+$numTwoNNN+$numThreeNNN+$numFourNNN+$numFiveNNN+$numSixNNN+$numSevenNNN+$numEightNNN+$numNineNNN+$numTenNNN;
        
        echo '<h3>'.number_format($sum_ThreeNNN).'</h3>';
    ?>
        </th>
    </tr>
</table>

<div style="padding-top: 10px;"></div>

<table>
    <tr>
        <td colspan="5">
            <h3>
                รายได้เฉลี่ยของครอบครัวต่อเดือน (รายได้ของพ่อแม่หรือผู้ปกครอง และบุคคลอื่นในครอบครัวรวมกัน)
            </h3>
        </td>
    </tr>

    <?php
        $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
        $queryFamily = $conn->query($sqlFamily);
        while($rowFamily = $queryFamily->fetch_assoc()){
    ?>

    <tr>
        <td>
            <h5>ปีที่ <?php echo $rowFamily["family_year_no"]; ?></h5>
        </td>
        <td>
            <?php if($rowFamily['family_income_year'] == 'ต่ำกว่า 10,000 บาท'){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ต่ำกว่า 10,000 บาท
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ต่ำกว่า 10,000 บาท
                    </span>
                </h5>

            <?php } ?>
        </td>
        <td>
            <?php if($rowFamily['family_income_year'] == '10,000-30,000 บาท'){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;10,000-30,000 บาท
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;10,000-30,000 บาท
                    </span>
                </h5>

            <?php } ?>
        </td>
        <td>
            <?php if($rowFamily['family_income_year'] == 'มากกว่า 30,000 บาท'){ ?>

                <h3>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มากกว่า 30,000 บาท
                    </span>
                </h3>

            <?php }else{ ?> 

                <h5>
                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มากกว่า 30,000 บาท
                    </span>
                </h5>

            <?php } ?>
        </td>
    </tr>

    <?php } ?>

</table>


<table>
    <tr>
        <td>
            <h3>
                ข้อสังเกตเพิ่มเติม (ถ้ามี)
            </h3>
        </td>
    </tr>

    <?php
        $sqlFamily = "SELECT * FROM tbl_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
        $queryFamily = $conn->query($sqlFamily);
        while($rowFamily = $queryFamily->fetch_assoc()){
    ?>

    <tr>
        <td>
            <h5>
                ปีที่ <?php echo $rowFamily["family_year_no"]; ?>&nbsp;

                <span>
                 
                    <?php  
                        if($rowFamily["family_more_year"] != ""){

                            echo $rowFamily["family_more_year"];

                        }else{

                            echo "-";

                        }
                    ?>
                   
                </span>

            </h5>
        </td>
    </tr>

    <?php } ?>

    <tr>
        <td>
            <img src="images/6.jpg" style="width: 70%;">
        </td>
    </tr>

</table>    

<pagebreak/>

<!-- -------------------------- การเยี่ยมบ้านนักเรียน (13) --------------------------->

<table>
    <tr>
        <td style="text-align: center; padding-top: 350px;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 200px; height: 200px;">
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 10px;">
            <h6>การเยี่ยมบ้านนักเรียน</h6>
        </td>
    </tr>
</table>    

<pagebreak/>

<!-- -------------------------- บันทึกข้อมูลการเยี่ยมบ้านนักเรียน โรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี) (14) --------------------------->

<?php 
    $sqlHgen = "SELECT * FROM tbl_home_general WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHgen = $conn->query($sqlHgen);
    $rowHgen = $queryHgen->fetch_assoc();
?> 

<table>
    <tr>
        <td style="text-align: center;">
            <h2>บันทึกข้อมูลการเยี่ยมบ้านนักเรียน โรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowHgen['hgen_year_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowHgen['hgen_year']; ?></p>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ข้อมูลทั่วไปของนักเรียน</p>
        </td>
    </tr>
</table>

<div style="padding-top: 0px;"></div>

<table>
    <tr>
        <td>
            <h5>
                ชื่อ-สกุล :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_name"] != ""){

                            echo $rowHgen["hgen_name"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
        <td>
            <h5>
                ชื่อเล่น :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_nickname"] != ""){

                            echo $rowHgen["hgen_nickname"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
        <td>
            <h5>
                ชั้น :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_floor"] != ""){

                            echo $rowHgen["hgen_floor"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
        <td>
            <h5>
                เลขที่ :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_number"] != ""){

                            echo $rowHgen["hgen_number"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                เลขประจำตัวนักเรียน :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_idnumber"] != ""){

                            echo $rowHgen["hgen_idnumber"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
        <td>
            <h5>
                วัน เดือน ปี เกิด :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_birthday"] != ""){

                            echo DateThai($rowHgen["hgen_birthday"]);

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
        <td colspan="2">
            <h5>
                อายุ :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_age"] != ""){

                            echo $rowHgen["hgen_age"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
                &nbsp; ปี
            </h5>  
        </td>
    </tr>

    <tr>
        <td colspan="4">
            <h5>เพื่อนที่นักเรียนสนิท หรือเพือนนักเรียนบ้านใกล้เคียง</h5>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <h5>
                1) ชื่อ-สกุล :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_closefriend_one"] != ""){

                            echo $rowHgen["hgen_closefriend_one"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td colspan="2">
            <h5>
                ชั้น :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_closefriend_floor_one"] != ""){

                            echo $rowHgen["hgen_closefriend_floor_one"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <h5>
                2) ชื่อ-สกุล :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_closefriend_two"] != ""){

                            echo $rowHgen["hgen_closefriend_two"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td colspan="2">
            <h5>
                ชั้น :&nbsp;  
                <span>
                    <?php  
                        if($rowHgen["hgen_closefriend_floor_two"] != ""){

                            echo $rowHgen["hgen_closefriend_floor_two"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>
</table>

<div style="padding-top: 10px;"></div>

<?php  
    $sqlHfami = "SELECT * FROM tbl_home_family WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHfami = $conn->query($sqlHfami);
    $rowHfami = $queryHfami->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ข้อมูลครอบครัว</p>
        </td>
    </tr>
</table>

<div style="padding-top: 0px;"></div>

<table>
    <tr>
        <td>
            <h5>
                1. ชื่อ-สกุล บิดา :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_dad_pre"] != ""){

                            echo $rowHfami["hfamily_dad_pre"].$rowHfami["hfamily_dad_name"].' '.$rowHfami["hfamily_dad_lname"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                อายุ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_dad_age"] != ""){

                            echo $rowHfami["hfamily_dad_age"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
                &nbsp; ปี
            </h5>  
        </td>
        <td>
            <h5>
                ระดับการศึกษา :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_dad_educationlevel"] != ""){

                            echo $rowHfami["hfamily_dad_educationlevel"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                อาชีพ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_dad_career"] != ""){

                            echo $rowHfami["hfamily_dad_career"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
        <td colspan="2">
            <h5>
                สถานที่ประกอบอาชีพ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_dad_location"] != ""){

                            echo $rowHfami["hfamily_dad_location"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
    </tr>

    <?php $hfamily_dad_health = (isset($rowHfami['hfamily_dad_health']) ? $rowHfami['hfamily_dad_health'] : ''); ?>

    <tr>
        <td colspan="3">
            <h5>
                สุขภาพของบิดา

                <?php if($hfamily_dad_health == "สมบูรณ์แข็งแรง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;สมบูรณ์แข็งแรง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;สมบูรณ์แข็งแรง
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_dad_health == "มีปัญหาสุขภาพเนื่องจาก"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มีปัญหาสุขภาพเนื่องจาก :&nbsp; 

                        <?php  
                            if($rowHfami["hfamily_dad_health_note"] != ""){

                                echo $rowHfami["hfamily_dad_health_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มีปัญหาสุขภาพเนื่องจาก
                    </span>

            <?php } ?>

            </h5>  
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                2. ชื่อ-สกุล มารดา :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_mom_pre"] != ""){

                            echo $rowHfami["hfamily_mom_pre"].$rowHfami["hfamily_mom_name"].' '.$rowHfami["hfamily_mom_lname"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                อายุ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_mom_age"] != ""){

                            echo $rowHfami["hfamily_mom_age"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
                &nbsp; ปี
            </h5>  
        </td>
        <td>
            <h5>
                ระดับการศึกษา :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_mom_educationlevel"] != ""){

                            echo $rowHfami["hfamily_mom_educationlevel"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                อาชีพ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_mom_career"] != ""){

                            echo $rowHfami["hfamily_mom_career"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
        <td colspan="2">
            <h5>
                สถานที่ประกอบอาชีพ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_mom_location"] != ""){

                            echo $rowHfami["hfamily_mom_location"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>  
        </td>
    </tr>

    <?php $hfamily_mom_health = (isset($rowHfami['hfamily_mom_health']) ? $rowHfami['hfamily_mom_health'] : ''); ?>

    <tr>
        <td colspan="3">
            <h5>
                สุขภาพของบิดา

                <?php if($hfamily_mom_health == "สมบูรณ์แข็งแรง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;สมบูรณ์แข็งแรง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;สมบูรณ์แข็งแรง
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_mom_health == "มีปัญหาสุขภาพเนื่องจาก"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มีปัญหาสุขภาพเนื่องจาก :&nbsp; 

                        <?php  
                            if($rowHfami["hfamily_mom_health_note"] != ""){

                                echo $rowHfami["hfamily_mom_health_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มีปัญหาสุขภาพเนื่องจาก
                    </span>

            <?php } ?>

            </h5>  
        </td>
    </tr>

    <?php $hfamily_status_dadmom = (isset($rowHfami['hfamily_status_dadmom']) ? $rowHfami['hfamily_status_dadmom'] : ''); ?>

    <tr>
        <td colspan="3">
            <h5>
                3. สถานภาพของบิดา-มารดา

                <?php if($hfamily_status_dadmom == "อยู่ด้วยกัน"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อยู่ด้วยกัน
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อยู่ด้วยกัน 
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_status_dadmom == "แยกกันอยู่"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;แยกกันอยู่
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;แยกกันอยู่
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_status_dadmom == "หย่าร้าง"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;หย่าร้าง
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;หย่าร้าง
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_status_dadmom == "บิดาเสียชีวิต"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;บิดาเสียชีวิต
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;บิดาเสียชีวิต
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_status_dadmom == "มารดาเสียชีวิต"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มารดาเสียชีวิต
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มารดาเสียชีวิต
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_status_dadmom == "อื่นๆ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                        <?php  
                            if($rowHfami["hfamily_status_dadmom_note"] != ""){

                                echo $rowHfami["hfamily_status_dadmom_note"];

                            }else{}
                        ?>

                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อื่นๆ
                    </span>

                <?php } ?>

            </h5>  
        </td>
    </tr>

    <?php $hfamily_live = (isset($rowHfami['hfamily_live']) ? $rowHfami['hfamily_live'] : ''); ?>

    <tr>
        <td colspan="3">
            <h5>
                4. ปัจจุบันนักเรียนอาศัยอยู่กับ

                <?php if($hfamily_live == "บิดา มารดา"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;บิดา มารดา
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;บิดา มารดา 
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_live == "บิดา"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;บิดา
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;บิดา
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_live == "มารดา"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มารดา
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มารดา
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_live == "ผู้ปกครองซึ่งไม่ใช่บิดามารดา"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ผู้ปกครองซึ่งไม่ใช่บิดามารดา
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ผู้ปกครองซึ่งไม่ใช่บิดามารดา
                    </span>

                <?php } ?>

            </h5>  
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <h5>
                (กรณีไม่ได้อาศัยอยู่กับบิดา-มารดา) ผู้ปกครองชื่อ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_live_name"] != ""){

                            echo $rowHfami["hfamily_live_name"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                อายุ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_live_age"] != ""){

                            echo $rowHfami["hfamily_live_age"];

                        }else{

                            echo "-";

                        }
                    ?>
                    &nbsp; ปี
                </span>
            </h5>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                เกี่ยวข้องเป็น :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_live_relevant"] != ""){

                            echo $rowHfami["hfamily_live_relevant"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                ระดับการศึกษา :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_live_educationlevel"] != ""){

                            echo $rowHfami["hfamily_live_educationlevel"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                อาชีพ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_live_career"] != ""){

                            echo $rowHfami["hfamily_live_career"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
        <td>
            <h5>
                สถานที่ประกอบอาชีพ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_live_location"] != ""){

                            echo $rowHfami["hfamily_live_location"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>

    <?php $hfamily_live_health = (isset($rowHfami['hfamily_live_health']) ? $rowHfami['hfamily_live_health'] : ''); ?>

    <tr>
        <td colspan="4">
            <h5>
                สุขภาพของผู้ปกครอง

                <?php if($hfamily_live_health == "สมบูรณ์แข็งแรง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;สมบูรณ์แข็งแรง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;สมบูรณ์แข็งแรง
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfamily_live_health == "มีปัญหาสุขภาพเนื่องจาก"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มีปัญหาสุขภาพเนื่องจาก :&nbsp; 

                        <?php  
                            if($rowHfami["hfamily_live_health_note"] != ""){

                                echo $rowHfami["hfamily_live_health_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มีปัญหาสุขภาพเนื่องจาก
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td colspan="4">
            <h5>
                สาเหตุที่ต้องอาศัยอยู่กับผู้ปกครองซึ่งไม่ใช่บิดา-มารดา เพราะ :&nbsp;  
                <span>
                    <?php  
                        if($rowHfami["hfamily_live_cause"] != ""){

                            echo $rowHfami["hfamily_live_cause"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
            </h5>
        </td>
    </tr>

    <tr>
        <td colspan="4">
             
        </td>
    </tr>
</table>

<?php
    $sqlHfaeco = "SELECT * FROM tbl_home_family_economy WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHfaeco = $conn->query($sqlHfaeco);
    $rowHfaeco = $queryHfaeco->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลสภาพเศรษฐกิจของครอบครัว</p>
        </td>
    </tr>
</table>

<div style="padding-top: 0px;"></div>

<table> 
    <tr>
        <td>
            <h5>
                6. สมาชิกที่อยู่ร่วมกันในครอบครัว (นอกจากบิดา-มารดาหรือผู้ปกครอง ตามข้อ 4 และนักเรียน) จำนวน&nbsp;
                <span>
                    <?php  
                        if($rowHfaeco["hfaeco_amount"] != ""){

                            echo $rowHfaeco["hfaeco_amount"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
                &nbsp; คน
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                ประกอบอาชีพแล้ว จำนวน&nbsp;
                <span>
                    <?php  
                        if($rowHfaeco["hfaeco_career"] != ""){

                            echo $rowHfaeco["hfaeco_career"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
                &nbsp; คน &nbsp;

                ยังไม่ประกอบอาชีพแล้ว จำนวน&nbsp;
                <span>
                    <?php  
                        if($rowHfaeco["hfaeco_careernot"] != ""){

                            echo $rowHfaeco["hfaeco_careernot"];

                        }else{

                            echo "-";

                        }
                    ?>
                </span>
                &nbsp; คน ดังนี้
            </h5>
        </td>
    </tr>
</table>

<table>

    <?php
        $sqlHfaecoPers = "SELECT * FROM tbl_home_family_ecoperson WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
        $queryHfaecoPers = $conn->query($sqlHfaecoPers);

        if(mysqli_num_rows($queryHfaecoPers) < 1){ ?>

            <tr>
                <td colspan="4"></td>
            </tr>

    <?php }else{

        $i_Pers = 0;
        while($row_HfaecoPers = $queryHfaecoPers->fetch_assoc()){ $i_Pers++;

    ?>

    <tr>
        <td>
            <h5>
                <?php  
                    if($row_HfaecoPers["hfaecoper_name"] != ""){

                        echo '6.'.$i_Pers.' ชื่อ-สกุล&nbsp; <span>'.$row_HfaecoPers["hfaecoper_name"].'</span>';

                    }else{

                        echo '6.'.$i_Pers.' ชื่อ-สกุล&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($row_HfaecoPers["hfaecoper_age"] != ""){

                        echo 'อายุ&nbsp; <span>'.$row_HfaecoPers["hfaecoper_age"].'</span> ปี';

                    }else{

                        echo 'อายุ&nbsp; <span>-</span> ปี';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($row_HfaecoPers["hfaecoper_relevant"] != ""){

                        echo 'เกี่ยวข้องเป็น&nbsp; <span>'.$row_HfaecoPers["hfaecoper_relevant"].'</span>';

                    }else{

                        echo 'เกี่ยวข้องเป็น&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

    <tr>
        <td colspan="3">

            <?php $hfaecoper_status = (isset($row_HfaecoPers['hfaecoper_status']) ? $row_HfaecoPers['hfaecoper_status'] : ''); ?>

            <h5>
            <?php if($hfaecoper_status == "กำลังศึกษา"){ ?>

                <span style="font-weight: bold;">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                        <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                        <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                    </svg>
                    &nbsp;กำลังศึกษา
                </span>

            <?php }else{ ?> 

                <span>
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                        <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                    </svg>
                    &nbsp;กำลังศึกษา
                </span>

            <?php } ?>

            &nbsp;&nbsp;

            <?php if($hfaecoper_status == "ประกอบอาชีพ"){ ?>

                <span style="font-weight: bold;">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                        <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                        <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                    </svg>
                    &nbsp;ประกอบอาชีพ &nbsp; 

                    <?php  
                        if($row_HfaecoPers["hfaecoper_status_note"] != ""){

                            echo $row_HfaecoPers["hfaecoper_status_note"];

                        }else{}
                    ?>

                </span>

            <?php }else{ ?> 

                <span>
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                        <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                    </svg>
                    &nbsp;ประกอบอาชีพ
                </span>

            <?php } ?>

            &nbsp;&nbsp;

            <?php if($hfaecoper_status == "ไม่ได้ประกอบอาชีพ"){ ?>

                <span style="font-weight: bold;">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                        <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                        <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                    </svg>
                    &nbsp;กำลังศึกษา
                </span>

            <?php }else{ ?> 

                <span>
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                        <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                    </svg>
                    &nbsp;กำลังศึกษา
                </span>

            <?php } ?>
            </h5>

        </td>
    </tr>

    <?php }} ?>

</table>

<table>
    <tr>
        <td colspan="3">
            <h5>7. รายได้เฉลี่ยของครอบครัวต่อเดือน (รายได้ของพ่อแม่หรือผู้ปกครอง และบุคคลอื่นในครอบครัวรวมกัน)</h5>
        </td>
    </tr>

    <?php $hfaeco_income = (isset($rowHfaeco['hfaeco_income']) ? $rowHfaeco['hfaeco_income'] : ''); ?>

    <tr>
        <td>
            <h5>
                <?php if($hfaeco_income == "ต่ำกว่า 5,000 บาท"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ต่ำกว่า 5,000 บาท
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ต่ำกว่า 5,000 บาท
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php if($hfaeco_income == "5,000 - 10,000 บาท"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;5,000 - 10,000 บาท
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;5,000 - 10,000 บาท
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php if($hfaeco_income == "10,001 - 20,000 บาท"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;10,001 - 20,000 บาท
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;10,001 - 20,000 บาท
                    </span>

                <?php } ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($hfaeco_income == "20,001 - 30,000 บาท"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;20,001 - 30,000 บาท
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;20,001 - 30,000 บาท
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td colspan="2">
            <h5>
                <?php if($hfaeco_income == "30,000 บาท ขึ้นไป"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;30,000 บาท ขึ้นไป
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;30,000 บาท ขึ้นไป
                    </span>

                <?php } ?>
            </h5>
        </td>
    </tr>

    <tr>
        <td colspan="3">
            <h5>
                8. รายได้ของครอบครัว เมื่อเปรียบเทียบกับรายจ่ายในแต่ละเดือน

                <?php $hfaeco_expenses = (isset($rowHfaeco['hfaeco_expenses']) ? $rowHfaeco['hfaeco_expenses'] : ''); ?>

                <?php if($hfaeco_expenses == "เพียงพอ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เพียงพอ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เพียงพอ
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hfaeco_expenses == "ไม่เพียงพอ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ไม่เพียงพอ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ไม่เพียงพอ
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td colspan="3">
            <h5>
                <?php  
                    if($rowHfaeco["hfaeco_regular"] != ""){

                        echo 'รายจ่ายประจำของครอบครัวในแต่ละเดือน เช่น&nbsp; <span>'.$rowHfaeco["hfaeco_regular"].'</span>';

                    }else{

                        echo 'รายจ่ายประจำของครอบครัวในแต่ละเดือน เช่น&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

</table>

<pagebreak/>

<!-- -------------------------- บันทึกข้อมูลการเยี่ยมบ้านนักเรียน โรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี) (15) --------------------------->

<?php 
    $sqlHaddre = "SELECT * FROM tbl_home_address WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHaddre = $conn->query($sqlHaddre);
    $rowHaddre = $queryHaddre->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลที่อยู่อาศัย</p>
        </td>
    </tr>
</table>

<div style="padding-top: 0px;"></div>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHaddre["haddre_housenumber"] != ""){

                        echo '9. ปัจจุบันนักเรียนอาศัยอยู่ บ้านเลขที่&nbsp; <span>'.$rowHaddre["haddre_housenumber"].'</span>';

                    }else{

                        echo '9. ปัจจุบันนักเรียนอาศัยอยู่ บ้านเลขที่&nbsp; <span>-</span>';

                    }
                ?>
                &nbsp;&nbsp;
                <?php  
                    if($rowHaddre["haddre_soi"] != ""){

                        echo 'ซอย&nbsp; <span>'.$rowHaddre["haddre_soi"].'</span>';

                    }else{

                        echo 'ซอย&nbsp; <span>-</span>';

                    }
                ?>
                &nbsp;&nbsp;
                <?php  
                    if($rowHaddre["haddre_road"] != ""){

                        echo 'ถนน&nbsp; <span>'.$rowHaddre["haddre_road"].'</span>';

                    }else{

                        echo 'ถนน&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHaddre["haddre_village"] != ""){

                        echo 'หมู่บ้าน&nbsp; <span>'.$rowHaddre["haddre_village"].'</span>';

                    }else{

                        echo 'หมู่บ้าน&nbsp; <span>-</span>';

                    }
                ?>
                &nbsp;&nbsp;
                <?php  
                    if($rowHaddre["haddre_moo"] != ""){

                        echo 'หมู่ที่&nbsp; <span>'.$rowHaddre["haddre_moo"].'</span>';

                    }else{

                        echo 'หมู่ที่&nbsp; <span>-</span>';

                    }
                ?>
                &nbsp;&nbsp;
                <?php  
                    if($rowHaddre["haddre_subdistricts"] != ""){

                        echo 'ตำบล&nbsp; <span>'.$rowHaddre["haddre_subdistricts"].'</span>';

                    }else{

                        echo 'ตำบล&nbsp; <span>-</span>';

                    }
                ?>
                &nbsp;&nbsp;
                <?php  
                    if($rowHaddre["haddre_district"] != ""){

                        echo 'อำเภอ&nbsp; <span>'.$rowHaddre["haddre_district"].'</span>';

                    }else{

                        echo 'อำเภอ&nbsp; <span>-</span>';

                    }
                ?>
                &nbsp;&nbsp;
                <?php  
                    if($rowHaddre["haddre_province"] != ""){

                        echo 'จังหวัด&nbsp; <span>'.$rowHaddre["haddre_province"].'</span>';

                    }else{

                        echo 'จังหวัด&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>10. ลักษณะบ้านที่อยู่อาศัย</h5>
        </td>

        <?php $haddre_home = (isset($rowHaddre['haddre_home']) ? $rowHaddre['haddre_home'] : ''); ?>

        <td>
            <h5>
                <?php if($haddre_home == "บ้านเดียว"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;บ้านเดียว
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;บ้านเดียว
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php if($haddre_home == "ห้องแถว"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ห้องแถว
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ห้องแถว
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php if($haddre_home == "ทาวน์เฮาส์"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ทาวน์เฮาส์
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ทาวน์เฮาส์
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php if($haddre_home == "อาคารพาณิชย์"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อาคารพาณิชย์
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อาคารพาณิชย์
                    </span>

                <?php } ?>
            </h5>
        </td>
    </tr>

    <tr>
        <td></td>
        <td>
            <h5>
                <?php if($haddre_home == "ห้องพักอาคารชุด"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ห้องพักอาคารชุด
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ห้องพักอาคารชุด
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td colspan="3">
            <h5>

                <?php if($haddre_home == "อื่นๆ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                        <?php  
                            if($rowHaddre["haddre_home_note"] != ""){

                                echo $rowHaddre["haddre_home_note"];

                            }else{}
                        ?>

                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อื่นๆ
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>

            <?php $haddre_rights = (isset($rowHaddre['haddre_rights']) ? $rowHaddre['haddre_rights'] : ''); ?>

            <h5>
                11. สิทธิในการอาศัย &nbsp;

                <?php if($haddre_rights == "บ้านตนเอง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;บ้านตนเอง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;บ้านตนเอง
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($haddre_rights == "บ้านเช่า"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;บ้านเช่า
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;บ้านเช่า
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($haddre_rights == "อาศัยอยู่กับผู้อื่น"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;อาศัยอยู่กับผู้อื่น
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;อาศัยอยู่กับผู้อื่น
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($haddre_rights == "อื่นๆ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                        <?php  
                            if($rowHaddre["haddre_rights_note"] != ""){

                                echo $rowHaddre["haddre_rights_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อื่นๆ
                    </span>

            <?php } ?>

            </h5> 
        </td>
    </tr>

    <tr>
        <td>

            <?php $haddre_condition = (isset($rowHaddre['haddre_condition']) ? $rowHaddre['haddre_condition'] : ''); ?>

            <h5>
                12. สภาพบ้านที่อยู่อาศัย &nbsp;

                <?php if($haddre_condition == "มั่นคง แข็งแรง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;มั่นคง แข็งแรง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;มั่นคง แข็งแรง
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($haddre_condition == "ชำรุด ทรุดโทรม"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ชำรุด ทรุดโทรม
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ชำรุด ทรุดโทรม
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($haddre_condition == "อื่นๆ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                        <?php  
                            if($rowHaddre["haddre_condition_note"] != ""){

                                echo $rowHaddre["haddre_condition_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อื่นๆ
                    </span>

            <?php } ?>

            </h5> 
        </td>
    </tr>

    <tr>
        <td>

            <?php $haddre_roomtype = (isset($rowHaddre['haddre_roomtype']) ? $rowHaddre['haddre_roomtype'] : ''); ?>

            <h5>
                13. ลักษณะห้องพักของนักเรียน &nbsp;

                <?php if($haddre_roomtype == "เป็นห้องส่วนตัว"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;เป็นห้องส่วนตัว
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;เป็นห้องส่วนตัว
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($haddre_roomtype == "พักรวมกับบุคคลอื่น"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;พักรวมกับบุคคลอื่น
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;พักรวมกับบุคคลอื่น
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($haddre_roomtype == "อื่นๆ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                        <?php  
                            if($rowHaddre["haddre_roomtype_note"] != ""){

                                echo $rowHaddre["haddre_roomtype_note"];

                            }else{}
                        ?>

                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อื่นๆ
                    </span>

                <?php } ?>

            </h5> 
        </td>
    </tr>
</table>

<table>
    <tr>
        <td colspan="3">
            <h5>14. สภาพแวดล้อมรอบบ้าน (เลือกได้มากกว่า 1 ข้อ ตามสภาพจริง)</h5>
        </td>
    </tr>

    <?php 
        $sqlhaddreenv = "SELECT * FROM tbl_home_address_environment WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
        $queryhaddreenv = $conn->query($sqlhaddreenv);
        $rowhaddreenv = $queryhaddreenv->fetch_assoc();

        $a = $rowhaddreenv['haddreenv_list'];
        $b = explode(",", "$a");
        //print_r($b);
    ?>

    <tr>
        <td>
            <h5>
                <?php if(in_array("เป็นวิถีชุมชนชนบท", $b)){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เป็นวิถีชุมชนชนบท
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เป็นวิถีชุมชนชนบท
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php if(in_array("เป็นวิถีชุมชนเมือง", $b)){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เป็นวิถีชุมชนเมือง
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เป็นวิถีชุมชนเมือง
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php if(in_array("เป็นวิถีชุมชนกึ่งเมืองกึ่งชนบท", $b)){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เป็นวิถีชุมชนกึ่งเมืองกึ่งชนบท
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เป็นวิถีชุมชนกึ่งเมืองกึ่งชนบท
                    </span>

                <?php } ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if(in_array("เป็นชุมชนที่มีความปลอดภัย", $b)){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เป็นชุมชนที่มีความปลอดภัย
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เป็นชุมชนที่มีความปลอดภัย
                    </span>

                <?php } ?>
            </h5>
        </td>
        <td colspan="2">
            <h5>
                <?php if(in_array("เป็นชุมชนแออัด/เสื่อมโทรม", $b)){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เป็นชุมชนแออัด/เสื่อมโทรม
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เป็นชุมชนแออัด/เสื่อมโทรม
                    </span>

                <?php } ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td colspan="3">
            <h5>
                <?php  
                    if($rowhaddreenv["haddreenv_more"] != ""){

                        echo 'กรณีเสี่ยง/ไม่ปลอดภัย ในเรื่อง :&nbsp; <span>'.$rowhaddreenv["haddreenv_more"].' </span>';

                    }else{

                        echo 'กรณีเสี่ยง/ไม่ปลอดภัย ในเรื่อง :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<?php 
    $sqlHbeh = "SELECT * FROM tbl_home_behavior WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHbeh = $conn->query($sqlHbeh);
    $rowHbeh = $queryHbeh->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลพฤติกรรมของนักเรียนที่บ้าน</p>
        </td>
    </tr>
</table>

<div style="padding-top: 0px;"></div>

<table>
    <tr>
        <td>
            <h5>
                15. ความสัมพันธ์ของนักเรียนกับบุคคลในครอบครัว &nbsp; 

                <?php $hbeh_relationship = (isset($rowHbeh['hbeh_relationship']) ? $rowHbeh['hbeh_relationship'] : ''); ?>

                <?php if($hbeh_relationship == "ใกล้ชิดอบอุ่นดี"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ใกล้ชิดอบอุ่นดี
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ใกล้ชิดอบอุ่นดี
                        </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_relationship == "ห่างเหิน/เก็บตัว/แปลกแยก"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ห่างเหิน/เก็บตัว/แปลกแยก
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ห่างเหิน/เก็บตัว/แปลกแยก
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
            <?php if($hbeh_relationship == "อื่นๆ"){ ?>

                <span style="font-weight: bold;">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                      <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                      <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                    </svg>
                    &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                    <?php  
                        if($rowHbeh["hbeh_relationship_other"] != ""){

                            echo $rowHbeh["hbeh_relationship_other"];

                        }else{}
                    ?>

                </span>

            <?php }else{ ?> 

                <span>
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                      <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                    </svg>
                    &nbsp;อื่นๆ
                </span>

            <?php } ?>
            </h5>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                16. การทำการบ้าน/อ่านหนังสือ &nbsp; 

                <?php $hbeh_homework = (isset($rowHbeh['hbeh_homework']) ? $rowHbeh['hbeh_homework'] : ''); ?>

                <?php if($hbeh_homework == "ทำเองสม่ำเสมอ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ทำเองสม่ำเสมอ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ทำเองสม่ำเสมอ
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_homework == "ตักเตือนจึงทำ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ตักเตือนจึงทำ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ตักเตือนจึงทำ
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_homework == "ทำบ้างนานๆ ครั้ง"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ทำบ้างนานๆ ครั้ง
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ทำบ้างนานๆ ครั้ง
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_homework == "ไม่ทำเลย"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ไม่ทำเลย
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ไม่ทำเลย
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                17. การช่วยเหลืองานที่บ้าน &nbsp; 

                <?php $hbeh_helpwork = (isset($rowHbeh['hbeh_helpwork']) ? $rowHbeh['hbeh_helpwork'] : ''); ?>

                <?php if($hbeh_helpwork == "ช่วยเหลืองานดี"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ช่วยเหลืองานดี
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ช่วยเหลืองานดี
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_helpwork == "ต้องตักเตือน/มอบหมายจึงทำ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ต้องตักเตือน/มอบหมายจึงทำ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ต้องตักเตือน/มอบหมายจึงทำ
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_helpwork == "ไม่มีความรับผิดชอบ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ไม่มีความรับผิดชอบ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ไม่มีความรับผิดชอบ
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                หน้าที่ประจำในบ้านที่ได้รับมอบหมาย &nbsp; 

                <?php $hbeh_duty = (isset($rowHbeh['hbeh_duty']) ? $rowHbeh['hbeh_duty'] : ''); ?>

                <?php if($hbeh_duty == "ไม่มี"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ไม่มี
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ไม่มี
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_duty == "มี"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มี (ระบุ) :&nbsp; 

                        <?php  
                            if($rowHbeh["hbeh_duty_note"] != ""){

                                echo $rowHbeh["hbeh_duty_note"];

                            }else{}
                        ?>

                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มี
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                18. การใช้เวลาว่างของนักเรียนที่บ้าน &nbsp; 

                <?php $hbeh_sparetime = (isset($rowHbeh['hbeh_sparetime']) ? $rowHbeh['hbeh_sparetime'] : ''); ?>

                <?php if($hbeh_sparetime == "อ่านหนังสือ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อ่านหนังสือ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อ่านหนังสือ
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_sparetime == "เล่นกีฬา"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เล่นกีฬา
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เล่นกีฬา
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_sparetime == "ดูโทรทัศน์"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ดูโทรทัศน์
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ดูโทรทัศน์
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_sparetime == "เล่นเกมส์"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เล่นเกมส์
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เล่นเกมส์
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($hbeh_sparetime == "ปลูกต้นไม้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ปลูกต้นไม้
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ปลูกต้นไม้
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_sparetime == "เที่ยวนอกบ้าน"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เที่ยวนอกบ้าน
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เที่ยวนอกบ้าน
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_sparetime == "อื่นๆ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                        <?php  
                            if($hbeh_duty["hbeh_sparetime_note"] != ""){

                                echo $hbeh_duty["hbeh_sparetime_note"];

                            }else{}
                        ?>

                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อื่นๆ
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                19. การหารายได้ระหว่างเรียน &nbsp; 

                <?php $hbeh_earning = (isset($rowHbeh['hbeh_earning']) ? $rowHbeh['hbeh_earning'] : ''); ?>

                <?php if($hbeh_earning == "ไม่มี"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ไม่มี
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ไม่มี
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_earning == "มี"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;มี (ระบุงาน , ช่วงเวลา) :&nbsp; 

                        <?php  
                            if($rowHbeh["hbeh_earning_note"] != ""){

                                echo $rowHbeh["hbeh_earning_note"];

                            }else{}
                        ?>

                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;มี
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                20. การนอนของนักเรียน &nbsp;&nbsp; เข้านอน &nbsp;

                <?php $hbeh_sleep = (isset($rowHbeh['hbeh_sleep']) ? $rowHbeh['hbeh_sleep'] : ''); ?>

                <?php if($hbeh_sleep == "ก่อนเวลา 22.00 น."){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ก่อนเวลา 22.00 น.
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ก่อนเวลา 22.00 น.
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_sleep == "หลังเวลา 22.00 น."){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;หลังเวลา 22.00 น.
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;หลังเวลา 22.00 น.
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                &nbsp; &nbsp; ตื่นนอน &nbsp;

                <?php $hbeh_wakeup = (isset($rowHbeh['hbeh_wakeup']) ? $rowHbeh['hbeh_wakeup'] : ''); ?>

                <?php if($hbeh_wakeup == "ก่อนเวลา 06.00 น."){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ก่อนเวลา 06.00 น.
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ก่อนเวลา 06.00 น.
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_wakeup == "หลังเวลา 06.00 น."){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;หลังเวลา 06.00 น.
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;หลังเวลา 06.00 น.
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hbeh_wakeup == "ตื่นสายหลัง 07.00 น. เป็นประจำ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ตื่นสายหลัง 07.00 น. เป็นประจำ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ตื่นสายหลัง 07.00 น. เป็นประจำ
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHbeh["hbeh_talent"] != ""){

                        echo '21. ความสามารถพิเศษ หรือ สิ่งที่นักเรียนสนใจ :&nbsp; <span>'.$rowHbeh["hbeh_talent"].'</span>';

                    }else{

                        echo '21. ความสามารถพิเศษ หรือ สิ่งที่นักเรียนสนใจ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHbeh["hbeh_healthproblems"] != ""){

                        echo '22. ปัญหาสุขภาพ หรือปัญหาที่ต้องดูแลเป็นพิเศษ :&nbsp; <span>'.$rowHbeh["hbeh_healthproblems"].'</span>';

                    }else{

                        echo '22. ปัญหาสุขภาพ หรือปัญหาที่ต้องดูแลเป็นพิเศษ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<?php 
    $sqlHcsc = "SELECT * FROM tbl_home_cometoschool WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHcsc = $conn->query($sqlHcsc);
    $rowHcsc = $queryHcsc->fetch_assoc();

    $sqlHmore = "SELECT * FROM tbl_home_more WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHmore = $conn->query($sqlHmore);
    $rowHmore = $queryHmore->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลการมาโรงเรียนของนักเรียน</p>
        </td>
    </tr>
</table>

<div style="padding-top: 0px;"></div>

<table>
    <tr>
        <td>
            <h5>
                23. การมาโรงเรียน &nbsp; 

                <?php $hcsc_cometoschool = (isset($rowHcsc['hcsc_cometoschool']) ? $rowHcsc['hcsc_cometoschool'] : ''); ?>

                <?php if($hcsc_cometoschool == "ผู้ปกครองรับส่ง"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ผู้ปกครองรับส่ง
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ผู้ปกครองรับส่ง
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hcsc_cometoschool == "รถประจำรับส่ง"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;รถประจำรับส่ง
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;รถประจำรับส่ง
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hcsc_cometoschool == "รถรับจ้าง"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;รถรับจ้าง
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;รถรับจ้าง
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hcsc_cometoschool == "เดินเท้า"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เดินเท้า
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เดินเท้า
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hcsc_cometoschool == "อื่นๆ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                        <?php  
                            if($rowHcsc["hcsc_cometoschool_other"] != ""){

                                echo $rowHcsc["hcsc_cometoschool_other"];

                            }else{}
                        ?>

                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อื่นๆ
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                24. การกลับบ้านหลังเลิกเรียน &nbsp; 

                <?php $hcsc_gohome = (isset($rowHcsc['hcsc_gohome']) ? $rowHcsc['hcsc_gohome'] : ''); ?>

                <?php if($hcsc_gohome == "เลิกเรียนแล้วกลับบ้านเลย"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เลิกเรียนแล้วกลับบ้านเลย
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เลิกเรียนแล้วกลับบ้านเลย
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hcsc_gohome == "เลิกเรียนแล้วกลับบ้านใกล้ค่ำเป็นประจำ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เลิกเรียนแล้วกลับบ้านใกล้ค่ำเป็นประจำ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เลิกเรียนแล้วกลับบ้านใกล้ค่ำเป็นประจำ
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($hcsc_gohome == "เลิกเรียนแล้วไปเที่ยวแตร่กับเพื่อนกลับบ้านมืดค่ำเสมอ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;เลิกเรียนแล้วไปเที่ยวแตร่กับเพื่อนกลับบ้านมืดค่ำเสมอ
                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;เลิกเรียนแล้วไปเที่ยวแตร่กับเพื่อนกลับบ้านมืดค่ำเสมอ
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hcsc_gohome == "อื่นๆ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;อื่นๆ (ระบุ) :&nbsp; 

                        <?php  
                            if($rowHcsc["hcsc_gohome_other"] != ""){

                                echo $rowHcsc["hcsc_gohome_other"];

                            }else{}
                        ?>

                    </span>

                <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;อื่นๆ
                    </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHcsc["hcsc_money"] != ""){

                        echo '25. นักเรียนได้รับเงินมาโรงเรียนวันละ :&nbsp; <span>'.$rowHcsc["hcsc_money"].' </span> บาท';

                    }else{

                        echo '25. นักเรียนได้รับเงินมาโรงเรียนวันละ :&nbsp; <span>-</span> บาท';

                    }
                ?>
                &nbsp;&nbsp;
                <?php  
                    if($rowHcsc["hcsc_pay"] != ""){

                        echo 'จ่ายเป็นค่า&nbsp; <span>'.$rowHcsc["hcsc_pay"].'</span>';

                    }else{

                        echo 'จ่ายเป็นค่า&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลเพิ่มเติมจากการเยี่ยมบ้าน</p>
        </td>
    </tr>
</table>

<div style="padding-top: 0px;"></div>

<table>
    <tr>
        <td colspan="2">
            <h5>
                <?php  
                    if($rowHmore["hmore_offer"] != ""){

                        echo '26. ข้อเสนอแนะของผู้ปกครอง (ถ้ามี) :&nbsp; <span>'.$rowHmore["hmore_offer"].'</span>';

                    }else{

                        echo '26. ข้อเสนอแนะของผู้ปกครอง (ถ้ามี) :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <h5>
                <?php  
                    if($rowHmore["hmore_more"] != ""){

                        echo '27. บันทึกเพิ่มเติม (ถ้ามี) :&nbsp; <span>'.$rowHmore["hmore_more"].'</span>';

                    }else{

                        echo '27. บันทึกเพิ่มเติม (ถ้ามี) :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td style="width: 50%; padding-top: 10px; text-align: center;">
            <h5>
            <?php  
                if($rowHmore["parent_name"] != ""){

                    echo 'ลงชื่อ&nbsp; <span>'.$rowHmore["parent_name"].'</span> &nbsp;ผู้ปกครองนักเรียน
                    <div style="margin-top: 10px;"></div> (....................................................)';

                }else{

                    echo 'ลงชื่อ&nbsp; <span>-</span> &nbsp;ผู้ปกครองนักเรียน
                    <div style="margin-top: 10px;"></div> (....................................................)';

                }
            ?>
            <div style="margin-top: 10px;"></div>
            <?php  
                if($rowHmore["parent_date"] != ""){

                    echo '<span>วันที่ '.DateThai($rowHmore["parent_date"]).'</span>';

                }else{

                    echo 'วัน เดิอน พ.ศ.&nbsp; <span>-</span>';

                }
            ?>
            </h5>
        </td>
        <td style="width: 50%; padding-top: 10px; text-align: center;">
            <h5>   
            <?php  
                if($rowHmore["teacher_name"] != ""){

                    echo 'ลงชื่อ&nbsp; <span>'.$rowHmore["teacher_name"].'</span> &nbsp;ชื่อครูที่เยี่ยมบ้าน
                    <div style="margin-top: 10px;"></div> (....................................................)';

                }else{

                    echo 'ลงชื่อ&nbsp; <span>-</span> &nbsp;ชื่อครูที่เยี่ยมบ้าน
                    <div style="margin-top: 10px;"></div> (....................................................)';

                }
            ?>
            <div style="margin-top: 10px;"></div>
            <?php  
                if($rowHmore["teacher_date"] != ""){

                    echo '<span>วันที่ '.DateThai($rowHmore["teacher_date"]).'</span>';

                }else{

                    echo 'วัน เดิอน พ.ศ.&nbsp; <span>-</span>';

                }
            ?>
            </h5>
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- การเยี่ยมบ้านนักเรียน (16) --------------------------->

<?php 
    $sqlHresult = "SELECT * FROM tbl_home_result WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHresult = $conn->query($sqlHresult);
    $rowHresult = $queryHresult->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <h2>รายงานสรุปผลการเยี่ยมบ้านนักเรียนโรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowHresult['hresult_year_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowHresult['hresult_year']; ?></p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_name"] != ""){

                        echo 'ชื่อ-สกุล นักเรียน :&nbsp; <span>'.$rowHresult["hresult_name"].'</span>';

                    }else{

                        echo 'ชื่อ-สกุล นักเรียน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_idnumber"] != ""){

                        echo 'เลขประจำตัว :&nbsp; <span>'.$rowHresult["hresult_idnumber"].'</span>';

                    }else{

                        echo 'เลขประจำตัว :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_floor"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowHresult["hresult_floor"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_number"] != ""){

                        echo 'เลขที่ :&nbsp; <span>'.$rowHresult["hresult_number"].'</span>';

                    }else{

                        echo 'เลขที่ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_teacher"] != ""){

                        echo 'ชื่อครูที่เยี่ยมบ้าน :&nbsp; <span>'.$rowHresult["hresult_teacher"].'</span>';

                    }else{

                        echo 'ชื่อครูที่เยี่ยมบ้าน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td colspan="2">
            <h5>
                <?php  
                    if($rowHresult["hresult_homevisit_date"] != ""){

                        echo 'วัน/เดือน/ปี ที่เยี่ยมบ้าน :&nbsp; <span>'.$rowHresult["hresult_homevisit_date"].'</span>';

                    }else{

                        echo 'วัน/เดือน/ปี ที่เยี่ยมบ้าน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_homevisit_time"] != ""){

                        echo 'เวลา :&nbsp; <span>'.$rowHresult["hresult_homevisit_time"].'</span>';

                    }else{

                        echo 'เวลา :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ผลการเยี่ยมบ้าน</p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <th width="5%"><h3>ที่</h3></th>
        <th width="45%"><h3>รายการ</h3></th>
        <th width="10%"><h3>ดีมาก</h3></th>
        <th width="10%"><h3>ดี</h3></th>
        <th width="10%"><h3>ปานกลาง</h3></th>
        <th width="10%"><h3>พอใช้</h3></th>
        <th width="10%"><h3>ไม่ดี</h3></th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>1</h5></th>
        <th style="text-align: left;"><h5>ความสัมพันธ์ของบุคคลในครอบครัว</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_one'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';  

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_one'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_one'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_one'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_one'] == 'ไม่ดี'){ 

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>2</h5></th>
        <th style="text-align: left;"><h5>สภาพทางเศรษฐกิจ/รายได้ของครอบครัว</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_two'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_two'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_two'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_two'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_two'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>3</h5></th>
        <th style="text-align: left;"><h5>สภาพบ้านเรือนที่นักเรียนอยู่อาศัย</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_three'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_three'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_three'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_three'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_three'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>4</h5></th>
        <th style="text-align: left;"><h5>สภาพแวดล้อมในชุมชนรอบๆ บ้านนักเรียน</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_four'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_four'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_four'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_four'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_four'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>5</h5></th>
        <th style="text-align: left;"><h5>พฤติกรรมของนักเรียนที่บ้าน</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_five'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_five'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_five'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_five'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowHresult['hresult_list_five'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
    </tr>
</table>

<div style="margin-top: 10px;"></div>

<table>
    <tr>
        <td>
            <h3>
                บรรยากาศการเยี่ยมบ้าน &nbsp;

                <?php $hresult_atmosphere = (isset($rowHresult['hresult_atmosphere']) ? $rowHresult['hresult_atmosphere'] : ''); ?>

                <?php if($hresult_atmosphere == "ผู้ปกครองให้ความร่วมมือดี"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ผู้ปกครองให้ความร่วมมือดี
                    </span>

                <?php }else{ ?> 

                    <span style="font-weight: normal;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ผู้ปกครองให้ความร่วมมือดี
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($hresult_atmosphere == "ผู้ปกครองไม่ค่อยให้ความร่วมมือ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ผู้ปกครองไม่ค่อยให้ความร่วมมือ
                    </span>

                <?php }else{ ?> 

                    <span style="font-weight: normal;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ผู้ปกครองไม่ค่อยให้ความร่วมมือ
                    </span>

                <?php } ?>

            </h3>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h3>
                ความคิดเห็น หรือข้อเสนอแนะเพิ่มเติมของครูที่เยี่ยมบ้านนักเรียน (ถ้ามี)
            </h3>
        </td>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_promote"] != ""){

                        echo '1. นักเรียนที่ควรได้รับการส่งเสริมในเรื่อง :&nbsp; <span>'.$rowHresult["hresult_promote"].'</span>';

                    }else{

                        echo '1. นักเรียนที่ควรได้รับการส่งเสริมในเรื่อง :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_help"] != ""){

                        echo '2. นักเรียนที่ควรได้รับการช่วยเหลือในเรื่อง :&nbsp; <span>'.$rowHresult["hresult_help"].'</span>';

                    }else{

                        echo '2. นักเรียนที่ควรได้รับการช่วยเหลือในเรื่อง :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHresult["hresult_more"] != ""){

                        echo '3. ข้อเสนอแนะอื่นๆ :&nbsp; <span>'.$rowHresult["hresult_more"].'</span>';

                    }else{

                        echo '3. ข้อเสนอแนะอื่นๆ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ภาพถ่ายการเยี่ยมบ้านนักเรียน</p>
        </td>
    </tr>
    <tr>
        <td style="text-align: center;">
            
            <?php  
                if($rowHresult["hresult_pichome"] != ""){

                    echo '
                        <img src="../pic-home/'.$rowHresult["hresult_pichome"].'"
                        style="object-fit: fill; width: 600px; height: 400px;">
                    ';

                }else{

                    echo '<span>- ไม่มีภาพถ่ายการเยี่ยมบ้านนักเรียน -</span>';

                }
            ?>

        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- การเยี่ยมบ้านนักเรียน (17) --------------------------->

<?php 
    $sqlTwgen = "SELECT * FROM tbl_two_general WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryTwgen = $conn->query($sqlTwgen);
    $rowTwgen = $queryTwgen->fetch_assoc();

    $sqlHgen = "SELECT * FROM tbl_home_general WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryHgen = $conn->query($sqlHgen);
    $rowHgen = $queryHgen->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <h2>บันทึกข้อมูลการเยี่ยมบ้านนักเรียน โรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowTwgen['twgen_year_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowTwgen['twgen_year']; ?></p>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ข้อมูลทั่วไปของนักเรียน</p>
        </td>
    </tr>
</table>

<div style="padding-top: 0px;"></div>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowTwgen["twgen_name"] != ""){

                        echo 'ชื่อ-สกุล :&nbsp; <span>'.$rowTwgen["twgen_name"].'</span>';

                    }else{

                        echo 'ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowTwgen["twgen_nickname"] != ""){

                        echo 'ชื่อเล่น :&nbsp; <span>'.$rowTwgen["twgen_nickname"].'</span>';

                    }else{

                        echo 'ชื่อเล่น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowTwgen["twgen_floor"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowTwgen["twgen_floor"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowTwgen["twgen_number"] != ""){

                        echo 'เลขที่ :&nbsp; <span>'.$rowTwgen["twgen_number"].'</span>';

                    }else{

                        echo 'เลขที่ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowTwgen["twgen_age"] != ""){

                        echo 'อายุ :&nbsp; <span>'.$rowTwgen["twgen_age"].'</span> &nbsp; ปี';

                    }else{

                        echo 'อายุ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td colspan="4">
            <h3>เพื่อนที่นักเรียนสนิท หรือเพื่อนนักเรียนบ้านใกล้กัน</h3> 
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHgen["hgen_closefriend_one"] != ""){

                        echo '1) ชื่อ-สกุล :&nbsp; <span>'.$rowHgen["hgen_closefriend_one"].'</span>';

                    }else{

                        echo '1) ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5> 
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHgen["hgen_closefriend_floor_one"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowHgen["hgen_closefriend_floor_one"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5> 
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHgen["hgen_closefriend_two"] != ""){

                        echo '2) ชื่อ-สกุล :&nbsp; <span>'.$rowHgen["hgen_closefriend_two"].'</span>';

                    }else{

                        echo '2) ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5> 
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHgen["hgen_closefriend_floor_two"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowHgen["hgen_closefriend_floor_two"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5> 
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลครอบครัว</p>
        </td>
    </tr>
</table>

<?php $twgen_family = (isset($rowTwgen['twgen_family']) ? $rowTwgen['twgen_family'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_family == "ข้อมูลครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_family == "ข้อมูลครอบครัว มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลครอบครัว มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowTwgen["twgen_family_note"] != ""){

                                echo $rowTwgen["twgen_family_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลครอบครัว มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลสภาพเศรษฐกิจของครอบครัว</p>
        </td>
    </tr>
</table>

<?php $twgen_economy = (isset($rowTwgen['twgen_economy']) ? $rowTwgen['twgen_economy'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_economy == "ข้อมูลสภาพเศรษฐกิจครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลสภาพเศรษฐกิจครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลสภาพเศรษฐกิจครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_economy == "ข้อมูลสภาพเศรษฐกิจครอบครัว มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลสภาพเศรษฐกิจครอบครัว มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowTwgen["twgen_family_note"] != ""){

                                echo $rowTwgen["twgen_family_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลสภาพเศรษฐกิจครอบครัว มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลที่อยู่อาศัย</p>
        </td>
    </tr>
</table>

<?php $twgen_residence = (isset($rowTwgen['twgen_residence']) ? $rowTwgen['twgen_residence'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_residence == "ข้อมูลที่อยู่อาศัยเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลที่อยู่อาศัยเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลที่อยู่อาศัยเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_residence == "ข้อมูลที่อยู่อาศัย มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลที่อยู่อาศัย มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowTwgen["twgen_residence_note"] != ""){

                                echo $rowTwgen["twgen_residence_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลที่อยู่อาศัย มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลพฤติกรรมของนักเรียนที่บ้าน</p>
        </td>
    </tr>
</table>

<?php $twgen_behavior = (isset($rowTwgen['twgen_behavior']) ? $rowTwgen['twgen_behavior'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_behavior == "ข้อมูลพฤติกรรมของนักเรียนที่บ้าน ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลพฤติกรรมของนักเรียนที่บ้าน ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลพฤติกรรมของนักเรียนที่บ้าน ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_behavior == "ข้อมูลพฤติกรรมของนักเรียนที่บ้าน มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลพฤติกรรมของนักเรียนที่บ้าน มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowTwgen["twgen_behavior_note"] != ""){

                                echo $rowTwgen["twgen_behavior_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลพฤติกรรมของนักเรียนที่บ้าน มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลการมาโรงเรียนของนักเรียน</p>
        </td>
    </tr>
</table>

<?php $twgen_cometoschool = (isset($rowTwgen['twgen_cometoschool']) ? $rowTwgen['twgen_cometoschool'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_cometoschool == "ข้อมูลการมาโรงเรียนของนักเรียน ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลการมาโรงเรียนของนักเรียน ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลการมาโรงเรียนของนักเรียน ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_cometoschool == "ข้อมูลการมาโรงเรียนของนักเรียน มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลการมาโรงเรียนของนักเรียน มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowTwgen["twgen_cometoschool_note"] != ""){

                                echo $rowTwgen["twgen_cometoschool_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลการมาโรงเรียนของนักเรียน มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อเสนอแนะของผู้ปกครองหรือบันทึกเพิ่มเติมจากการเยี่ยมบ้าน</p>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowTwgen["twgen_suggestion"] != ""){

                        echo '<span>'.$rowTwgen["twgen_suggestion"].'</span>';

                    }else{

                        echo '<span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 10px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <h5>
               <?php  
                   if($rowTwgen["twgen_parent"] != ""){

                       echo 'ลงชื่อ&nbsp; <span>'.$rowTwgen["twgen_parent"].'</span> &nbsp;ผู้ปกครองนักเรียน <div style="margin-top: 10px;"></div> (....................................................)';

                   }else{

                       echo 'ลงชื่อ&nbsp; <span>-</span> &nbsp;ผู้ปกครองนักเรียน
                       <div style="margin-top: 10px;"></div> (....................................................)';

                   }
               ?>
               <div style="margin-top: 10px;"></div>
               <?php  
                   if($rowTwgen["twgen_parent_date"] != ""){

                       echo '<span>วันที่ '.DateThai($rowTwgen["twgen_parent_date"]).'</span>';

                   }else{

                       echo 'วัน เดิอน พ.ศ.&nbsp; <span>-</span>';

                   }
               ?> 
            </h5>
        </td>
        <td style="text-align: center;">
            <h5>
                <?php  
                    if($rowTwgen["twgen_teacher"] != ""){

                        echo 'ลงชื่อ&nbsp; <span>'.$rowTwgen["twgen_teacher"].'</span> &nbsp;ชื่อครูที่เยี่ยมบ้าน <div style="margin-top: 10px;"></div> (....................................................)';

                    }else{

                        echo 'ลงชื่อ&nbsp; <span>-</span> &nbsp;ชื่อครูที่เยี่ยมบ้าน
                        <div style="margin-top: 10px;"></div> (....................................................)';

                    }
                ?>
                <div style="margin-top: 10px;"></div>
                <?php  
                    if($rowTwgen["twgen_teacher_date"] != ""){

                        echo '<span>วันที่ '.DateThai($rowTwgen["twgen_teacher_date"]).'</span>';

                    }else{

                        echo 'วัน เดิอน พ.ศ.&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- รายงานสรุปผลการเยี่ยมบ้านนักเรียน โรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี) (18) --------------------------->

<?php 
    $sqlTresult = "SELECT * FROM tbl_two_result WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryTresult = $conn->query($sqlTresult);
    $rowTresult = $queryTresult->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <h2>รายงานสรุปผลการเยี่ยมบ้านนักเรียนโรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowTresult['tresult_year_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowTresult['tresult_year']; ?></p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_name"] != ""){

                        echo 'ชื่อ-สกุล นักเรียน :&nbsp; <span>'.$rowTresult["tresult_name"].'</span>';

                    }else{

                        echo 'ชื่อ-สกุล นักเรียน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_idnumber"] != ""){

                        echo 'เลขประจำตัว :&nbsp; <span>'.$rowTresult["tresult_idnumber"].'</span>';

                    }else{

                        echo 'เลขประจำตัว :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_floor"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowTresult["tresult_floor"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_number"] != ""){

                        echo 'เลขที่ :&nbsp; <span>'.$rowTresult["tresult_number"].'</span>';

                    }else{

                        echo 'เลขที่ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_teacher"] != ""){

                        echo 'ชื่อครูที่เยี่ยมบ้าน :&nbsp; <span>'.$rowTresult["tresult_teacher"].'</span>';

                    }else{

                        echo 'ชื่อครูที่เยี่ยมบ้าน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td colspan="2">
            <h5>
                <?php  
                    if($rowTresult["tresult_homevisit_date"] != ""){

                        echo 'วัน/เดือน/ปี ที่เยี่ยมบ้าน :&nbsp; <span>'.$rowTresult["tresult_homevisit_date"].'</span>';

                    }else{

                        echo 'วัน/เดือน/ปี ที่เยี่ยมบ้าน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_homevisit_time"] != ""){

                        echo 'เวลา :&nbsp; <span>'.$rowTresult["tresult_homevisit_time"].'</span>';

                    }else{

                        echo 'เวลา :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ผลการเยี่ยมบ้าน</p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <th width="5%"><h3>ที่</h3></th>
        <th width="45%"><h3>รายการ</h3></th>
        <th width="10%"><h3>ดีมาก</h3></th>
        <th width="10%"><h3>ดี</h3></th>
        <th width="10%"><h3>ปานกลาง</h3></th>
        <th width="10%"><h3>พอใช้</h3></th>
        <th width="10%"><h3>ไม่ดี</h3></th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>1</h5></th>
        <th style="text-align: left;"><h5>ความสัมพันธ์ของบุคคลในครอบครัว</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_one'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';  

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_one'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_one'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_one'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_one'] == 'ไม่ดี'){ 

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>2</h5></th>
        <th style="text-align: left;"><h5>สภาพทางเศรษฐกิจ/รายได้ของครอบครัว</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_two'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_two'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_two'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_two'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_two'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>3</h5></th>
        <th style="text-align: left;"><h5>สภาพบ้านเรือนที่นักเรียนอยู่อาศัย</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_three'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_three'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_three'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_three'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_three'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>4</h5></th>
        <th style="text-align: left;"><h5>สภาพแวดล้อมในชุมชนรอบๆ บ้านนักเรียน</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_four'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_four'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_four'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_four'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_four'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>5</h5></th>
        <th style="text-align: left;"><h5>พฤติกรรมของนักเรียนที่บ้าน</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_five'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_five'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_five'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_five'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowTresult['tresult_list_five'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
    </tr>
</table>

<div style="margin-top: 10px;"></div>

<table>
    <tr>
        <td>
            <h3>
                บรรยากาศการเยี่ยมบ้าน &nbsp;

                <?php $tresult_atmosphere = (isset($rowTresult['tresult_atmosphere']) ? $rowTresult['tresult_atmosphere'] : ''); ?>

                <?php if($tresult_atmosphere == "ผู้ปกครองให้ความร่วมมือดี"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ผู้ปกครองให้ความร่วมมือดี
                    </span>

                <?php }else{ ?> 

                    <span style="font-weight: normal;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ผู้ปกครองให้ความร่วมมือดี
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($tresult_atmosphere == "ผู้ปกครองไม่ค่อยให้ความร่วมมือ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ผู้ปกครองไม่ค่อยให้ความร่วมมือ
                    </span>

                <?php }else{ ?> 

                    <span style="font-weight: normal;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ผู้ปกครองไม่ค่อยให้ความร่วมมือ
                    </span>

                <?php } ?>

            </h3>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h3>
                ความคิดเห็น หรือข้อเสนอแนะเพิ่มเติมของครูที่เยี่ยมบ้านนักเรียน (ถ้ามี)
            </h3>
        </td>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_promote"] != ""){

                        echo '1. นักเรียนที่ควรได้รับการส่งเสริมในเรื่อง :&nbsp; <span>'.$rowTresult["tresult_promote"].'</span>';

                    }else{

                        echo '1. นักเรียนที่ควรได้รับการส่งเสริมในเรื่อง :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_help"] != ""){

                        echo '2. นักเรียนที่ควรได้รับการช่วยเหลือในเรื่อง :&nbsp; <span>'.$rowTresult["tresult_help"].'</span>';

                    }else{

                        echo '2. นักเรียนที่ควรได้รับการช่วยเหลือในเรื่อง :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowTresult["tresult_more"] != ""){

                        echo '3. ข้อเสนอแนะอื่นๆ :&nbsp; <span>'.$rowTresult["tresult_more"].'</span>';

                    }else{

                        echo '3. ข้อเสนอแนะอื่นๆ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ภาพถ่ายการเยี่ยมบ้านนักเรียน</p>
        </td>
    </tr>
    <tr>
        <td style="text-align: center;">
            
            <?php  
                if($rowTresult["tresult_pichome"] != ""){

                    echo '
                        <img src="../pic-home/'.$rowTresult["tresult_pichome"].'"
                        style="width: 600px; height: 400px; object-fit: cover;">
                    ';

                }else{

                    echo '<span>- ไม่มีภาพถ่ายการเยี่ยมบ้านนักเรียน -</span>';

                }
            ?>

        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- การเยี่ยมบ้านนักเรียน (19) --------------------------->

<?php 
    $sqlThwgen = "SELECT * FROM tbl_three_general WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryThwgen = $conn->query($sqlThwgen);
    $rowThwgen = $queryThwgen->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <h2>บันทึกข้อมูลการเยี่ยมบ้านนักเรียน โรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowThwgen['twgen_year_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowThwgen['twgen_year']; ?></p>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ข้อมูลทั่วไปของนักเรียน</p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowThwgen["twgen_name"] != ""){

                        echo 'ชื่อ-สกุล :&nbsp; <span>'.$rowThwgen["twgen_name"].'</span>';

                    }else{

                        echo 'ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowThwgen["twgen_nickname"] != ""){

                        echo 'ชื่อเล่น :&nbsp; <span>'.$rowThwgen["twgen_nickname"].'</span>';

                    }else{

                        echo 'ชื่อเล่น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowThwgen["twgen_floor"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowThwgen["twgen_floor"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowThwgen["twgen_number"] != ""){

                        echo 'เลขที่ :&nbsp; <span>'.$rowThwgen["twgen_number"].'</span>';

                    }else{

                        echo 'เลขที่ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowThwgen["twgen_age"] != ""){

                        echo 'อายุ :&nbsp; <span>'.$rowThwgen["twgen_age"].'</span> &nbsp; ปี';

                    }else{

                        echo 'อายุ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td colspan="4">
            <h3>เพื่อนที่นักเรียนสนิท หรือเพื่อนนักเรียนบ้านใกล้กัน</h3> 
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowHgen["hgen_closefriend_one"] != ""){

                        echo '1) ชื่อ-สกุล :&nbsp; <span>'.$rowHgen["hgen_closefriend_one"].'</span>';

                    }else{

                        echo '1) ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5> 
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHgen["hgen_closefriend_floor_one"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowHgen["hgen_closefriend_floor_one"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5> 
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHgen["hgen_closefriend_two"] != ""){

                        echo '2) ชื่อ-สกุล :&nbsp; <span>'.$rowHgen["hgen_closefriend_two"].'</span>';

                    }else{

                        echo '2) ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5> 
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHgen["hgen_closefriend_floor_two"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowHgen["hgen_closefriend_floor_two"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5> 
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลครอบครัว</p>
        </td>
    </tr>
</table>

<?php $twgen_family = (isset($rowThwgen['twgen_family']) ? $rowThwgen['twgen_family'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_family == "ข้อมูลครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_family == "ข้อมูลครอบครัว มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลครอบครัว มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowThwgen["twgen_family_note"] != ""){

                                echo $rowThwgen["twgen_family_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลครอบครัว มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลสภาพเศรษฐกิจของครอบครัว</p>
        </td>
    </tr>
</table>

<?php $twgen_economy = (isset($rowThwgen['twgen_economy']) ? $rowThwgen['twgen_economy'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_economy == "ข้อมูลสภาพเศรษฐกิจครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลสภาพเศรษฐกิจครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลสภาพเศรษฐกิจครอบครัวเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_economy == "ข้อมูลสภาพเศรษฐกิจครอบครัว มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลสภาพเศรษฐกิจครอบครัว มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowThwgen["twgen_family_note"] != ""){

                                echo $rowThwgen["twgen_family_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลสภาพเศรษฐกิจครอบครัว มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลที่อยู่อาศัย</p>
        </td>
    </tr>
</table>

<?php $twgen_residence = (isset($rowThwgen['twgen_residence']) ? $rowThwgen['twgen_residence'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_residence == "ข้อมูลที่อยู่อาศัยเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลที่อยู่อาศัยเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลที่อยู่อาศัยเหมือนปีที่ผ่านมา ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_residence == "ข้อมูลที่อยู่อาศัย มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลที่อยู่อาศัย มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowThwgen["twgen_residence_note"] != ""){

                                echo $rowThwgen["twgen_residence_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลที่อยู่อาศัย มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลพฤติกรรมของนักเรียนที่บ้าน</p>
        </td>
    </tr>
</table>

<?php $twgen_behavior = (isset($rowThwgen['twgen_behavior']) ? $rowThwgen['twgen_behavior'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_behavior == "ข้อมูลพฤติกรรมของนักเรียนที่บ้าน ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลพฤติกรรมของนักเรียนที่บ้าน ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลพฤติกรรมของนักเรียนที่บ้าน ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_behavior == "ข้อมูลพฤติกรรมของนักเรียนที่บ้าน มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลพฤติกรรมของนักเรียนที่บ้าน มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowThwgen["twgen_behavior_note"] != ""){

                                echo $rowThwgen["twgen_behavior_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลพฤติกรรมของนักเรียนที่บ้าน มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อมูลการมาโรงเรียนของนักเรียน</p>
        </td>
    </tr>
</table>

<?php $twgen_cometoschool = (isset($rowThwgen['twgen_cometoschool']) ? $rowThwgen['twgen_cometoschool'] : ''); ?>

<table>
    <tr>
        <td>
            <h5>
                <?php if($twgen_cometoschool == "ข้อมูลการมาโรงเรียนของนักเรียน ไม่มีการเปลี่ยนแปลง"){ ?>

                        <span style="font-weight: bold;">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                              <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                              <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                            </svg>
                            &nbsp;ข้อมูลการมาโรงเรียนของนักเรียน ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php }else{ ?> 

                        <span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                            </svg>
                            &nbsp;ข้อมูลการมาโรงเรียนของนักเรียน ไม่มีการเปลี่ยนแปลง
                        </span>

                <?php } ?>

            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php if($twgen_cometoschool == "ข้อมูลการมาโรงเรียนของนักเรียน มีการเปลี่ยนแปลง ดังนี้"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                          <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                          <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ข้อมูลการมาโรงเรียนของนักเรียน มีการเปลี่ยนแปลง ดังนี้ :&nbsp; 

                        <?php  
                            if($rowThwgen["twgen_cometoschool_note"] != ""){

                                echo $rowThwgen["twgen_cometoschool_note"];

                            }else{}
                        ?>

                    </span>

            <?php }else{ ?> 

                    <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                          <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ข้อมูลการมาโรงเรียนของนักเรียน มีการเปลี่ยนแปลง ดังนี้
                    </span>

            <?php } ?>

            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ข้อเสนอแนะของผู้ปกครองหรือบันทึกเพิ่มเติมจากการเยี่ยมบ้าน</p>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowThwgen["twgen_suggestion"] != ""){

                        echo '<span>'.$rowThwgen["twgen_suggestion"].'</span>';

                    }else{

                        echo '<span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 10px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <h5>
               <?php  
                   if($rowThwgen["twgen_parent"] != ""){

                       echo 'ลงชื่อ&nbsp; <span>'.$rowThwgen["twgen_parent"].'</span> &nbsp;ผู้ปกครองนักเรียน <div style="margin-top: 10px;"></div> (....................................................)';

                   }else{

                       echo 'ลงชื่อ&nbsp; <span>-</span> &nbsp;ผู้ปกครองนักเรียน
                       <div style="margin-top: 10px;"></div> (....................................................)';

                   }
               ?>
               <div style="margin-top: 10px;"></div>
               <?php  
                   if($rowThwgen["twgen_parent_date"] != ""){

                       echo '<span>วันที่ '.DateThai($rowThwgen["twgen_parent_date"]).'</span>';

                   }else{

                       echo 'วัน เดิอน พ.ศ.&nbsp; <span>-</span>';

                   }
               ?> 
            </h5>
        </td>
        <td style="text-align: center;">
            <h5>
                <?php  
                    if($rowThwgen["twgen_teacher"] != ""){

                        echo 'ลงชื่อ&nbsp; <span>'.$rowThwgen["twgen_teacher"].'</span> &nbsp;ชื่อครูที่เยี่ยมบ้าน <div style="margin-top: 10px;"></div> (....................................................)';

                    }else{

                        echo 'ลงชื่อ&nbsp; <span>-</span> &nbsp;ชื่อครูที่เยี่ยมบ้าน
                        <div style="margin-top: 10px;"></div> (....................................................)';

                    }
                ?>
                <div style="margin-top: 10px;"></div>
                <?php  
                    if($rowThwgen["twgen_teacher_date"] != ""){

                        echo '<span>วันที่ '.DateThai($rowThwgen["twgen_teacher_date"]).'</span>';

                    }else{

                        echo 'วัน เดิอน พ.ศ.&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- รายงานสรุปผลการเยี่ยมบ้านนักเรียน โรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี) (20) --------------------------->

<?php 
    $sqlThresult = "SELECT * FROM tbl_three_result WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $queryThresult = $conn->query($sqlThresult);
    $rowThresult = $queryThresult->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <h2>รายงานสรุปผลการเยี่ยมบ้านนักเรียนโรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowThresult['tresult_year_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowThresult['tresult_year']; ?></p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_name"] != ""){

                        echo 'ชื่อ-สกุล นักเรียน :&nbsp; <span>'.$rowThresult["tresult_name"].'</span>';

                    }else{

                        echo 'ชื่อ-สกุล นักเรียน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_idnumber"] != ""){

                        echo 'เลขประจำตัว :&nbsp; <span>'.$rowThresult["tresult_idnumber"].'</span>';

                    }else{

                        echo 'เลขประจำตัว :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_floor"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowThresult["tresult_floor"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_number"] != ""){

                        echo 'เลขที่ :&nbsp; <span>'.$rowThresult["tresult_number"].'</span>';

                    }else{

                        echo 'เลขที่ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

    <tr>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_teacher"] != ""){

                        echo 'ชื่อครูที่เยี่ยมบ้าน :&nbsp; <span>'.$rowThresult["tresult_teacher"].'</span>';

                    }else{

                        echo 'ชื่อครูที่เยี่ยมบ้าน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td colspan="2">
            <h5>
                <?php  
                    if($rowThresult["tresult_homevisit_date"] != ""){

                        echo 'วัน/เดือน/ปี ที่เยี่ยมบ้าน :&nbsp; <span>'.$rowThresult["tresult_homevisit_date"].'</span>';

                    }else{

                        echo 'วัน/เดือน/ปี ที่เยี่ยมบ้าน :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_homevisit_time"] != ""){

                        echo 'เวลา :&nbsp; <span>'.$rowThresult["tresult_homevisit_time"].'</span>';

                    }else{

                        echo 'เวลา :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ผลการเยี่ยมบ้าน</p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <th width="5%"><h3>ที่</h3></th>
        <th width="45%"><h3>รายการ</h3></th>
        <th width="10%"><h3>ดีมาก</h3></th>
        <th width="10%"><h3>ดี</h3></th>
        <th width="10%"><h3>ปานกลาง</h3></th>
        <th width="10%"><h3>พอใช้</h3></th>
        <th width="10%"><h3>ไม่ดี</h3></th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>1</h5></th>
        <th style="text-align: left;"><h5>ความสัมพันธ์ของบุคคลในครอบครัว</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_one'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';  

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_one'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_one'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_one'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_one'] == 'ไม่ดี'){ 

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>2</h5></th>
        <th style="text-align: left;"><h5>สภาพทางเศรษฐกิจ/รายได้ของครอบครัว</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_two'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_two'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_two'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_two'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_two'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>3</h5></th>
        <th style="text-align: left;"><h5>สภาพบ้านเรือนที่นักเรียนอยู่อาศัย</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_three'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_three'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_three'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_three'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_three'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>4</h5></th>
        <th style="text-align: left;"><h5>สภาพแวดล้อมในชุมชนรอบๆ บ้านนักเรียน</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_four'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_four'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_four'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_four'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_four'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
    </tr>
    <tr>
        <th style="text-align: center;"><h5>5</h5></th>
        <th style="text-align: left;"><h5>พฤติกรรมของนักเรียนที่บ้าน</h5></th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_five'] == 'ดีมาก'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_five'] == 'ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_five'] == 'ปานกลาง'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    ';

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_five'] == 'พอใช้'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
        <th class="text-center" style="color: #000;">

            <?php  
                if($rowThresult['tresult_list_five'] == 'ไม่ดี'){

                    echo '
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16">
                        <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
                    </svg>
                    '; 

            }else{} ?>

        </th>
    </tr>
</table>

<div style="margin-top: 10px;"></div>

<table>
    <tr>
        <td>
            <h3>
                บรรยากาศการเยี่ยมบ้าน &nbsp;

                <?php $tresult_atmosphere = (isset($rowThresult['tresult_atmosphere']) ? $rowThresult['tresult_atmosphere'] : ''); ?>

                <?php if($tresult_atmosphere == "ผู้ปกครองให้ความร่วมมือดี"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ผู้ปกครองให้ความร่วมมือดี
                    </span>

                <?php }else{ ?> 

                    <span style="font-weight: normal;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ผู้ปกครองให้ความร่วมมือดี
                    </span>

                <?php } ?>

                &nbsp;&nbsp;

                <?php if($tresult_atmosphere == "ผู้ปกครองไม่ค่อยให้ความร่วมมือ"){ ?>

                    <span style="font-weight: bold;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
                            <path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
                            <path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
                        </svg>
                        &nbsp;ผู้ปกครองไม่ค่อยให้ความร่วมมือ
                    </span>

                <?php }else{ ?> 

                    <span style="font-weight: normal;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-square" viewBox="0 0 16 16">
                            <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
                        </svg>
                        &nbsp;ผู้ปกครองไม่ค่อยให้ความร่วมมือ
                    </span>

                <?php } ?>

            </h3>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h3>
                ความคิดเห็น หรือข้อเสนอแนะเพิ่มเติมของครูที่เยี่ยมบ้านนักเรียน (ถ้ามี)
            </h3>
        </td>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_promote"] != ""){

                        echo '1. นักเรียนที่ควรได้รับการส่งเสริมในเรื่อง :&nbsp; <span>'.$rowThresult["tresult_promote"].'</span>';

                    }else{

                        echo '1. นักเรียนที่ควรได้รับการส่งเสริมในเรื่อง :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_help"] != ""){

                        echo '2. นักเรียนที่ควรได้รับการช่วยเหลือในเรื่อง :&nbsp; <span>'.$rowThresult["tresult_help"].'</span>';

                    }else{

                        echo '2. นักเรียนที่ควรได้รับการช่วยเหลือในเรื่อง :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
    <tr>
        <td>
            <h5>
                <?php  
                    if($rowThresult["tresult_more"] != ""){

                        echo '3. ข้อเสนอแนะอื่นๆ :&nbsp; <span>'.$rowThresult["tresult_more"].'</span>';

                    }else{

                        echo '3. ข้อเสนอแนะอื่นๆ :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>
</table>

<div style="margin-top: 5px;"></div>

<table>
    <tr>
        <td style="text-align: center;">
            <p class="textsubtitle">ภาพถ่ายการเยี่ยมบ้านนักเรียน</p>
        </td>
    </tr>
    <tr>
        <td style="text-align: center;">
            
            <?php  
                if($rowThresult["tresult_pichome"] != ""){

                    echo '
                        <img src="../pic-home/'.$rowThresult["tresult_pichome"].'"
                        style="width: 600px; height: 400px; object-fit: cover;">
                    ';

                }else{

                    echo '<span>- ไม่มีภาพถ่ายการเยี่ยมบ้านนักเรียน -</span>';

                }
            ?>

        </td>
    </tr>
</table>

<pagebreak/>

<!-- -------------------------- บันทึกคะแนนพฤติกรรม (21) --------------------------->

<table>
    <tr>
        <td style="text-align: center; padding-top: 350px;">
            <img src="../../assets/images/logo/logo.jpg" style="width: 200px; height: 200px;">
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 10px;">
            <h6>บันทึกคะแนนพฤติกรรม</h6>
        </td>
    </tr>
</table>    

<pagebreak/>

<!-- -------------------------- บันทึกคะแนนพฤติกรรม (22) --------------------------->

<?php 
    $query_cp = "SELECT * FROM tbl_head WHERE head_idnumber = '$idnumber'";
    $result_cp = $conn->query($query_cp);
    $row_cp = $result_cp->fetch_assoc();

    $queryHeadClass_cp = "SELECT * FROM tbl_headclass WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'";
    $resultHeadClass_cp = $conn->query($queryHeadClass_cp);
    $rowHeadClass_cp = $resultHeadClass_cp->fetch_assoc();
?>

<table>
    <tr>
        <td style="text-align: center;">
            <h2>รายงานสรุปผลการเยี่ยมบ้านนักเรียนโรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowHeadClass_cp['headc_year_one_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowHeadClass_cp['headc_year_one']; ?></p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($row_cp["head_pre"] != ""){

                        echo 'ชื่อ-สกุล :&nbsp; <span>'.$row_cp["head_pre"].$row_cp["head_name"].' '.$row_cp["head_lname"].'</span>';

                    }else{

                        echo 'ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHeadClass_cp["headc_class_one"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowHeadClass_cp["headc_class_one"].$rowHeadClass_cp["headc_class_onelap"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

</table>

<table>
    <tr>
        <th width="5%"><h3>ที่</h3></th>
        <th><h3>วัน/เดือน/ปี</h3></th>
        <th><h3>พฤติกรรมที่ถูกตัดคะแนน</h3></th>
        <th><h3>คะแนนที่ตัด</h3></th>
        <th><h3>ลายมือชื่อครู</h3></th>
        <th><h3>ลายมือชื่อนักเรียน</h3></th>
    </tr>
    <?php
        $sqlCuspOne = "SELECT * FROM tbl_cutpoints_one WHERE head_idnumber = '$idnumber' AND head_class = '$head_class'
        AND cutp_one_year_no = '1'";
        $queryCuspOne = $conn->query($sqlCuspOne);

        if(mysqli_num_rows($queryCuspOne) < 1){ ?>

        <tr style="text-align: center;">
            <th colspan="6">
                <h5 style="color: #FF0000;">- ไม่มีข้อมูลการหักคะแนน -</h5>
            </th>
        </tr>

        <?php }else{
                    
        $i_one = 0;
        while($rowCuspOne = $queryCuspOne->fetch_assoc()){
        $i_one = $i_one + 1;
    ?>

        <tr>
            <th style="text-align: center;"><h5><span><?php echo $i_one; ?></span></h5></th>
            <th style="text-align: center;"><h5><span><?php echo DateThai($rowCuspOne['cutp_one_date']); ?></span></h5></th>
            <th style="text-align: left;"><h5><span><?php echo $rowCuspOne['cutp_one_cutpoints']; ?></span></h5></th>
            <th style="text-align: center;"><h5><span><?php echo $rowCuspOne['cutp_one_points']; ?></span></h5></th>
            <th></th>
            <th></th>
        </tr>
    
    <?php }} ?>
</table>

<pagebreak/>

<!-- -------------------------- บันทึกคะแนนพฤติกรรม (23) --------------------------->

<table>
    <tr>
        <td style="text-align: center;">
            <h2>รายงานสรุปผลการเยี่ยมบ้านนักเรียนโรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowHeadClass_cp['headc_year_two_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowHeadClass_cp['headc_year_two']; ?></p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($row_cp["head_pre"] != ""){

                        echo 'ชื่อ-สกุล :&nbsp; <span>'.$row_cp["head_pre"].$row_cp["head_name"].' '.$row_cp["head_lname"].'</span>';

                    }else{

                        echo 'ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHeadClass_cp["headc_class_one"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowHeadClass_cp["headc_class_one"].$rowHeadClass_cp["headc_class_onelap"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

</table>

<table>
    <tr>
        <th width="5%"><h3>ที่</h3></th>
        <th><h3>วัน/เดือน/ปี</h3></th>
        <th><h3>พฤติกรรมที่ถูกตัดคะแนน</h3></th>
        <th><h3>คะแนนที่ตัด</h3></th>
        <th><h3>ลายมือชื่อครู</h3></th>
        <th><h3>ลายมือชื่อนักเรียน</h3></th>
    </tr>
    <?php
        $sqlCuspTwo = "SELECT * FROM tbl_cutpoints_one
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND cutp_one_year_no = '2'";
        $queryCuspTwo = $conn->query($sqlCuspTwo);

        if(mysqli_num_rows($queryCuspTwo) < 1){ ?>

        <tr style="text-align: center;">
            <th colspan="6">
                <h5 style="color: #FF0000;">- ไม่มีข้อมูลการหักคะแนน -</h5>
            </th>
        </tr>

        <?php }else{
                    
        $i_Two = 0;
        while($rowCuspTwo = $queryCuspTwo->fetch_assoc()){
        $i_Two = $i_Two + 1;
    ?>

        <tr>
            <th style="text-align: center;"><h5><span><?php echo $i_Two; ?></span></h5></th>
            <th style="text-align: center;"><h5><span><?php echo DateThai($rowCuspTwo['cutp_one_date']); ?></span></h5></th>
            <th style="text-align: left;"><h5><span><?php echo $rowCuspTwo['cutp_one_cutpoints']; ?></span></h5></th>
            <th style="text-align: center;"><h5><span><?php echo $rowCuspTwo['cutp_one_points']; ?></span></h5></th>
            <th></th>
            <th></th>
        </tr>
    
    <?php }} ?>
</table>

<pagebreak/>

<!-- -------------------------- บันทึกคะแนนพฤติกรรม (24) --------------------------->

<table>
    <tr>
        <td style="text-align: center;">
            <h2>รายงานสรุปผลการเยี่ยมบ้านนักเรียนโรงเรียนเทศบาล ๑ (เอ็งเสียงสามัคคี)</h2>
        </td>
    </tr>
    <tr>
        <td style="text-align: center; padding-top: 0px;">
            <p class="textsubtitle">ครั้งที่ <?php echo $rowHeadClass_cp['headc_year_three_no']; ?>&nbsp;
            ปีการศึกษา <?php echo $rowHeadClass_cp['headc_year_three']; ?></p>
        </td>
    </tr>
</table>

<table>
    <tr>
        <td>
            <h5>
                <?php  
                    if($row_cp["head_pre"] != ""){

                        echo 'ชื่อ-สกุล :&nbsp; <span>'.$row_cp["head_pre"].$row_cp["head_name"].' '.$row_cp["head_lname"].'</span>';

                    }else{

                        echo 'ชื่อ-สกุล :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
        <td>
            <h5>
                <?php  
                    if($rowHeadClass_cp["headc_class_one"] != ""){

                        echo 'ชั้น :&nbsp; <span>'.$rowHeadClass_cp["headc_class_one"].$rowHeadClass_cp["headc_class_onelap"].'</span>';

                    }else{

                        echo 'ชั้น :&nbsp; <span>-</span>';

                    }
                ?>
            </h5>
        </td>
    </tr>

</table>

<table>
    <tr>
        <th width="5%"><h3>ที่</h3></th>
        <th><h3>วัน/เดือน/ปี</h3></th>
        <th><h3>พฤติกรรมที่ถูกตัดคะแนน</h3></th>
        <th><h3>คะแนนที่ตัด</h3></th>
        <th><h3>ลายมือชื่อครู</h3></th>
        <th><h3>ลายมือชื่อนักเรียน</h3></th>
    </tr>
    <?php
        $sqlCuspThree = "SELECT * FROM tbl_cutpoints_one
        WHERE head_idnumber = '$idnumber' AND head_class = '$head_class' AND cutp_one_year_no = '3'";
        $queryCuspThree = $conn->query($sqlCuspThree);

        if(mysqli_num_rows($queryCuspThree) < 1){ ?>

        <tr style="text-align: center;">
            <th colspan="6">
                <h5 style="color: #FF0000;">- ไม่มีข้อมูลการหักคะแนน -</h5>
            </th>
        </tr>

        <?php }else{
                        
        $i_Three = 0;
        while($rowCuspThree = $queryCuspThree->fetch_assoc()){
        $i_Three = $i_Three + 1;
    ?>

        <tr>
            <th style="text-align: center;"><h5><span><?php echo $i_Three; ?></span></h5></th>
            <th style="text-align: center;"><h5><span><?php echo DateThai($rowCuspThree['cutp_one_date']); ?></span></h5></th>
            <th style="text-align: left;"><h5><span><?php echo $rowCuspThree['cutp_one_cutpoints']; ?></span></h5></th>
            <th style="text-align: center;"><h5><span><?php echo $rowCuspThree['cutp_one_points']; ?></span></h5></th>
            <th></th>
            <th></th>
        </tr>
    
    <?php }} ?>
</table>

</body>
</html>

<?php
$html = ob_get_contents();
// เพิ่ม HTML ลงในเอกสาร PDF

$stylesheet = file_get_contents('pdf.css'); // external css
$mpdf->WriteHTML($stylesheet,1);
$mpdf->WriteHTML($html,2);
$mpdf->Output("Report.pdf");
ob_end_flush();

?>