Model:
View:
Controller:
class ModelLocalisationDatefixing extends Model { public function getDatefixed() { $query = $this->db->query("SELECT DATE_FORMAT(date, '%Y-%c-%e') AS date FROM " . DB_PREFIX . "date_fix WHERE status='1'"); return $query->rows; } }
View:
Delivery Date ( Max 7 days ) :
Controller:
public function datefixed() { $date_string = array(); $this->load->model('localisation/datefixing'); $date_info = $this->model_localisation_datefixing->getDatefixed(); $ddd=array_map('current',$date_info); $date_string['dateinfo']=$ddd; $this->response->setOutput(json_encode($date_string)); }