本文整理汇总了PHP中country::get_country方法的典型用法代码示例。如果您正苦于以下问题:PHP country::get_country方法的具体用法?PHP country::get_country怎么用?PHP country::get_country使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类country
的用法示例。
在下文中一共展示了country::get_country方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
/*
* Displays all customer table
*/
$cust = $data["customers"];
if (!empty($cust)) {
// actual display table
echo "<table id='main_table'>\n <tr>\n <td>ID</td>\n <td>Name</td>\n <td>Email</td>\n <td>Country</td>\n <td>Transactions</td>\n </tr>" . PHP_EOL;
foreach ($cust as $val) {
echo "<tr>\n <td class='c_id'>" . $val["customer_id"] . "</td>\n <td><span class='c_name'>" . $val["customer_name"] . "</span><br>\n <div class='actions'>\n <a href='javascript:;' class='transactions'>View</a> \n <a href='javascript:;' class='edit'>Edit</a> \n <a class='delete' href='javascript:;'>Delete</a>\n </div>\n </td>\n <td class='c_email'>" . $val["customer_email"] . "</td>\n <td><input type='hidden' class='c_country' value='" . $val["customer_country"] . "'>" . country::get_country($val["customer_country"]) . "</td>\n <td>\n <p style='padding-top:12px;'><b>Total</b> : " . number_format($val["total"], 2, '.', ',') . "</p>\n </td>\n </tr>";
}
echo "</table>";
if (isset($data["pagination_links"]) && $data["pagination_links"] != "") {
echo "<div style='float:left; clear:both; margin:20px 0px'>" . $data["pagination_links"] . "</div>";
}
} else {
// actual display table
echo "<table id='main_table'>\n <tr>\n <td>ID</td>\n <td>Name</td>\n <td>Email</td>\n <td>Country</td>\n <td>Transactions</td>\n </tr>\n </table>";
echo "<h3 style='float:left; margin:50px auto;'>0 RECORD FOUND.</h3>";
}
?>
示例2:
<table>
<tr>
<td>Customer Name:<input type="hidden" id="cust_id" value=""></td>
<td><input type="text" class="cust_in" value="" id="cust_name"></td>
</tr>
<tr>
<td>Customer Email:</td>
<td><input type="text" class="cust_in" value="" id="cust_email"></td>
</tr>
<tr>
<td>Country:</td>
<td>
<select id="cust_country">
<option value=""> -- Select -- </option>
<?php
$country = country::get_country();
foreach ($country as $key => $val) {
echo "<option value='{$key}'>{$val}</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td></td>
<td><div id="remarks"></div>
<input type="button" value="Cancel" id="cancel_btn">
<input type="button" value="Save" id="save_btn" class='btn1'>
<input type="button" value="Save" id="update_btn" class='btn1'></td>
</tr>