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
session->userdata('user_type')) { $this->session->set_flashdata('flash_data', 'You don\'t have access!'); redirect('Welcome'); }elseif($this->session->userdata('user_type')!='employee'){ $this->session->set_flashdata('flash_data', 'You don\'t have access!'); redirect('Learning'); } //convert numeric number to roman function numberToRomanRepresentation($number) { $map = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'x' => 10, 'ix' => 9, 'v' => 5, 'iv' => 4, 'i' => 1); $returnValue = ''; while ($number > 0) { foreach ($map as $roman => $int) { if($number >= $int) { $number -= $int; $returnValue .= $roman; break; } } } return $returnValue; } } public function informationCategories() { $this->load->view('includes/header'); $this->load->view('pages/informationCategories'); $this->load->view('includes/footer'); } public function uploadInformation() { $this->load->view('includes/header'); $this->load->view('pages/uploadInformation'); $this->load->view('includes/footer'); } public function uploadInformationImage() { $this->load->view('includes/header'); $this->load->view('pages/uploadInformationImage'); $this->load->view('includes/footer'); } public function viewInformation() { $this->load->view('includes/header'); $this->load->view('pages/viewInformation'); $this->load->view('includes/footer'); } public function registerMarket() { $this->load->view('includes/header'); $this->load->view('pages/registerMarket'); $this->load->view('includes/footer'); } public function marketProduct() { $this->load->view('includes/header'); $this->load->view('pages/marketProduct'); $this->load->view('includes/footer'); } public function updatePricess() { $this->load->view('includes/header'); $this->load->view('pages/updatePricess'); $this->load->view('includes/footer'); } public function productCategories() { $this->load->view('includes/header'); $this->load->view('pages/productCategories'); $this->load->view('includes/footer'); } public function userfulLinks() { $this->load->view('includes/header'); $this->load->view('pages/userfulLinks'); $this->load->view('includes/footer'); } public function updateProductPrices() { $this->load->view('includes/header'); $this->load->view('pages/updateProductPrices'); $this->load->view('includes/footer'); } public function addCategory() { $c=$this->db->where('name',$this->input->post('name'))->get('business_categories')->num_rows(); if($c==0){ $data = array( 'name'=>$this->input->post('name'), 'date'=>date('Y-m-d H:i:s'), 'regBy'=>$this->session->userdata('id') ); $this->db->insert('business_categories',$data); redirect('information/informationCategories?saved'); }else{ redirect('information/informationCategories?ex'); } } public function addProductCategory() { $c=$this->db->where('name',$this->input->post('name'))->get('productCategories')->num_rows(); if($c==0){ $data = array( 'name'=>$this->input->post('name'), 'date'=>date('Y-m-d H:i:s'), ); $this->db->insert('productCategories',$data); redirect('information/productCategories?saved'); }else{ redirect('information/productCategories?ex'); } } public function editCategory() { if($_POST){ $data = array( 'name'=>$this->input->post('name'), ); $this->db->where('id',base64_decode($_REQUEST['id']))->update('business_categories',$data); redirect($_SERVER['HTTP_REFERER']); }else{ redirect($_SERVER['HTTP_REFERER']); } } public function editProductCategory() { if($_POST){ $data = array( 'name'=>$this->input->post('name'), ); $this->db->where('id',base64_decode($_REQUEST['id']))->update('productCategories',$data); redirect($_SERVER['HTTP_REFERER']); }else{ redirect($_SERVER['HTTP_REFERER']); } } public function selectDate() { $d=base64_encode($this->input->post('priceDate')); $id=base64_encode($this->input->post('id')); redirect('information/updateProductPrices?id='.$id.'&d='.$d); } public function addUpdatedPrice() { if($_POST){ $data = array( 'product_id'=>$this->input->post('product_id'), 'market_id'=>$this->input->post('market_id'), 'minPrice'=>$this->input->post('minPrice'), 'maxPrice'=>$this->input->post('maxPrice'), 'priceDate'=>$this->input->post('priceDate'), 'description'=>$this->input->post('description'), 'date'=>date('Y-m-d H:i:s'), 'regBy'=>$this->session->userdata('id'), ); $this->db->insert('marketProductPrices',$data); redirect($_SERVER['HTTP_REFERER']); }else{ redirect($_SERVER['HTTP_REFERER']); } } public function addMarket() { $c=$this->db->where('name',$this->input->post('name'))->get('markets')->num_rows(); if($c==0){ $data = array( 'name'=>$this->input->post('name'), 'desc'=>$this->input->post('desc'), 'region_id'=>$this->input->post('region'), 'district_id'=>$this->input->post('district'), 'date'=>date('Y-m-d H:i:s'), 'regBy'=>$this->session->userdata('id') ); $this->db->insert('markets',$data); redirect('information/registerMarket?saved'); }else{ redirect('information/registerMarket?ex'); } } public function editUpdatedPrice() { if($_POST){ $data = array( 'product_id'=>$this->input->post('product_id'), 'minPrice'=>$this->input->post('minPrice'), 'maxPrice'=>$this->input->post('maxPrice'), 'priceDate'=>$this->input->post('priceDate'), 'description'=>$this->input->post('description'), ); $this->db->where('id',base64_decode($_REQUEST['id']))->update('marketProductPrices',$data); redirect($_SERVER['HTTP_REFERER']); }else{ redirect($_SERVER['HTTP_REFERER']); } } public function editInformation() { if($_POST){ $cont=$this->input->post('contents'); $cont=str_replace('

