[eluser]alexandervj[/eluser]
hm that sounds a little over my head at the moment. I just started using CodeIgniter.
Maybe I'll just start with passing the value to another view and try doing it with a popup later on.
So in my view I have...
Code:
<?php echo anchor("main/request_details/$r->Submitted", 'View'); ?>
in my model i have the function...
Code:
function getDetail(){
$q = $this->db->query("SELECT `submit_time` AS 'Submitted',
max(if(`field_name`='firstName', `field_value`, null )) AS 'firstName',
max(if(`field_name`='lastName', `field_value`, null )) AS 'lastName',
max(if(`field_name`='email', `field_value`, null )) AS 'email',
max(if(`field_name`='phone', `field_value`, null )) AS 'phone',
max(if(`field_name`='affiliation', `field_value`, null )) AS 'affiliation',
max(if(`field_name`='interest', `field_value`, null )) AS 'interest',
max(if(`field_name`='productSheets', `field_value`, null )) AS 'productSheets',
max(if(`field_name`='referredBy', `field_value`, null )) AS 'referredBy',
max(if(`field_name`='comments', `field_value`, null )) AS 'comments',
GROUP_CONCAT(if(`file` is null or length(`file`) = 0, null, `field_name`)) AS 'fields_with_file'
FROM `wp_cf7dbplugin_submits`
WHERE `form_name` = 'PSRequestForm' AND submit_time = ".$submitTime."
GROUP BY `submit_time`
ORDER BY `submit_time` DESC
LIMIT 0,100");
if($q->num_rows() > 0){
foreach($q->result() as $rows){
$data[] = $rows;
}
return $data;
}
}
and in my controller I have the function...
Code:
public function request_details(){
if ($this->session->userdata('is_logged_in')){
$this->load->model('model_data');
$data['rows'] = $this->model_data->getDetail($submitTime);
$this->load->view('request_detail', $data);
} else {
redirect('restricted');
}
}
I feel like I'm almost there but a little confused still on how to get the data in the request_details.php view based on the submitTime value