public function delete_nav($id) { $return_value = 0; $this->db->where(array('nav_id' => $id)); $query = $this->db->get('tcp_nav'); $result = $query->result(); if (0 == is_nav_wid($id) and 0 == $result[0]->status) { $query = $this->db->delete('tcp_nav', array('nav_id' => $id)); $query2 = $this->db->delete('tcp_nav_li', array('nav_id' => $id)); if ($query and $query2) { $return_value = 1; } } else { $return_value = 2; } return $return_value; }
?action=edit&id=<?php echo $nav->nav_id; ?> " class="anchor-btn"><span class="glyphicon glyphicon-pencil"></span></a> </td> <td><?php echo $nav->description; ?> </td> <td> <?php if (1 == $nav->status) { ?> <em>In use - Main navigation</em> <?php } elseif (1 == is_nav_wid($nav->nav_id)) { ?> <em>In use - Widget</em> <?php } else { ?> <em>Not in use.</em> <?php } ?> </td> </tr> <?php $count++; } }