','',$cont); $cont=str_replace('

','

',$cont); $data = array( 'title'=>$this->input->post('title'), 'author'=>$this->input->post('author'), 'contents'=>$cont, ); $this->db->where('id',base64_decode($_REQUEST['id']))->update('business_informations',$data); redirect($_SERVER['HTTP_REFERER']); }else{ redirect($_SERVER['HTTP_REFERER']); } } public function get_cat() { $id=$this->input->post('cat'); $mid=$this->input->post('mid'); $date=$this->input->post('date'); foreach($this->db->where('category_id',$id)->get('marketProduct')->result() as $rowr){ $c= $this->db->where('market_id',$mid)->where('product_id',$rowr->id)->where('priceDate',$date)->get('marketProductPrices')->num_rows(); if($c>0){ continue; } ?> 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 = "./template/img/markets/".$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]; } $type = explode('/',$_FILES['file']['type']); $type = $type[0]; $data = array( 'name'=>$this->input->post('name'), 'kipimo'=>$this->input->post('kipimo'), 'category_id'=>$this->input->post('category'), 'file' => $target, ); //unlink file foreach($this->db->where('id',base64_decode($_REQUEST['id']))->get('marketProduct')->result() as $rows){ $Path="./template/img/markets/".$rows->file; if (file_exists($Path)){ unlink($Path); } } $this->db->where('id',base64_decode($_REQUEST['id']))->update('marketProduct',$data); redirect($_SERVER['HTTP_REFERER']); } } else { $data = array( 'name'=>$this->input->post('name'), 'kipimo'=>$this->input->post('kipimo'), 'category_id'=>$this->input->post('category'), ); $this->db->where('id',base64_decode($_REQUEST['id']))->update('marketProduct',$data); redirect($_SERVER['HTTP_REFERER']); } } public function aditMarket() { if($_POST){ $data = array( 'name'=>$this->input->post('name'), 'desc'=>$this->input->post('desc'), 'region_id'=>$this->input->post('region'), 'district_id'=>$this->input->post('district'), ); $this->db->where('id',base64_decode($_REQUEST['id']))->update('markets',$data); redirect($_SERVER['HTTP_REFERER']); }else{ redirect($_SERVER['HTTP_REFERER']); } } public function editusefulLink() { if($_POST){ $data = array( 'name' => $this->input->post('name'), 'shortName' => $this->input->post('shortName'), 'link' => $this->input->post('link'), ); $this->db->where('id',base64_decode($_REQUEST['id']))->update('usefulLinks',$data); redirect($_SERVER['HTTP_REFERER']); }else{ redirect($_SERVER['HTTP_REFERER']); } } public function delete_usefulLink() { $this->db->where('id',base64_decode($_REQUEST['id']))->delete('usefulLinks'); redirect($_SERVER['HTTP_REFERER']); } public function delete_category() { $this->db->where('id',base64_decode($_REQUEST['id']))->delete('business_categories'); redirect($_SERVER['HTTP_REFERER']); } public function delete_info() { //fetch Image files to delete... foreach($this->db->where('information_id',base64_decode($_REQUEST['id']))->get('informationImages')->result() as $rowsImage){ //unlink image file $Path="./template/img/business_informations/".$rowsImage->file; if (file_exists($Path)){ unlink($Path); } } //delete from the database $this->db->where('id',base64_decode($_REQUEST['id']))->delete('business_informations'); $this->db->where('activity_id',base64_decode($_REQUEST['id']))->where('category','business')->delete('notifications'); redirect($_SERVER['HTTP_REFERER']); } public function delete_market() { $this->db->where('id',base64_decode($_REQUEST['id']))->delete('markets'); redirect($_SERVER['HTTP_REFERER']); } public function deleteMarketProduct() { $this->db->where('id',base64_decode($_REQUEST['id']))->delete('marketProduct'); redirect($_SERVER['HTTP_REFERER']); } public function delete_ProductCategory() { $this->db->where('id',base64_decode($_REQUEST['id']))->delete('productCategories'); redirect('information/productCategories?del'); } public function delete_UpdatedPrice() { $this->db->where('id',base64_decode($_REQUEST['id']))->delete('marketProductPrices'); redirect($_SERVER['HTTP_REFERER']); } public function delete_infoImage() { $this->db->where('id',base64_decode($_REQUEST['id']))->delete('informationImages'); //unlink image file $Path="./template/img/business_informations/".base64_decode($_REQUEST['file']); if (file_exists($Path)){ unlink($Path); } redirect($_SERVER['HTTP_REFERER']); } public function sendInformationMultiple() { $cont=$this->input->post('contents'); $cont=str_replace('

