Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
load->view('includes/header');
$this->load->view('pages/home');
$this->load->view('includes/footer');
}
function add_photos() {
if (isset($_FILES["file"])) {
//if there was an error uploading the file
if ($_FILES["file"]["error"] > 0) {
echo "Return Code: " . $_FILES["file"]["error"] . "
";
} else {
$filename = basename($_FILES['file']['name']);
$new = time() . rand();
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$target = $new . '_' . $filename;
$target = str_replace(" ", "_", $target);
$storagename = "./images/photos/" . $target;
move_uploaded_file($_FILES["file"]["tmp_name"], $storagename);
function formatBytes($bytes, $precision) {
$units = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
// Uncomment one of the following alternatives
$bytes /= pow(1024, $pow);
// $bytes /= (1 << (10 * $pow));
return round($bytes, $precision) . ' ' . $units[$pow];
}
$data_ary = array(
'title' => $this->input->post('title'),
'category' => $this->input->post('category'),
'registered_by' => $this->session->userdata('username'),
'file' => $target
);
$data_ary = $this->security->xss_clean($data_ary);
$this->load->database();
$this->db->insert('photos', $data_ary);
redirect('admin/add_photo?ok');
}
} else {
echo 'not sent';
}
}
function add_doc() {
if (isset($_FILES["file"])) {
//if there was an error uploading the file
if ($_FILES["file"]["error"] > 0) {
echo "Return Code: " . $_FILES["file"]["error"] . "
";
} else {
$filename = basename($_FILES['file']['name']);
$new = time() . rand();
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$target = $new . '_' . $filename;
$target = str_replace(" ", "_", $target);
$storagename = "./images/documents/". $target;
move_uploaded_file($_FILES["file"]["tmp_name"], $storagename);
function formatBytes($bytes, $precision) {
$units = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
// Uncomment one of the following alternatives
$bytes /= pow(1024, $pow);
// $bytes /= (1 << (10 * $pow));
return round($bytes, $precision) . ' ' . $units[$pow];
}
$data_ary = array(
'title' => $this->input->post('title'),
'type' => $this->input->post('type'),
'registered_by' => $this->session->userdata('username'),
'file' => $target
);
$data_ary = $this->security->xss_clean($data_ary);
$this->load->database();
$this->db->insert('documents', $data_ary);
redirect('admin/add_doc?ok');
}
} else {
echo 'not sent';
}
}
public function post_news() {
$data_ary = array(
'title' => $this->input->post('title'),
'content' => $this->input->post('content',FALSE),
'posted_by' => $this->session->userdata('full_name'),
);
//clean posted data
$data_ary = $this->security->xss_clean($data_ary);
$this->db->insert('news', $data_ary);
redirect('admin/news?ok');
}
public function edit_news() {
$data_ary = array(
'title' => $this->input->post('title'),
'content' => $this->input->post('content'),
);
//clean posted data
$id=base64_decode($_REQUEST['id']);
$data_ary = $this->security->xss_clean($data_ary);
$this->db->where('id',$id);
$this->db->update('news', $data_ary);
redirect('admin/edit_news?id='.$_REQUEST['id']);
}
public function edit_staff_name() {
$data_ary = array(
'name' => $this->input->post('name'),
);
//clean posted data
$id=base64_decode($_REQUEST['id']);
$data_ary = $this->security->xss_clean($data_ary);
$this->db->where('id',$id);
$this->db->update('staffs', $data_ary);
redirect('admin/view_staffs');
}
public function delete_news() {
$id=base64_decode($_REQUEST['id']);
$this->db->where('id',$id);
$this->db->delete('news');
redirect('admin/view_news');
}
public function delete_photo() {
$id=base64_decode($_REQUEST['id']);
$this->db->where('id',$id);
$this->db->delete('photos');
redirect('admin/view_photo');
}
public function delete_doc() {
$id=base64_decode($_REQUEST['id']);
$this->db->where('id',$id);
$this->db->delete('documents');
redirect('admin/view_doc');
}
public function delete_staffs() {
$id=base64_decode($_REQUEST['id']);
$this->db->where('id',$id);
$this->db->delete('staffs');
redirect('admin/view_doc');
}
public function testcodes() {
$data = array(
'username' => $this->input->post('name'),
'pass' => $this->input->post('pwd')
);
//insert goes here...
echo 'yes data';
//echo json_encode($data);
}
}