예제 #1
0
						</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 
<?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>';
    }
}