You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
806 B
PHTML
35 lines
806 B
PHTML
2 years ago
|
<?php
|
||
|
|
||
|
class SalesCustomer extends CI_Model
|
||
|
{
|
||
|
public $recordID;
|
||
|
public $customerid;
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
parent::__construct();
|
||
|
|
||
|
$this->load->database();
|
||
|
}
|
||
|
|
||
|
public function getSalesCustomerByRecordIDCustomerID()
|
||
|
{
|
||
|
return $this->db->get_where("salescustomer", array("recordID"=>$this->recordID, "customerid"=>$this->customerid));
|
||
|
}
|
||
|
|
||
|
|
||
|
public function addSalesCustomer()
|
||
|
{
|
||
|
$data = array(
|
||
|
"recordID" => $this->recordID,
|
||
|
"customerid" => $this->customerid
|
||
|
);
|
||
|
|
||
|
$success = $this->db->insert("salescustomer", $data);
|
||
|
|
||
|
if($success)
|
||
|
return array("success"=>$success, "data" => $data);
|
||
|
else
|
||
|
return array("success"=>$success, "data" => $this->db->error());
|
||
|
}
|
||
|
}
|