<?php
include "conn.php";
checkLogin("信息管理");

$str = textEncode($_GET['str'] ?? '');

$sql = "select id,countryCode,countryName from country where countryCode like '%" . $str . "%' or countryName like '%" . $str . "%'";
$rs = $conn->query($sql);

while ($row = $rs->fetch()) {
?>
    <li data-id="<?php echo $row['id']; ?>">
        <div class="list-content">
            <span class="code"><?php echo $row['countryCode']; ?></span>
            <span class="cname"><?php echo $row['countryName']; ?></span>
        </div>
    </li>
<?php
}
?>