In order to delete a person from the database, I would like to check its connections with other objects like inventories before deleting then display a bootstrap dialog message within the same page.
Using CodeIgniter, I have a page named "Person's details" that has a link to check these connections like so:
<a class="btn btn-custom" href="person/checkConnections/<?=$ID_Person?>">Delete</a>
In the controller "person", the method "checkConnections" looks like:
public function checkConnections($ID_Person)
{
$data["strConnections"] = "3 connections with inventories found";
$this->load->view("person/showdetails", $data)
// launch the dialog box #deleteMsg
???
}
How can I launch the bootstrap dialog box which has an id="deleteMsg" and which is in the "Person's details" page? if it was an html url, the url would look like : http://mywebsite/person/showdetails/134#deleteMsg. But how can I have the same result using the codeIgniter method to render a view?
I can check these connections when loading the page the first time. But it wouldn't be efficient to do it every time since the delete action is rarely used.