Beispiel #1
0
 public function history($i_id, $s_id)
 {
     $this->load->helper('html');
     $this->load->library('table');
     $this->load->model(array('price_model', 'item_model'));
     $item = new Item_model();
     $item->load($i_id);
     $prices = $this->price_model->get_history($i_id, $s_id);
     if (!$prices) {
         redirect('items/view/' . $i_id);
         die;
     }
     $RM = "RM ";
     $price_list = array();
     foreach ($prices as $p_id => $price) {
         $price_list[] = array(date_format(new DateTime($price->datetime), 'd/m/Y, h:i A'), $RM . number_format((double) $price->price, 2, '.', ''), $price->username, anchor('items/delete/' . $price->id, 'Delete Price'));
     }
     $this->load->view('history', array('item' => $item, 'price' => $price, 'price_list' => $price_list));
 }