本文整理汇总了PHP中AdminController::getStatesByCountryId方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::getStatesByCountryId方法的具体用法?PHP AdminController::getStatesByCountryId怎么用?PHP AdminController::getStatesByCountryId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminController
的用法示例。
在下文中一共展示了AdminController::getStatesByCountryId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Information
</div>
<div class="col-md-3">
<legend>Address Information (optional)</legend>
<div class="form-group">
<label>Address</label>
<textarea placeholder="Enter address" name="txtAddress" id="txtAddress" class="form-control"><?php
echo $data['address'];
?>
</textarea>
</div>
<div class="form-group">
<label>State</label>
<select class="form-control ddlState" name="ddlState" id="ddlState">
<option value="">-select-</option>
<?php
$dataState = $adminController->getStatesByCountryId($country_id);
if (!empty($dataState)) {
$cnt = 1;
while ($row = mysql_fetch_array($dataState)) {
?>
<option value="<?php
echo $row['id'];
?>
" <?php
if ($data['state_id'] == $row['id']) {
$state_id = $data['state_id'];
echo 'selected';
}
?>
>
<?php
示例2: AdminController
<?php
include '../assets/config.php';
if (!empty($_POST['country_id'])) {
$adminController = new AdminController();
$data = $adminController->getStatesByCountryId($_POST['country_id']);
echo '<option value="">-select-</option>';
while ($row = mysql_fetch_array($data)) {
echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
}
}