diff --git a/application/controllers/Pages.php b/application/controllers/Pages.php
index 12b14d0..dbf770f 100644
--- a/application/controllers/Pages.php
+++ b/application/controllers/Pages.php
@@ -2355,6 +2355,26 @@ class Pages extends CI_controller
$this->load->view('pages/iteminquirycountsummaryreport', $data);
}
+ public function customerpurchase()
+ {
+ if(!$this->isLogged())
+ redirect('login', 'refresh');
+
+ $this->load->view('pages/customerpurchase');
+ }
+
+ public function salesCustomerSearch()
+ {
+ $this->load->model("SalesCustomer");
+
+ $result = $this->SalesCustomer->getSalesJoinedSalesCustomerByCustomerID($this->input->get("s"));
+
+ if($result->num_rows() > 0)
+ echo json_encode(array("success"=>true, "data"=>$result->result()));
+ else
+ echo json_encode(array("success"=>false, "data"=>"No result"));
+ }
+
// ------- ADMIN -> Item Ledger Editor ----------
diff --git a/application/models/SalesCustomer.php b/application/models/SalesCustomer.php
index e91c729..aacf85c 100644
--- a/application/models/SalesCustomer.php
+++ b/application/models/SalesCustomer.php
@@ -17,6 +17,15 @@ class SalesCustomer extends CI_Model
return $this->db->get_where("salescustomer", array("recordID"=>$this->recordID, "customerid"=>$this->customerid));
}
+ public function getSalesJoinedSalesCustomerByCustomerID($customerid)
+ {
+ $this->db->select('*');
+ $this->db->from('salescustomer');
+ $this->db->join('sales', 'salescustomer.recordID=sales.recordID');
+ $this->db->where('salescustomer.customerid', $customerid);
+ return $this->db->get();
+ }
+
public function addSalesCustomer()
{
diff --git a/application/views/pages/customerpurchase.php b/application/views/pages/customerpurchase.php
new file mode 100644
index 0000000..94ac02b
--- /dev/null
+++ b/application/views/pages/customerpurchase.php
@@ -0,0 +1,307 @@
+
+
+
+
+
+ AdminKW | Customer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ID | Name | Date of Birth | Contact Info | e-Mail Address | Address | |
+
+ No data |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ load->view('pages/leftnav'); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No |
+ Record ID |
+ Transaction ID |
+ Branch |
+ Invoice |
+ Category |
+ Model No. |
+ Price |
+ Transaction Type |
+ Date |
+
+
+ No data |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/views/pages/leftnav.php b/application/views/pages/leftnav.php
index 335a70b..be945a4 100644
--- a/application/views/pages/leftnav.php
+++ b/application/views/pages/leftnav.php
@@ -81,6 +81,7 @@
Branch Inventory
Item Movement
Item Inquiry Summary
+ Customer Purchase