1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Ajax extends CI_Controller {
public function __construct(){
parent::__construct();
}
public function returnDpt(){
if($this->input->get("q")){
$dpt = $this->input->get("q");
$resultats = $this->db->query("SELECT iddepartement, nomdepartement FROM departements_liste WHERE idregion = ".$dpt.";")->result_array();
foreach(){
echo "<option value='".$row['iddepartement']."'>".$row['nomdepartement']."</option>";
}
}
}
} |
Partager