public function execute() { //grab people $model = new PeopleModel(); $people = $model->getPeopleList(); //grab deals $model = new DealModel(); $deals = $model->getDealList(); //grab notes categories $model = new NoteModel(); $categories = $model->getNoteCategories(); //construct data obj $data = array('people' => $people, 'deals' => $deals, 'categories' => $categories); //encode and return results echo json_encode($data); }
public function _display_notes() { //get model for reports $noteModel = new NoteModel(); $note_entries = $noteModel->getNotes(NULL, NULL, FALSE); $this->notes_list = ViewHelper::getView('reports', 'notes_filter', 'phtml', array('note_entries' => $note_entries)); $state = $noteModel->getState(); $notes_header = ViewHelper::getView('reports', 'notes_header', 'phtml', array('note_entries' => $note_entries, 'state' => $state)); $notes_footer = ViewHelper::getView('reports', 'notes_footer', 'phtml'); $notes_header->team_names = DropdownHelper::getTeamNames(); $notes_header->user_names = DropdownHelper::getUserNames(); $notes_header->state = $state; $categories = $noteModel->getNoteCategories(); $notes_header->categories = $categories; $notes_header->created_dates = DateHelper::getCreatedDates(); // Initialise state variables. $state = $noteModel->getState(); //assign refs to view $this->notes_header = $notes_header; $this->notes_footer = $notes_footer; $this->state = $state; $this->note_entries = $note_entries; }