Exemplo n.º 1
0
 function delete($id)
 {
     if ($id != 0) {
         $productmanufacture = new Productmanufacture($id);
         $productmanufacture->recycle = 1;
         if ($productmanufacture->save()) {
             flash_message('success', 'Thành công. Đối tượng đã được xóa.');
             redirect($_SERVER['HTTP_REFERER']);
         }
     } else {
         $arr = $this->input->post('checkinput');
         foreach ($arr as $row) {
             $productmanufacture = new Productmanufacture($row);
             $productmanufacture->recycle = 1;
             $productmanufacture->save();
             flash_message('success', 'Thành công. Các đối tượng đã được xóa.');
             redirect($_SERVER['HTTP_REFERER']);
         }
     }
 }