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