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
function getBrowser()
{
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version= "";
//First get the platform?
if (preg_match('/linux/i', $u_agent)) {
$platform = 'linux';
}
elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
$platform = 'mac';
}
elseif (preg_match('/windows|win32/i', $u_agent)) {
$platform = 'windows';
}
// Next get the name of the useragent yes seperately and for good reason
if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent))
{
$bname = 'Internet Explorer';
$ub = "MSIE";
}
elseif(preg_match('/Firefox/i',$u_agent))
{
$bname = 'Mozilla Firefox';
$ub = "Firefox";
}
elseif(preg_match('/Chrome/i',$u_agent))
{
$bname = 'Google Chrome';
$ub = "Chrome";
}
elseif(preg_match('/Safari/i',$u_agent))
{
$bname = 'Apple Safari';
$ub = "Safari";
}
elseif(preg_match('/Opera/i',$u_agent))
{
$bname = 'Opera';
$ub = "Opera";
}
elseif(preg_match('/Netscape/i',$u_agent))
{
$bname = 'Netscape';
$ub = "Netscape";
}
// finally get the correct version number
$known = array('Version', $ub, 'other');
$pattern = '#(?' . join('|', $known) .
')[/ ]+(?[0-9.|a-zA-Z.]*)#';
if (!preg_match_all($pattern, $u_agent, $matches)) {
// we have no matching number just continue
}
// see how many we have
$i = count($matches['browser']);
if ($i != 1) {
//we will have two since we are not using 'other' argument yet
//see if version is before or after the name
if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){
$version= $matches['version'][0];
}
else {
$version= $matches['version'][1];
}
}
else {
$version= $matches['version'][0];
}
// check if we have a number
if ($version==null || $version=="") {$version="?";}
return array(
'userAgent' => $u_agent,
'name' => $bname,
'version' => $version,
'platform' => $platform,
'pattern' => $pattern
);
}
// now try it
$ua=getBrowser();
$browser= $ua['name'];
$browser_version= $ua['version'];
//echo $yourbrowser.' = '.$yourbrowser_version;
$lat = "-6.1419799";
$lng = "35.7257799";
$data = file_get_contents("http://maps.google.com/maps/api/geocode/json?latlng=$lat,$lng&sensor=false");
$data = json_decode($data);
$add_array = $data->results;
if($add_array=='' || empty($add_array) || !($add_array)){
//continue;
}else{
$add_array = $add_array[0];
$add_array = $add_array->address_components;
}
$country = "Not found";
$state = "Not found";
$city = "Not found";
foreach ($add_array as $key) {
if($key->types[0] == 'administrative_area_level_2')
{
$city = $key->long_name;
}
if($key->types[0] == 'administrative_area_level_1')
{
$state = $key->long_name;
}
if($key->types[0] == 'country')
{
$country = $key->long_name;
}
}
$location= $country." , ".$state.", ".$city;
//echo $location;
$location='Not Found';
date_default_timezone_set('Africa/Nairobi');
if($this->session->userdata('type')=='Admin'){
$session_reg_number ='Admin';
}else{
$session_reg_number=$this->session->userdata('reg_number');
}
$data=array(
"school_id"=>$this->session->userdata('school_id'),
"reg_number"=> $session_reg_number,
"category"=>$this->session->userdata('type'),
"date"=>date("l jS \of F Y "),
"time"=>date("h:i:sa"),
"year"=>date("Y"),
"device"=>$device,
"browser"=>$browser,
"browser_version"=>$browser_version,
"location"=>$location,
);
$data1=array(
"date"=>date("l jS \of F Y "),
"time"=>date("h:i:sa"),
"year"=>date("Y"),
"device"=>$device,
"browser"=>$browser,
"browser_version"=>$browser_version,
"location"=>$location,
);
$this->db->where('school_id',$this->session->userdata('school_id'));
$this->db->where('reg_number', $session_reg_number);
$this->db->where('category', $this->session->userdata('type'));
$this->db->where('year', date('Y'));
$count=$this->db->count_all_results('site_visit');
if($count>0){
$this->db->where('school_id',$this->session->userdata('school_id'));
$this->db->where('reg_number', $session_reg_number);
$this->db->where('category', $this->session->userdata('type'));
$this->db->where('year', date('Y'));
$this->db->update('site_visit',$data1);
}else{
$this->db->insert('site_visit',$data);
}
$this->load->view('users/primary/upgrade_primary');
$this->load->view('users/primary/upgrade_nursery');
$this->load->view('users/primary/search_full_reports');
// exit();
?>