Guest User

Untitled

a guest
Oct 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. public function gifts() {
  2.  
  3. $data = $this->product_model->getGiftsProducts();
  4.  
  5. $this->load->view('header');
  6. $this->load->view('header_search');
  7. $this->load->view('test_gifts' , $data);
  8. $this->load->view('footer');
  9.  
  10. public function getGiftsProducts() {
  11. $this->db->select('pro_title, price , products_offers.barcode , photo_id');
  12. //$this->db->where('products_offers.barcode' , '0093700');
  13. $this->db->from('products');
  14. $this->db->join('products_offers' , 'products.ind_id = products_offers.ind_id' );
  15.  
  16. $query = $this->db->get();
  17.  
  18. $result = $query->result_array();
  19.  
  20. foreach ($query->result() as $row){
  21. $data = array(
  22. 'title' => $row->pro_title,
  23. 'price' => $row->price,
  24. 'barcode' => $row->barcode,
  25. 'image_code' => $row->photo_id
  26. );
  27. }
  28.  
  29. return $data;
  30. }
  31.  
  32. <img src="<?= base_url(); ?>static/pic/150x240/<?= $image_code ?>/1_1.jpg">
  33. <?php echo '<p>' .$title. '</p>'; ?>
  34. <?php echo '<p>' .$price. '</p>'; ?>
  35. <?php echo '<p>' .$barcode. '</p>'; ?>
Add Comment
Please, Sign In to add comment