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); compress($storagename, $storagename, 50); $data_ary = array( 'title' => $this->input->post('title'), 'registered_by' => $this->session->userdata('username'), 'file' => $target, 'school'=>$this->input->post('school') ); $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); $data_ary = array( 'title' => $this->input->post('title'), 'registered_by' => $this->session->userdata('username'), 'file' => $target, 'school'=>$this->input->post('school') ); $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() { $target=""; 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/news/". $target; if(move_uploaded_file($_FILES["file"]["tmp_name"], $storagename)){ compress($storagename, $storagename, 50); } } } if($_POST){ $data_ary = array( 'title' => $this->input->post('title'), 'content' => $this->input->post('content'), 'file'=>$target, 'school'=>$this->input->post('school'), 'date'=>date('d M, Y') ); //clean posted data $data_ary = $this->security->xss_clean($data_ary); $this->db->insert('news', $data_ary); redirect('admin/news?ok'); }else{ redirect('admin/news?fail'); } } public function post_project() { $target=""; 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/news/". $target; if(move_uploaded_file($_FILES["file"]["tmp_name"], $storagename)){ compress($storagename, $storagename, 50); } } } if($_POST){ $data_ary = array( 'title' => $this->input->post('title'), 'content' => $this->input->post('content'), 'file'=>$target, //'school'=>$this->input->post('school'), 'date'=>date('d M, Y') ); //clean posted data $data_ary = $this->security->xss_clean($data_ary); $this->db->insert('projects', $data_ary); redirect('admin/project?ok'); }else{ redirect('admin/project?fail'); } } public function editProject() { $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('projects', $data_ary); redirect('admin/editProject?id='.$_REQUEST['id']); } 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 deleteProject() { $id=base64_decode($_REQUEST['id']); $this->db->where('id',$id); $this->db->delete('projects'); redirect('admin/viewProject'); } 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); foreach($this->db->get('documents')->result() as $doc){ $file = $doc->file; if(file_exists('admin/images/documents/'.$file)){ unlink('./admin/images/documents/'.$file); } } $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); } }