Controller
public function delete()
{
$id = $this->input->post('id');
if ($id) {
$this->menu_model->get_descendants($id);
if (!empty($this->ids)) {
$ids = implode(', ', $this->ids);
$id = "$id, $ids";
}
$res = $this->menu_model->delete_menu($id);
if ($res) {
$response['success'] = true;
} else {
$response['success'] = false;
}
header('Content-type: application/json');
echo json_encode($response);
}
} /* delete menu item
------------------------------------------------------------------------- */
$('body').on('click', '.delete-menu', function () {
var li = $(this).closest('li');
var param = {id: $(this).next().val()};
var menu_title = $(this).parent().parent().children('.ns-title').text();
gbox.show({
content: '<h2>Delete Menu Item</h2>Are you sure you want to delete this menu item?<br><b>'
+ menu_title +
'</b><br><br>This will also delete all sub items.',
buttons: {
'Yes': function () {
$.post(_BASE_URL + 'admin_controller/delete', param, function (data) {
if (data.success) {
gbox.hide();
li.remove();
} else {
gbox.show({
content: 'Failed to delete this menu item.'
});
}
});
},
'No': gbox.hide
}
});
return false;
});<a href="#" class="delete-menu" title="Delete">
Site codeigniter, çoğu js'leri çalıştırıyor ama 2-3 tanesini çalıştırmıyor. Güvenlik mi engelliyor anlamadım nerede hata anlamadım ücretli yardımcı olabilecek var mı?