[eluser]brentconey[/eluser]
Here is my admin controller. When you hit the index it just loads the view of the submissions.
Code:
function index(){
$data = array();
$this->load->model('admin_model');
$data['submissions'] = $this->admin_model->getSubmissionList();
$this->load->view('adminlist-view', $data);
}
Then when the click a submission it loads the view function which looks like this:
Code:
function view($id = NULL){
date_default_timezone_set('America/Chicago');
$this->load->model('admin_model');
$yearNow = date("Y");
$years = range(($yearNow-5), $yearNow);
$data['years'] = $years;
$data['yearNow'] = $yearNow;
$data['submission_data'] = $this->admin_model->getSubmissionData($id);
$this->load->view('adminsubmission-view',$data);
}
So the workflow is they see the index which gives a list of submissions, when they click a submission it goes to the view function which pulls the data for the submission they chose. Inside the submission they can edit the data. at the bottom of the adminsubmission-view there is a link back to the index.
Code:
<p class="center"><a href="<?php echo base_url();?>index.php/admin/">Return to submissions</a></p>
If they edit the submission and they change things like the title or something when you click "return to submissions" it doesn't pull the updated data.
Does this make sense now?
Sorry for posting no code