[eluser]vincej[/eluser]
Hi ! I have created an anchor which looks like:
Code:
anchor('admin/pos/open_orders/'.$customerid.'/'.$list['pickupdate'] , $list['firstname']." ". $list['lastname'])
it creates a url like this :
Code:
<a href="http://localhost/countrylane/index.php/admin/pos/open_orders/5/1343800800">
I want to pass the customer id and pickupdate to to my model for inclusion in a query - via the controller of course.
CONTROLLER:
Code:
function open_orders($customerid=""){
$_SESSION['customerid']=$customerid;
$this->MPos->open_orders($customerid);
$data['customer'] = $this->MCustomer->getCustomer($customerid);
$data['main'] = 'admin_pos_openorders';
$data['title'] = "Country Lane Farms | Open Orders";
$this->load->vars($data);
$this->load->view('dashboard')
;}
MODEL:
Code:
function open_orders($customerid){
{ $sql = "SELECT order.prodid, orderid, customerid, weigh, products.pricelb, orderdate, pickupdate, order.price, order.quantity,products.name, order.price*order.quantity AS ordervalue
FROM `order`,`products`
WHERE customerid = $customerid
AND order.status = 'open'
AND products.id = order.prodid";
$Q = $this->db->query($sql);
if ($Q->num_rows() > 0){
$openorders = $Q->result_array();
I expect that I need to use the uri->segment function.
I'd really appreciate some advice how how to do this - as my attempts so far have all crashed and burned !
Many thanks !