I am a bit stuck.
I have the below controller function. this works 100% with no issues.
function new_blank_order_lines()
{
$data = array(
'project' =>$this->input->post('project'),
'millcoords' => $this->sales_model->get_mill_coords($this->input->post('mill')),
'custcoords' => $this->sales_model->get_cust_coords($this->input->post('deliveryaddressid')),
);
$this->load->view('sales/new_blank_order_lines',$data);
What I want to do is pass more model information to the view. my problem however is that I am needing the results of the previous model queries for my new model query. so I want to add to the array as follows:
$data = array(
'project' =>$this->input->post('project'),
'millcoords' => $this->sales_model->get_mill_coords($this->input->post('mill')),
'custcoords' => $this->sales_model->get_cust_coords($this->input->post('deliveryaddressid')),
'customersinrange' => $this->sales_model->get_customers_in_range($millcoords,$custcoords),
);
So I want to pass two values to the model function get_customers_in_range. I want to pass the results of millcoords
and the results of custcoords
.
How can I achieve this so that the controller can use the results of a model query to execute a new model query?
Thanks as always, Ryan