Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. $(function() {
  2. $( "#supcode" ).autocomplete({
  3. source:"index.php/inventory/supcode",
  4. minLength: 1
  5. });
  6. });
  7.  
  8. function supcode()
  9. {
  10. $dataarray="";
  11. $data=$this->Inventorymodel->supcode();
  12. echo json_encode($data);
  13. }
  14.  
  15. function supcode(){
  16. $finresult="";
  17. $this->db->select('name');
  18. $query = $this->db->get('supplier');
  19. $result=$query->result_array();
  20.  
  21. foreach($result as $row){
  22. $finresult[]=array(
  23. 'name' => $row['name']
  24. );
  25. }
  26. return $finresult;
  27. }
  28.  
  29. [ { label: "Choice1", value: "value1" }, ... ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement