#foreach($detail in $details)
<div style="text-align: center; font-size: 24px; font-weight: bold; margin-bottom: 20px;">
    从业人员岗前培训考核卡
</div>

<table style="width: 100%; border-collapse: collapse; border: 1px solid #000; font-size: 14px; text-align: center;">
    <colgroup>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
        <col style="width: 8.33%"/>
    </colgroup>

    <!-- Row 1 -->
    <tr style="height: 40px;">
        <td colspan="2" style="border: 1px solid #000;">姓名</td>
        <td colspan="2" style="border: 1px solid #000;">$!{detail.driverName}</td>
        <td colspan="2" style="border: 1px solid #000;">性别</td>
        <td colspan="2" style="border: 1px solid #000;">$!{detail.gender}</td>
        <td colspan="2" style="border: 1px solid #000;">出生<br/>年月</td>
        <td colspan="2" style="border: 1px solid #000;">$!{detail.birthDate}</td>
    </tr>
    <!-- Row 2 -->
    <tr style="height: 40px;">
        <td colspan="2" style="border: 1px solid #000;">文化<br/>程度</td>
        <td colspan="2" style="border: 1px solid #000;">$!{detail.education}</td>
        <td colspan="2" style="border: 1px solid #000;">参加工<br/>作时间</td>
        <td colspan="2" style="border: 1px solid #000;">$!{detail.startWorkDate}</td>
        <td colspan="2" style="border: 1px solid #000;">进公司<br/>日期</td>
        <td colspan="2" style="border: 1px solid #000;">$!{detail.entryDateLabel}</td>
    </tr>
    <!-- Row 3 -->
    <tr style="height: 40px;">
        <td style="border: 1px solid #000;">身份证号</td>
        <td colspan="3" style="border: 1px solid #000;">$!{detail.idCardNo}</td>
        <td style="border: 1px solid #000;">岗位</td>
        <td colspan="3" style="border: 1px solid #000;">驾驶员</td>
        <td style="border: 1px solid #000;">家庭住址</td>
        <td colspan="3" style="border: 1px solid #000;">$!{detail.currentAddress}</td>
    </tr>

    <!-- Training Header -->
    #if($detail.rows)
        #set($rowCount = $detail.rows.size())
    #else
        #set($rowCount = 0)
    #end
    #set($totalRows = $rowCount + 1)

    <tr style="height: 40px;">
        <td rowspan="$totalRows" style="border: 1px solid #000; writing-mode: vertical-lr; padding: 10px;">从业人员<br/>岗前培训
        </td>
        <td colspan="2" style="border: 1px solid #000;">培训时间</td>
        <td colspan="2" style="border: 1px solid #000;">培训地点</td>
        <td colspan="5" style="border: 1px solid #000;">培训内容</td>
        <td style="border: 1px solid #000;">培训学时</td>
        <td style="border: 1px solid #000;">考核成绩</td>
    </tr>

    <!-- Training Data -->
    #foreach($row in $detail.rows)
        <tr style="height: 40px;">
            <td colspan="2" style="border: 1px solid #000;">$!{row.trainingTime}</td>
            <td colspan="2" style="border: 1px solid #000;">$!{row.location}</td>
            <td colspan="5" style="border: 1px solid #000;">$!{row.courseName}</td>
            <td style="border: 1px solid #000;">$!{row.studyDuration}</td>
            #if($foreach.count == 1)
                <td rowspan="$rowCount" style="border: 1px solid #000;">$!{detail.totalScore}</td>
            #end
        </tr>
    #end

    <!-- Footer -->
    <tr style="height: 60px;">
        <td style="border: 1px solid #000;">被考核人签名</td>
        <td colspan="2" style="border: 1px solid #000; text-align: center;">
            #if($detail.driverSignImgUrl)
                <img src="$!{detail.driverSignImgUrl}" style="max-height: 50px; max-width: 100%;"
                     onerror="this.style.display='none';"/>
            #end
        </td>
        <td colspan="2" style="border: 1px solid #000;">考核人签名</td>
        <td colspan="2" style="border: 1px solid #000; text-align: center;">
            #if($detail.auditorSignImgUrl)
                <img src="$!{detail.auditorSignImgUrl}" style="max-height: 50px; max-width: 100%;"
                     onerror="this.style.display='none';"/>
            #end
        </td>
        <td style="border: 1px solid #000;">备注</td>
        <td colspan="4" style="border: 1px solid #000;"></td>
    </tr>
</table>
<div style="page-break-after: always;"></div>
#end