','',$cont); $cont=str_replace('

','

',$cont); $data_ary = array( 'category_id' => $this->input->post('category_id'), 'title' => $this->input->post('title'), 'author' => $this->input->post('author'), 'contents' => $cont, 'date'=>date('Y-m-d'), 'regBy'=>$this->session->userdata('id'), ); $data_ary = $this->security->xss_clean($data_ary); $this->load->database(); $this->db->insert('business_informations', $data_ary); $info_id = $this->db->insert_id(); // notification here $note = array( 'content'=>'added new business information', 'category'=>'business', 'activity_id'=>$info_id, 'audience'=>'all', 'date'=>date('Y-m-d H:i:s'), ); $this->db->insert('notifications',$note); if (isset($_FILES["files"])) { extract($_POST); $error=array(); $extension=array("jpeg","jpg","png","gif"); foreach($_FILES["files"]["tmp_name"] as $key=>$tmp_name) { $file_name=$_FILES["files"]["name"][$key]; $file_tmp=$_FILES["files"]["tmp_name"][$key]; $ext=pathinfo($file_name,PATHINFO_EXTENSION); $new = time() . rand(); $target = $new . '_' . $file_name; $file_name = str_replace(" ", "_", $target); $storage="./template/img/business_informations"; if(in_array($ext,$extension)) { move_uploaded_file($file_tmp=$_FILES["files"]["tmp_name"][$key],$storage."/".$file_name); // upload Images here $image = array( 'information_id'=>$info_id, 'file'=>$file_name, 'date'=>date('Y-m-d H:i:s'), ); $this->db->insert('informationImages',$image); }else { array_push($error,"$file_name, "); } } } redirect($_SERVER['HTTP_REFERER']); } public function editInformationMultiple() { if (isset($_FILES["files"])) { extract($_POST); $error=array(); $extension=array("jpeg","jpg","png","gif"); foreach($_FILES["files"]["tmp_name"] as $key=>$tmp_name) { $file_name=$_FILES["files"]["name"][$key]; $file_tmp=$_FILES["files"]["tmp_name"][$key]; $ext=pathinfo($file_name,PATHINFO_EXTENSION); $new = time() . rand(); $target = $new . '_' . $file_name; $file_name = str_replace(" ", "_", $target); $storage="./template/img/business_informations"; if(in_array($ext,$extension)) { move_uploaded_file($file_tmp=$_FILES["files"]["tmp_name"][$key],$storage."/".$file_name); // upload Images here $image = array( 'information_id'=>$this->input->post('id'), 'file'=>$file_name, 'date'=>date('Y-m-d H:i:s'), ); $this->db->insert('informationImages',$image); }else { array_push($error,"$file_name, "); } } } redirect($_SERVER['HTTP_REFERER']); } public function sendInformation() { 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 = "./template/img/business_informations/". $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]; } $type = explode('/',$_FILES['file']['type']); $type = $type[0]; $data_ary = array( 'category_id' => $this->input->post('category_id'), 'title' => $this->input->post('title'), 'contents' => $this->input->post('contents'), 'file' => $target, 'type' => $type, 'date'=>date('Y-m-d'), 'regBy'=>$this->session->userdata('id'), ); $data_ary = $this->security->xss_clean($data_ary); $this->load->database(); $this->db->insert('business_informations', $data_ary); $info_id = $this->db->insert_id(); // notification here $note = array( 'content'=>'added new business information', 'category'=>'business', 'activity_id'=>$info_id, 'audience'=>'all', 'date'=>date('Y-m-d H:i:s'), ); $this->db->insert('notifications',$note); redirect($_SERVER['HTTP_REFERER']); } } else { echo 'not sent'; } } public function addUsefulLink() { 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 = "./template/img/business_informations/". $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]; } $type = explode('/',$_FILES['file']['type']); $type = $type[0]; $data_ary = array( 'name' => $this->input->post('name'), 'shortName' => $this->input->post('shortName'), 'link' => $this->input->post('link'), 'file' => $target, 'date'=>date('Y-m-d'), 'regBy'=>$this->session->userdata('id'), ); $data_ary = $this->security->xss_clean($data_ary); $this->db->insert('usefulLinks', $data_ary); redirect($_SERVER['HTTP_REFERER']); } } else { echo 'not sent'; } } public function registerProduct() { $c=$this->db->where('name',$this->input->post('name'))->get('marketProduct')->num_rows(); if($c==0){ 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 = "./template/img/markets/". $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]; } $type = explode('/',$_FILES['file']['type']); $type = $type[0]; $data = array( 'name'=>$this->input->post('name'), 'kipimo'=>$this->input->post('kipimo'), 'category_id'=>$this->input->post('category'), 'date'=>date('Y-m-d H:i:s'), 'file' => $target, 'regBy'=>$this->session->userdata('id') ); $this->db->insert('marketProduct',$data); redirect($_SERVER['HTTP_REFERER']); } } else { echo 'not sent'; } }else{ redirect('information/marketProduct?id='.$_REQUEST['id'].'&ex'); } } }