Exemplo n.º 1
0
													<?php 
        echo $row['name'];
        ?>
												</option>
											<?php 
    }
}
?>
								</select>
							</div>
							<div class="form-group">
								<label>District</label>
								<select class="form-control ddlDistrict" name="ddlDistrict" id="ddlDistrict">
								<option value="">-select-</option>
									<?php 
$dataDistrict = $adminController->getDistrictsByCitiesStatesCountryId($city_id, $state_id, $country_id);
if (!empty($dataDistrict)) {
    $cnt = 1;
    while ($row = mysql_fetch_array($dataDistrict)) {
        ?>
												<option value="<?php 
        echo $row['id'];
        ?>
" <?php 
        if ($data['district_id'] == $row['id']) {
            echo 'selected';
        }
        ?>
 >
													<?php 
        echo $row['name'];
<?php

include '../assets/config.php';
if (!empty($_POST['country_id']) && !empty($_POST['state_id']) && !empty($_POST['city_id'])) {
    $adminController = new AdminController();
    $data = $adminController->getDistrictsByCitiesStatesCountryId($_POST['city_id'], $_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>';
    }
}