public function deletepost($page = '0', $id = '', $confirmation = '') { if (!is_admin() && !is_agent()) { echo lang_key('dont_have_permission'); die; } if ($confirmation == '') { $data['content'] = load_admin_view('confirmation_view', array('id' => $id, 'url' => site_url('admin/classified/deletepost/' . $page)), TRUE); load_admin_view('template/template_view', $data); } else { if ($confirmation == 'yes') { if (constant("ENVIRONMENT") == 'demo') { $this->session->set_flashdata('msg', '<div class="alert alert-success">Data updated.[NOT AVAILABLE ON DEMO]</div>'); } else { if (is_agent()) { $post = $this->classified_model->get_post_by_id($id); if ($post->created_by != $this->session->userdata('user_id')) { $this->session->set_flashdata('msg', '<div class="alert alert-danger">' . lang_key('invalid_post_id') . '</div>'); } else { $this->classified_model->delete_post_by_id($id); $this->session->set_flashdata('msg', '<div class="alert alert-success">' . lang_key('post_deleted') . '</div>'); } } else { $this->classified_model->delete_post_by_id($id); $this->session->set_flashdata('msg', '<div class="alert alert-success">' . lang_key('post_deleted') . '</div>'); } } } redirect(site_url('admin/classified/allposts/' . $page)); } }
public function __construct() { parent::__construct(); is_installed(); #defined in auth helper checksavedlogin(); #defined in auth helper if (!is_admin() && !is_agent()) { if (count($_POST) <= 0) { $this->session->set_userdata('req_url', current_url()); } redirect(site_url('admin/auth')); } $this->per_page = get_per_page_value(); #defined in auth helper $this->load->model('admin_model'); $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>'); }
public function reactivateestate($page = '0', $id = '', $confirmation = '') { if (!is_admin() && !is_agent()) { echo 'You don\'t have permission for this action'; die; } if (constant("ENVIRONMENT") == 'demo') { $this->session->set_flashdata('msg', '<div class="alert alert-success">Data updated.[NOT AVAILABLE ON DEMO]</div>'); } else { $data = array(); if (is_admin()) { $data['status'] = 1; } else { $publish_directly = get_settings('realestate_settings', 'publish_directly', 'Yes'); $data['status'] = $publish_directly == 'Yes' ? 1 : 2; // 2 = pending } $this->realestate_model->update_post_by_id($data, $id); if ($data['status'] == 1) { $this->session->set_flashdata('msg', '<div class="alert alert-success">Post Approved</div>'); } else { $this->session->set_flashdata('msg', '<div class="alert alert-success">Post activated and now waiting for admin approval</div>'); } } if (is_admin()) { redirect(site_url('admin/realestate/allestates/' . $page)); } else { redirect(site_url('admin/realestate/allestatesagent/' . $page)); } }
<?php include_once "function.php"; is_agent(); $id = $_GET['id']; $rec = mysql_query("select * from `record` where `id`='{$id}'"); $res = mysql_fetch_array($rec); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> Court | Dashboard</title> <!-- Tell the browser to be responsive to screen width --> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <!-- Bootstrap 3.3.4 --> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <!-- FontAwesome 4.3.0 --> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> <!-- Ionicons 2.0.0 --> <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" /> <!-- Theme style --> <link href="css/AdminLTE.min.css" rel="stylesheet" type="text/css" /> <!-- AdminLTE Skins. Choose a skin from the css/skins folder instead of downloading all of them to reduce the load. --> <link href="css/_all-skins.min.css" rel="stylesheet" type="text/css" /> <!-- iCheck --> <link href="css/flat/purple.css" rel="stylesheet" type="text/css" />
function is_bot($agent = false) { $bots = array('googlebot', 'bingbot', 'yahoo! slurp', 'baiduspider', 'yandexbot'); return is_agent(implode('|', $bots), $agent); }