/var/www/doncode.com.ua/www/models
Edit: /var/www/doncode.com.ua/www/models/class.index_model.php (1129B)
database->prepare("SELECT * FROM ".DB_PREFIX."car_mark");
$sth->execute();
if ($ajax){
echo json_encode($sth->fetchAll());
}else{
return $sth->fetchAll();
}
}
public function getCarColors ($ajax=false){
$sth=$this->database->prepare("SELECT * FROM ".DB_PREFIX."car_colors");
$sth->execute();
if ($ajax){
echo json_encode($sth->fetchAll());
}else{
return $sth->fetchAll();
}
}
public function getCarModels ($id,$ajax=false){
$sth=$this->database->prepare("SELECT * FROM ".DB_PREFIX."car_model WHERE mark_id=".$id);
$sth->execute();
if ($ajax){
echo json_encode($sth->fetchAll());
}else{
return $sth->fetchAll();
}
}
}